Converting binaries

Some MicroHH output – like restart files, 3D field dumps, and cross-sections – are written in binary format. For the conversion to NetCDF, several Python scripts are available in the python directory.

Cross-sections

For the conversion of cross-sections, copy both the microhh_tools.py and cross_to_nc.py scripts to your working directory. If cross_to_nc.py is executed without any arguments, the script will automatically try to deduce the correct settings from the case.ini file, and convert all cross-sections. More fine grained control is possible by specifying arguments to the cross_to_nc.py script, for example:

python cross_to_nc.py -m xy -v thl -t0 3600 -t1 7200 -tstep 300 -p single -c

will convert only the horizontal (-m xy) cross-sections of potential temperature (-v thl) of the second hour of the experiment (-t0 3600 -t1 7200) at a 300s frequency (-tstep 300), saving the resulting NetCDF file using single precision (4 byte) floats (-p single), without NetCDF compression (-c).

For an overview of all options, see the help function:

python cross_to_nc.py -h

Restart files and field dumps

The conversion of restart files and field dumps works the same as the conversion of cross-sections, only using the 3d_to_nc.py script. Many of the possible command line arguments are the same as in the cross_to_nc.py script. For an overview, see the help function:

python 3d_to_nc.py -h