The geoh5py library has been created for the manipulation and storage of a wide range of
geoscientific data (points, curve, surface, 2D and 3D grids) in
geoh5 file format.
Users will be able to directly leverage the powerful visualization
capabilities of Geoscience ANALYST along with open-source code from the Python ecosystem.
geoh5py is currently written for Python 3.7 or higher, and depends on NumPy and
h5py.
Note
Users will likely want to take advantage of other packages available in the Python ecosystem. We therefore recommend using Anaconda to manage the installation.
Install geoh5py from PyPI:
$ pip install geoh5py
To install the latest development version of geoh5py, you can use pip with the
latest GitHub development branch:
The core element of a project is the Workspace. A project Workspace holds core information about the author, version and all entities stored in the geoh5 file. It also knows how to create the core structure needed by Geoscience ANALYST for visualization.
You can either open an existing project or create a new project by simply entering the desired file name.
[1]:
fromgeoh5py.workspaceimportWorkspace# Create a new projectworkspace=Workspace("my_project.geoh5")
Groups are effectively containers for other entities, such as Objects (Points, Curve, Surface, etc.) and other Groups. Groups are used to establish parent-child relationships and to store information about a collection of entities.
By default, the parent of any new Entity is the workspace RootGroup. It is the only entity in the Workspace without a parent. Users rarely have to interect with the Root group as it is mainly used to maintain the overall project hierarchy.
A ContainerGroup can easily be added to the workspace and can be assigned a name and description.
[1]:
fromgeoh5py.groupsimportContainerGroupfromgeoh5py.workspaceimportWorkspace# Create a blank projectworkspace=Workspace("my_project.geoh5")# Add a groupgroup=ContainerGroup.create(workspace,name='myGroup')
At creation, "myGroup" is written to the project geoh5 file and visible in the Analyst project tree.
Any entity can be accessed by its name or uid (unique identifier):
The geoh5 format enables storing a wide variety of Object entities that can be displayed in 3D. This section describes the collection of Objects entities currently supported by geoh5py.
The Points object consists of a list of vertices that define the location of actual data in 3D space. As for all other Objects, it can be created from an array of 3D coordinates and added to any group as follow:
[3]:
fromgeoh5py.workspaceimportWorkspacefromgeoh5py.objectsimportPointsimportnumpyasnp# Create a blank projectworkspace=Workspace("my_project.geoh5")# Generate a numpy array of xyz locationsn=100radius,theta=np.arange(n),np.linspace(0,np.pi*8,n)x,y=radius*np.cos(theta),radius*np.sin(theta)z=(x**2.+y**2.)**0.5xyz=np.c_[x.ravel(),y.ravel(),z.ravel()]# Form a 2D array# Create the Point objectpoints=Points.create(workspace,# The target Workspacevertices=xyz# Set vertices)
The Curve object, also known as a polyline, is often used to define contours, survey lines or geological contacts. It is a sub-class of the Points object with the added cells property, that defines the line segments connecting its vertices. By default, all vertices are connected sequentially following the order of the input vertices.
[4]:
fromgeoh5py.objectsimportCurve# Create the Curve objectcurve=Curve.create(workspace,# The target Workspacevertices=xyz)
Alternatively, the cells property can be modified, either directly or by assigning parts identification to each vertices:
[5]:
# Split the curve into two partspart_id=np.ones(n,dtype="int32")part_id[:75]=2# Assign the partcurve.parts=part_idworkspace.finalize()
Drillhole objects are different from other objects as their 3D geometry is defined by the collar and surveys attributes. The vertices and cells properties are only instantiated when interval or point log data are added.
[6]:
fromgeoh5py.objectsimportDrillhole# Create a simple welltotal_depth=100dist=np.linspace(0,total_depth,10)azm=np.ones_like(dist)*45.dip=np.linspace(-89,-75,dist.shape[0])collar=np.r_[0.,10.,10]well=Drillhole.create(workspace,collar=collar,surveys=np.c_[dist,dip,azm])
The Surface object is also described by vertices and cells that form a net of triangles. If omitted on creation, the cells property is calculated using a 2D scipy.spatial.Delaunay triangulation.
[7]:
fromgeoh5py.objectsimportSurfacefromscipy.spatialimportDelaunay# Create a triangulated surface from pointssurf_2D=Delaunay(xyz[:,:2])# Create the Surface objectsurface=Surface.create(workspace,vertices=points.vertices,# Add verticescells=surf_2D.simplices)
The Grid2D object defines a regular grid of cells often used to display model sections or to compute data derivatives. A Grid2D can be oriented in 3D space using the origin, rotation and dip parameters.
[8]:
fromgeoh5py.objectsimportGrid2D# Create the Surface objectgrid=Grid2D.create(workspace,origin=[25,-75,50],u_cell_size=2.5,v_cell_size=2.5,u_count=64,v_count=16,rotation=90.0,dip=45.0,)
The BlockModel object defines a rectilinear grid of cells, also known as a tensor mesh. The cells center position is determined by cell_delimiters (offsets) along perpendicular axes (u, v, z) and relative to the origin. BlockModel can be oriented horizontally by controlling the rotation parameter.
[9]:
fromgeoh5py.objectsimportBlockModel# Create the Surface objectblockmodel=BlockModel.create(workspace,origin=[25,-100,50],u_cell_delimiters=np.cumsum(np.ones(16)*5),# Offsets along uv_cell_delimiters=np.cumsum(np.ones(32)*5),# Offsets along vz_cell_delimiters=np.cumsum(np.ones(16)*-2.5),# Offsets along z (down)rotation=30.0)
The Octree object is type of 3D grid that uses a tree structure to define cells. Each cell can be subdivided it into eight octants allowing for a more efficient local refinement of the mesh. The Octree object can also be oriented horizontally by controlling the rotation parameter.
[10]:
fromgeoh5py.objectsimportOctreeoctree=Octree.create(workspace,origin=[25,-100,50],u_count=16,# Number of cells in power 2v_count=32,w_count=16,u_cell_size=5.0,# Base cell size (highest octree level)v_cell_size=5.0,w_cell_size=2.5,# Offsets along z (down)rotation=30,)
By default, the octree mesh will be refined at the lowest level possible along each axes.
Data can be added to an Object entity using the add_data method.
[11]:
# Create a straight Curve objectcurve=Curve.create(workspace,# The target Workspacename='FlightLine3',vertices=np.c_[np.linspace(0,100,100),np.zeros(100),np.zeros(100)])# Add a single string commentcurve.add_data({"my_comment":{"association":"OBJECT","values":"hello_world"}})# Add a vector of floatscurve.add_data({"my_cell_values":{"association":"CELL","values":np.random.randn(curve.n_cells)}})# Add multiple data vectors on a single calldata={}foriiinrange(8):data[f"Period:{ii}"]={"association":"VERTEX","values":(ii+1)*np.cos(ii*curve.vertices[:,0]*np.pi/curve.vertices[:,0].max()/4.)}data_list=curve.add_data(data)print([obj.nameforobjindata_list])
If the association argument is omited, geoh5py will attempt to assign the data to the correct part based on the shape of the data values, either object.n_values or object.n_cells
The newly created data is directly added to the project’s geoh5 file and available for visualization:
Just like any Entity, data can be retrieved from the Workspace using the get_entity method. For convenience, Objects also have a get_data_list and get_data method that focusses only on their respective children Data.
Log data are used to represent measurements recorded at discrete depths along the well path. A depth attribute is required on creation. If the Drillhole object already holds point log data, geoh5py will attempt to match collocated depths within tolerance. By default, depth markers within 1 centimeter are merged (collocation_distance=1e-2).
[13]:
depths_A=np.arange(0,50.)# First list of depth# Second list slightly offsetted on the first few depthsdepths_B=np.arange(47.1,100)# Add both set of log data with 0.5 m tolerancewell.add_data({"my_log_values":{"depth":depths_A,"values":np.random.randn(depths_A.shape[0]),},"log_wt_tolerance":{"depth":depths_B,"values":np.random.randn(depths_B.shape[0]),"collocation_distance":0.5}})
[13]:
[<geoh5py.data.float_data.FloatData at 0x7fe252b3ee50>,
<geoh5py.data.float_data.FloatData at 0x7fe252bebd90>]
Interval log data are defined by constant values bounded by a start an end depth. A from-to attribute is expected on creation. Users can also control matching intervals by supplying a tolerance argument in meters (default tolerance:1e-3 meter).
[14]:
# Add some geology as interval datawell.add_data({"interval_values":{"values":[1,2,3],"from-to":np.vstack([[0.25,25.5],[30.1,55.5],[56.5,80.2]]),"value_map":{1:"Unit_A",2:"Unit_B",3:"Unit_C"},"type":"referenced",}})
[14]:
<geoh5py.data.referenced_data.ReferencedData at 0x7fe252ba8d10>
Data entities sharing the same parent Object and association can be linked within a property_groups and made available through profiling. This can be used to group data that would normally be stored as 2D array.
[15]:
# Add another VERTEX data and create a group with previouscurve.add_data_to_group([obj.nameforobjindata_list],"my_trig_group")
[15]:
<geoh5py.groups.property_group.PropertyGroup at 0x7fe252bab310>
[16]:
# Update the geoh5 and re-write the Rootworkspace.finalize()
This object is meant to handle direct-current resistivity surveys. The survey object is made up of two curve entities defining the transmitter (current) and receiver (potential) electrodes. The following example shows how to generate a survey from scratch.
The CurrentElectrode entity defines the A-B dipole pairs used to inject current into the ground. It is a sub-class of the Curve object, defined by vertices (poles) and cells (dipole segments). Here we generate four (4) parallel EW lines with eight dipoles per line.
[1]:
importnumpyasnpimportuuidfromgeoh5py.workspaceimportWorkspacefromgeoh5py.objectsimportCurrentElectrode,PotentialElectrode# Create a new projectworkspace=Workspace("my_project.geoh5")# Define the pole locationsn_poles=9n_lines=2x_loc,y_loc=np.meshgrid(np.linspace(0,60,n_poles),np.linspace(-20,20.,n_lines))vertices=np.c_[x_loc.ravel(),y_loc.ravel(),np.zeros_like(x_loc).ravel()]# Assign a line ID to the poles (vertices)parts=np.kron(np.arange(n_lines),np.ones(n_poles)).astype('int')# Create the CurrentElectrode objectcurrents=CurrentElectrode.create(workspace,vertices=vertices,parts=parts)
At this stage the CurrentElectrode object has segments (cells) connecting all poles in series along line.
A key element of the DCIP survey objects is the ab_cell_id property. This ReferenceData contains the map referencing each cell of the CurrentElectrode object to a unique A-B source identifier with name.
currents.ab_cell_id.value_map.map = {
0: “Unknown”, 1: “AB_100”, 2: “AB_200”, … }
The utility function add_default_ab_cell_id can help generate this map with a simple name string incrementor.
Users may wish to alter the value_map names to carry forward specific survey information.
Note: The first entry {0:Unknown} is a reserved field used by Geoscience ANALYST to flag unknown data entries.
In this specific case, every cell on the curve corresponds to a unique dipole source current. For more complex survey configurations, users can edit the cell property in order to define different combinations of connections between poles.
The PotentialElectrode object defines the M-N dipole pairs used to measure the electric potential (receivers). Just like the CurrentElectrode, it is a sub-class of the Curve object defined by vertices (poles) and cells (dipoles).
Although poles could be set independently on the CurrentElectrode and PotentialElectrode objects, here we re-uses the same locations for simplicity:
Next, we must define the receiver dipoles. The following routine generates a maximum of six (6) receivers dipoles per injection currents along line.
[7]:
N=6dipoles=[]current_id=[]forvalincurrents.ab_cell_id.values:# For each source dipolecell_id=int(currents.ab_map[val])-1# Python 0 indexingline=currents.parts[currents.cells[cell_id,0]]form_ninrange(N):dipole_ids=(currents.cells[cell_id,:]+2+m_n).astype("uint32")# Skip two poles# Shorten the array as we get to the end of the lineif(any(dipole_ids>(potentials.n_vertices-1))orany(currents.parts[dipole_ids]!=line)):continuedipoles+=[dipole_ids]# Save the receiver idcurrent_id+=[val]# Save the source idpotentials.cells=np.vstack(dipoles)
Finally, users need to create an association between each receiver dipole (M-N) to a dipole current (A-B). The mapping is done through the ab_cell_id property of the PotentialElectrode. An integer (ID) value must be assigned to each cell, corresponding to the AB Cell ID pairs stored on the associated CurrentElectrode object.
Rectilinear 3D tensor mesh defined by three perpendicular axes.
Each axis is divided into discrete intervals that define the cell dimensions.
Nodal coordinates are determined relative to the origin and the sign of cell delimiters.
Negative and positive cell delimiters
are accepted to denote relative offsets from the origin.
numpy.array of int, shape
(n_vertices, 2):
Group identifiers for vertices connected by line segments as defined by the
cells
property. The definition of the cells
property get modified by the setting of parts.
Create Data specific to the drillhole object
from dictionary of name and arguments. A keyword ‘depth’ or ‘from-to’
with corresponding depth values is expected in order to locate the
data along the well path.
Parameters
data – Dictionary of data to be added to the object, e.g.
Rectilinear 2D grid of uniform cell size. The grid can
be oriented in 3D space through horizontal rotation
and dip parameters.
Nodal coordinates are determined relative to the origin and the sign
of cell delimiters.
numpy.ndarray of int,
shape (n_cells, 4):
Array defining the i, j, k position and size of each cell.
The size defines the width of a cell in number of base cells.
If the given name is not a valid one, transforms it to make it valid
:return: a valid name built from the given name. It simply returns the given name
if it was already valid.
Remove children from the list of children entities.
Parameters
children – List of entities
Warning
Removing a child entity without re-assigning it to a different
parent may cause it to become inactive. Inactive entities are removed
from the workspace by
remove_none_referents().
Gets the referent value for the given key in a some_dict of weakref values.
In case key points to a reference to a deleted value, remove that key from some_dict
on the fly, and returns None.
Parameters
some_dict – The dictionary of weakref values.
key – The key
Returns
the referent value for key if found in the the dictionary, else None.
The GEOH5 format aims to provide a robust means of handling large quantities
of diverse data required in geoscience. The file structure builds on the
generic qualities of the Geoscience ANALYST
data model, and attempts to maintain a certain level of simplicity and
consistency throughout. It is based entirely on free and open HDF5 technology.
Given that this specification is public, the
file format could, with further investment and involvement, become a useful
exchange format for the broader geoscientific community.
Content readable and writeable by third party software.
We recommend using HDFView, along with Geoscience ANALYST, when
learning the format.
Easily extensible to new data types.
It is intended for Geoscience ANALYST to preserve data it does not
understand (and generally be very tolerant with regards to missing
information) when loading and saving geoh5 files. This will allow third
parties to write to this format fairly easily, as well as include
additional information not included in this spec for their own purposes. In the current implementation,
Geoscience ANALYST automatically removes unnecessary information on save.
While all groups, objects and data entities are written into their respective base
folder, they also hold links to their children entities to allow for
traversals. There is no data duplication, merely multiple references (pointers) to
the data storage on file. Types are shared (and thus generally written to file first). All
groups, objects and data must include a hard link to their type.
Groups are simple container for other groups and objects. They are often used to assign
special meanings to a collection of entities or to create specialized software
functionality.
See the Group Types section for the list of supported group types.
Note
Though this file format technically allows objects/groups to appear
within multiple groups simultaneously (overlapping lists), this is not
currently supported by Geoscience ANALYST.
Objects are containers for Data with spatial information.
Most (not all) object geometry is described in terms of vertices (3D
locations) and cells (groupings of vertices such as triangles or
segments). The exact requirements and interpretation depends on the
type. Additional information may also be stored for some specific types.
See the Object Types section for the list of supported objects.
Containers for data values of various types.
Data are currently always stored as a 1D array, even in the case of
single-value data with the Object association (in which case it is a
1D array of length 1).
See the Data Types section for the list of supported data types.
While they are structured similarly, each group, object or set of data
has a type that defines how its HDF5 datasets should be interpreted.
This type is shared among any number of entities (groups/objects/data sets).
The Root group defines the tree structure used in Geoscience ANALYST
describing the parent-child relationships of entities. If absent, any Groups/Objects/Data
will be brought into Geoscience ANALYST under the workspace group, still respecting any defined hierarchy links.
Each cell represents a point of a 3D rectilinear grid. For a 3D cell
index (i,j,k) along axes U,V and Z of length nU, nV and nZ respectively,
cellindex=k+i*nZ+j*nU*nZ
Without rotation angles, U points eastwards, V points northwards, and Z points upwards.
Since their geometry is defined entirely by the additional data described below, block models do not require a Vertices or Cells dataset.
Each cell represents a point in a regular 2D grid. For a 2D cell
index (i,j) within axes U and V containing nU and nV cells respectively,
cellindex=i+j*nU
Without rotation angles, U points eastwards and V points northwards. Since their geometry is defined entirely by the additional data
described below, 2D grids do not require a Vertices or Cells dataset.
Vertices represent points along the drillhole path (support for data rather than the drillhole geometry itself) and must have a Depth property value.
Cells contain two vertices and represent intervals along the drillhole path (and are a support for interval data as well).
Cells may overlap with each other to accommodate the different sampling intervals of various data.
Vertices represent the four corners of the geolocated image. No cell data. An object-associated file-type data containing the image to display
is expected to exist under this object.
Note
Should be arranged as a rectangle currently, since Geoscience ANALYST
does not currently support skewed images.
New data types can be created at will by software or users to describe
object or group properties. Data of the same type can exist on any
number of objects or groups of any type, and each instance can be
associated with vertices, cells or the object/group itself. Some data
type identifiers can also be reserved as a means of identifying a
specific kind of data.
str
Name of the object displayed in the project tree.
ID
str
Unique identifier (UUID) of the data type.
Unlike Groups and Objects, Data entities do not generally have fixed identifier Type.
Multiple data entities linked by a type will share common properties (color map, units, etc.).
Exceptions to this rule are the fixed:
Stored as a 1D array of variable-length strings formatted according
to the ISO 8601 extended
specification for representations of UTC dates and times (Qt
implementation), taking the form YYYY-MM-DDTHH:mm:ss[Z|[+|-]HH:mm]
Stored as a 1D array of UTF-8 encoded, variable-length string type
designating a file name
For each file name within “Data”, an opaque dataset named after the
filename must be added under the Data instance, containing a complete
binary dump of the file
Different files (under the same object/group) must be saved under
different names
Stored as a 1D array of 8-bit char type (native) (value ‘0’ or ‘1’)
For each index set to 1, an opaque dataset named after the index
(e.g. “1”, “2”, etc) must be added under the Data instance,
containing the binary data tied to that index
The ui.json format provides a User Interface (UI) between geoh5py and Geoscience ANALYST Pro. The file structure is built on an array of JSON objects, each representing a parameter that is used in a python script. An object contains members that control the style and behaviour of the UI. In general only a label and value member is required in each object, however as outlined below, there are many types of input and dependencies that can be drawn on throughout the file. On output from Geoscience ANALYST, the value and whether the parameter is enabled will be updated or added to each JSON. Extra objects in the JSON are allowed and are ignored, but written out by Geoscience ANALYST. In general, objects will be put in order that they are set in the JSON. The exception is data parameters that depend on object parameters. Placing those parameters in the same group will ensure that they are close in the UI.
Within the ui.json file, each JSON object with value and label members will be considered a parameter to the UI. The following JSON objects could also be present:
run_command str
Name of python script excluding the .py extension (i.e., “run_me” for run_me.py) required for Geoscience ANALYST Pro to run on save or auto-load.
conda_environment str
Optional name of conda environment to activate when running the python script in run_command
Each JSON object with the following members become a parameter in the user interface. Each object must have the members label and value. Each member will contribute to the appearence and behaviour within Geoscience ANALYST>. The possible members that can be given to all parameter objects are:
label str
Required string describing parameter. A colon will automatically be added within Geoscience ANALYST, so this should be omitted.
value str, int, bool , or float
This require member takes a different form, including empty, depending on the parameter type. The value is updated when written from Geoscience ANALYST.
main bool
If set to true, the parameter is shown in the first tab and will throw an error if not given and not optional. Optional parameters may be set to main. When main is not given or is false, the parameter will be under the Optional Parameters tab.
tooltip str
String describing the parameter in detail that appears when the mouse hovers over it.
optional bool
true or false on whether the parameter is optional. On output, check if enabled is set to true.
enabled bool
true or false if the parameter is enabled. The default is true. If a parameter is optional and not enabled, it will start as disabled (grey and inactive in the UI).
group str
Name of the group to which the parameter belongs. Adds a box and name around the parameters with the same case-sensitive group name.
groupOptional bool
If true, adds a checkbox in the top of the group box next to the name. The group parameters will be disabled if not checked. The initial statedpends on the groupDependency and groupDependencyType members and the enabled member of the group’s parameters.
dependency str
The name of the object of which this object is dependent upon. The dependency parameter should be optional or boolean parameter (i.e., has a checkbox).
dependencyType str
What happens when the dependency member is checked. Options are enabled or disabled
groupDependency str
The name of the object of which the group of the parameter is dependent upon. This member will also require the groupOptional member to be present and set to true. Be sure that the object is not within the group.
groupDependencyType str
What happens when the group’s dependency parameter is checked. Options are enabled or disabled.
There are other JSON members that may be available or required based on the parameter type. The following sections define different parameter types that can be found in the ui.json format.
A file parameter comes with an icon to choose the file, with a str value. Extra members of the file object parameter are fileDescription and fileType. Both of these are str types and can be arrays, but must be of the same length
{"model_file":{"fileDescription":["Chargeability","Conductivity"],"fileType":["chg","con"],"main":true,"label":"DC/IP model file","value":""}}
To choose an object from a dropdown menu, the universally unique identifier (UUID) of the Object Type: is required for the filtering of objects. This is given as a single or array of str in the member meshType. The icon to pick the object comes with this parameter. The value returned is the UUID of the Geoscience ANALYST object selected.
{"interesting_object":{"meshType":["{202C5DB1-A56D-4004-9CAD-BAAFD8899406}","{6A057FDC-B355-11E3-95BE-FD84A7FFCB88}"],"main":true,"label":"Select Points or Curve","value":""}}
Creating a parameter to choose a Geoscience ANALYST object’s data requires extra members:
dataType str
Describes the type of data to filter. One or more (as an array) of these key words: Integer, Float, Text, Referenced, Vector, DataTime, Geometric, Boolean, or Text.
association str
Describes the geometry of the data. One or more of these key words: Vertex, Cell, or Face.
parent str
Either a UUID of the parent or the name of the Object parameter JSON object to allow the user to choose the mesh.
isValue bool
Describes whether to read the value (float) or property (str) member. If not given, the value member is an UUID and is considered a drop-down data parameter. If this member is given along with property, then an icon is added to the UI element, which switches between te value (line edit) and property (drop-down) choices. This value is updated on export depending on the style choice (float or str)
property str.
Data UUID that is selected when isValue is present. Geoscience ANALYST Pro will update this value on export.
min float
Optional minimum value allowed for validator of the value member. The default is the minimum numeric limits of float.
max float
Optional maximum value allowed for validator of the value member. The default is the maximum numeric limits of float.
In this example, the object parameter data_mesh is also given for reference.
{"data_channel":{"main":true,"association":"Vertex","dataType":"Float","label":"Data channel","parent":"data_mesh","value":""},"data_mesh":{"main":true,"meshType":["{202C5DB1-A56D-4004-9CAD-BAAFD8899406}","{6A057FDC-B355-11E3-95BE-FD84A7FFCB88}"],"main":true,"label":"Select Points or Curve","value":""}}
In some cases, a parameter may take its data from a Geoscience ANALYST object or simply a float value. The use of the member isValue and property together allows for the UI to switch between these two cases. In the top image, the isValue is true, so the value member of 1.0 will initially be active. When the icon is clicked, the type of input is switched to the property member (bottom image). The uncertainty channel object also depends on the data_mesh object. The drop-down selection will filter data from the chosen object that is located on the vertices and is float. The isValue is set to false upon export in this case.
{"uncertainty_channel":{"main":true,"association":"Vertex","dataType":"Float","isValue":true,"property":"","min":0.001,"label":"Uncertainty","parent":"data_mesh","value":1.0},"data_mesh":{"main":true,"meshType":["{202C5DB1-A56D-4004-9CAD-BAAFD8899406}","{6A057FDC-B355-11E3-95BE-FD84A7FFCB88}"],"main":true,"label":"Select Points or Curve","value":""}}
Use the dependency and dependencyType members to create dependencies. The parameter driving the dependency should set optional to true or be a Boolean parameter’. Below are a couple of examples. The first initializes the favourite_package parameter as disabled until the python_interest parameter is checked. The second shows the opposite when the enabled member is set to true.
{"python_interest":{"main":true,"label":"Do you like Python?","value":false,"tooltip":"Check if you like Python"},"favourite_package":{"main":true,"label":"Favourite Python package","value":"geoh5py","dependency":"python_interest","dependencyType":"enabled"}}
The next example has a dependency on an optional parameter. The enabled member is set to false so that it is not automatically checked. The city and territory parameters will be enabled when the territory checkbox is checked.
{"territory":{"choiceList":["Northwest Territories","Yukon","Nunavut"],"main":true,"label":"Favourite Canadian territory","value":"Yukon","optional":true,"enabled":false},"city":{"main":true,"choiceList":["Yellowknife","Whitehorse","Iqaluit"],"label":"Favourite capital","value":"","dependency":"territory","dependencyType":"enabled"}}
When a ui.json is saved with Geoscience ANALYST Pro, the following object members are updated or added:
The value member with the appropriate type
The enabled member bool for whether the parameter is enabled
The Data parameter will also have updated isValue and property members. The isValuebool member is true if the value member was selected and false if the property member was selected.
The following JSON objects will be written (and overwritten if given) upon export from Geoscience ANALYST Pro:
monitoring_directory str the absolute path of a monitoring directory. Workspace files written to this folder will be automatically processed by Geoscience ANALYST.
workspace_geoh5 str the absolute path to the current workspace (if previously saved) being used
geoh5 str the absolute path to the geoh5 written containing all the objects of the workspace within the parameters of the ui.json. One only needs to use this workspace along with the JSON file to access the objects with geoh5py.
Keep labels short and concise. Be consistent with capitalization and do not include the colons. Geoscience ANALYST will add colons and align them.
Write detailed tooltips.
Group related objects, but do not use a group if there are fewer than 3 objects.
The main member is for general, required parameters. Do not include this member with every object, unless there are only a handful of objects. Objects that are in the required parameters without a valid value will invoke an error when exporting or running from Geoscience ANALYST. “Non-main” members are designated to a second page under Optional parameters.
Utilize optional object members and dependencies. If a single workspace object input is optional, use the Object parameter rather than two parameters with a dependency.