Main driver GeoStudioFile

Main driver for opening a GeoStudio file and accessing properties of a study:

import PyGeoStudio as pgs
src_file = "Reinforcement with Anchors.gsz"
geofile = pgs.GeoStudioFile(src_file,mode='r')

The following method are callable using for example:

geofile.showMaterials() #show a list of materials
geofile.getMaterialByID(3) #return material with ID 3

Description the availables methods to interact with the study:

class PyGeoStudio.GeoStudioFile(geostudio_file)

Main driver of the librairy that read GeoStudio .gsz file and interface its content through Python

Parameters:

geostudio_file (str) – Path to the GeoStudio file

createNewDataset(name, parameters)

Create a new dataset

Parameters:
  • name (str) – Name of the new dataset

  • params (list) – List of the parameter name. Must match the available dataset parameter in GeoStudio: {self.dataset_parameters.keys()}

getAnalysisByID(ID)

Return the analysis in the analysis tree corresponding to the ID given.

Parameters:

ID (int) – ID of the analysis

getAnalysisByName(name)

Return the analysis in the analysis tree corresponding to the name given.

Parameters:

name (str) – Name of the analysis (must match the name in the analysis tree)

Raises:

ValueError – No analysis found with the given name.

Returns:

The analysis with the given name.

Return type:

Analysis object

getDatasetByName(name)

Return the dataset corresponding to the name given.

Parameters:

name (str) – Name of the dataset

getMaterialByID(ID)

Return the material corresponding to the ID given.

Parameters:

ID (int) – ID of the material

getMaterialByName(name)

Return the material corresponding to the name given.

Parameters:

name (str) – Name of the material

getReinforcementByID(ID)

Return the reinforcement corresponding to the ID given.

Parameters:

ID (int) – ID of the material

getReinforcementByName(name)

Return the reinforcement corresponding to the name given.

Parameters:

name (str) – Name of the reinforcement

save()

Save the modification made by PyGeoStudio to the current GeoStudio file.

saveAs(f_out, compresslevel=5)

Write the (modified) study under a new file. Note the results are not copied to the new study.

Parameters:
  • f_out (str) – Name of the new file (must be different than the input)

  • compresslevel (int) – Level of compression of the output file from 0 (uncompressed) to 9 (fully compressed) (optional, default=1)

showAnalysisTree()

Print the analysis tree in the GeoStudio file with analysis ID, name and parent ID if defined.

showDatasets()

Print a table showing the dataset defined within the GeoStudio file.

showFunctions()

Print a table showing the functions defined within the GeoStudio file.

showGeometries()

Print the geometries definied within the GeoStudio file

showMaterials(detail=0)

Print the material defined within the GeoStudio file.

Parameters:

detail (int (0 or 1)) – Show a table listing minimal properties of the materials (0) or print exhaustive information (1)

showReinforcements(detail=0)

Print the reinforcements defined within the GeoStudio file.

Parameters:

detail (int (0 or 1)) – Show a table listing minimal properties of the reinforcements (0) or print exhaustive information (1)