CEOS Panta Rhei (PRZ)#

RosettaSciIO can read and write .prz files used by the CEOS Panta Rhei software. The .prz files are based on open formats (numpy arrays and python dictionaries) so a complete support is in principle possible. However, as new features are continuously being added to Panta Rhei, it is also possible to occasionally encounter some which are not yet supported by RosettaSciIO. Please report any problematic file on the issues tracker to make us aware of it.

API functions#

rsciio.pantarhei.file_reader(filename: str | Path, lazy: bool = False, allow_restricted_pickle: bool = False)#

Read a PantaRhei .prz file. For Panta Rhei <24.03 a restricted unpickler can be used to load the meta data with allow_restricted_pickle=True, which raises InvalidPickleError if restricted modules are detected.

Parameters:
filenamestr, pathlib.Path

Filename of the file to read or corresponding pathlib.Path.

lazybool, default=False

Lazy loading is not supported.

allow_restricted_picklebool, default=False

Allows unpickling of prz meta data for data saved with Panta Rhei <24.03. This poses a security risk, use only for completely trusted prz files.

Returns:
list of dict

List of dictionaries containing the following fields:

  • ‘data’ – multidimensional numpy.ndarray or dask.array.Array

  • ‘axes’ – list of dictionaries describing the axes containing the fields ‘name’, ‘units’, ‘index_in_array’, and either ‘size’, ‘offset’, and ‘scale’ or a numpy array ‘axis’ containing the full axes vector

  • ‘metadata’ – dictionary containing the parsed metadata

  • ‘original_metadata’ – dictionary containing the full metadata tree from the input file

When the file contains several datasets, each dataset will be loaded as separate dictionary.

rsciio.pantarhei.file_writer(filename, signal)#

Write signal to PantaRhei .prz format.

Parameters:
filenamestr, pathlib.Path

Filename of the file to write to or corresponding pathlib.Path.

signaldict

Dictionary containing the signal object. Should contain the following fields:

  • ‘data’ – multidimensional numpy array

  • ‘axes’ – list of dictionaries describing the axes containing the fields ‘name’, ‘units’, ‘index_in_array’, and either ‘size’, ‘offset’, and ‘scale’ or a numpy array ‘axis’ containing the full axes vector

  • ‘metadata’ – dictionary containing the metadata tree