|
Navigation: GeoDict 2026 - User Guide > Automation > GeoPy Scripting > Advanced Scripting > Access to 3D Result Files |
Scroll |
Access GUF Files
The GeoPy library provides read-only access for GUF files, using the keys and values from the header. To use this library in the top of the Python file import the library with the following command:
from guf import GUF |
|
Then, access the desired file and store it in a variable, e.g., guf_file. Therefore, insert the file path of the desired file in the parenthesis of the function GUF as follows:
guf_file = GUF("example.vap") |
|
There are four functions for GUF files described in the following, accessing header, images, arrays and maps.
This function returns the complete header as a stringmap. The values contained in this stringmap can be accessed by adding the corresponding keys in square brackets. Input: None Example:
|
This function returns the specified image as numpy array. Enter the image name inside the parenthesis as a string. Find the image names in the header. To access a volume field from the image, enter the corresponding field name in square brackets. Basically, this function does the same as the gd.getVolumeField() function described in the general API functions, but here no volume field needs to be loaded in GeoDict. Input:
Note: The getImage function is not recommended for compressed images, as currently the function cannot decompress the image and returns only an 1-dimensional array. Thus, the fields cannot be accessed. For compressed images, the key Image#:Compression can be found in the header. Thus, for these images it is recommended to use the gd.getStructure or the gd.getVolumeField functions. Example:
|
This function returns the specified array as a numpy array. Enter the array name inside the braces as a string. Find the array names in the header. For a single column add the corresponding column name in square brackets. ![]() This function only works, if the GUF file contains arrays (e.g. FilterDict *.gpp files). There are many very helpful FilterDict Particle specific Functions, but for the getArray function the trajectories do not need to be loaded in GeoDict. Input:
Example:
|
This function returns the specified map as a stringmap, consisting of key – value pairs. Enter the stringmap name inside the braces as a string. Find the map names in the header. This function only works for *.gdt files. ![]() There are many very helpful API functions applicable for structure files (e.g. gd.getGADObject), but for the getMap function the structure does not need to be loaded in GeoDict. To access only the desired information of the stringmap add the corresponding keys in square brackets. The needed keys can be found out by printing the desired map in the GeoDict console. Input:
Example: In the example below, the GAD statistics map is printed to the console and the number of objects in the 14th Z-slice is returned in a message dialog.
|
©2025 created by Math2Market GmbH / Imprint / Privacy Policy
