Geometry¶
When working with MICRESS binary files, it is essential to understand the data structure. Binary files contain a time series representing the evolution of a 3D field over time. Although each time step corresponds to a 3D array, the data is stored in a flat format. This means that the 3D array's dimensions are not embedded in the binary file itself. Instead, they are stored separately in a geometry file with the extension .geoF
. This geometry file also includes information about grid spacing and other metadata.
When reading a binary file, MicPy will automatically try to retrieve the geometry information from the corresponding .geoF
file. If the geometry file is in the expected location, MicPy will read it without issue. However, if the geometry file cannot be found, MicPy will issue a warning. In this situation, you have several options: you can manually provide the geometry information, specify the path to the .geoF
file, or ignore the warning and let MicPy read the binary file without the geometry data. If you choose the latter, the data will be returned as a time series of 1D arrays.
Providing the Geometry Information Manually¶
from micpy import bin
file = bin.File("A001_Delta_Gamma.conc1")
shape = (1500, 1, 500) # 3-tuple (z, y, x) of integers
spacing = (1.0, 1.0, 1.0) # 3-tuple (dz, dy, dx) of floats
file.set_geometry(shape, spacing)