Open-source sample app CPT interpretation with Robertson

VIKTOR

by VIKTOR

CPT interpretation with Robertson
Interpret soil layouts using the Robertson method with this open-source Python code application. Robertson is the most commonly used CPT interpretation method for geotechnical engineers to determine soil layout. With this open-source app, you can easily interpret CPT's by integrating either with your own Python code or by using the sample application on the VIKTOR platform.
How to create successful application that ensure adoption
Build successful applications

Learn how you (developer, engineer, end-user, domain expert, project manager, etc.) can contribute to the creation of apps that provide real value to your work.

Using the functionality

There are two ways in which you can use the CPT interpretation with Robertson functionality:

I With VIKTOR, out-of-the-box, using our free version.

II Without VIKTOR, by integrating with your own Python code. In this case, you create the following yourself:

  • A parser for the GEF file (reading out a GEF file is really easy by using VIKTOR built-in functionality)
  • A Robertson classifier

In the code block below, you can see the 6 lines of Python code from the built-in functionality that is used to import and read out GEF-files. This code is also used in another open-source sample application that is entirely focused on comparing CPT's with either VIKTOR or by integrating with your own Python code. Read more about the open-source CPT comparison app and get the code from our GitHub repository here.

1from viktor.geo import GEFFile 2 3@ParamsFromFile(file_types=['.gef']) 4def process_file(self, file: File, **kwargs) -> dict: 5 """Process the CPT file when it is first uploaded""" 6 cpt_file = GEFFile(file.getvalue("ISO-8859-1")) 7 return cpt_data_object.serialize()

Below is a code snippet from the CPT interpretation with Robertson sample app. This snippet depicts a function that you can use to automatically classify the soil. The soil classification functionality is included in VIKTOR but in the sample app, users always have the option to overwrite the classification by not allowing for very thin layers or by editing the table directly.

1def classify_cpt_file(cpt_file: GEFFile) -> dict: 2 """Classify an uploaded CPT File based on the selected _ClassificationMethod""" 3 try: 4 # Parse the GEF file content 5 cpt_data_object = cpt_file.parse(additional_columns=ADDITIONAL_COLUMNS, return_gef_data_obj=True) 6 ground_water_level = get_water_level(cpt_data_object) 7 8 # Classify the CPTData object to get a SoilLayout 9 soil_layout_obj = cpt_data_object.classify(method=RobertsonMethod(DEFAULT_ROBERTSON_TABLE), 10 return_soil_layout_obj=True) 11 12 except GEFParsingException as parsing_exception: 13 raise UserException(f"CPT Parsing: {str(parsing_exception)}") from parsing_exception 14 except GEFClassificationError as classification_exception: 15 raise UserException(f"CPT Classification: {str(classification_exception)}") from classification_exception 16 17 # Serialize the parsed CPT File content and update it with the new soil layout 18 cpt_dict = cpt_data_object.serialize() 19 cpt_dict['soil_layout'] = soil_layout_obj 20 cpt_dict["groundwater"] = ground_water_level 21 return cpt_dict

In this video, you can see the functionality being used in a sample application on the VIKTOR platform.


CPT interpretation in 4 steps

As you can see in the video, the process of interpreting a soil layout using the Robertson method consists of four easy steps:

  1. Upload GEF files
  2. Visualize the calculated soil layout
  3. Adjust some parameters, such as minimal thickness, etc.
  4. Generate an overview of the location of each of the uploaded CPT’s on the map

Get the entire Python code from our GitHub repository to integrate with your own code or use the free version to use the app out-of-the-box with VIKTOR!

illustration of free trial

Start building apps now

Try for free
Share

Related Blog Posts

Automate frame section creation in SAP2000 using Python and Excel

Read more

Easily Export and Visualize ETABS Model Results

Read more

How to calculate cross-section properties using Python

Read more

Build and share web apps

Get your free account now
Start for free