Ripple format#
The .rpl format (short for “Raw Parameter List”) is an open standard format
developed at NIST as native format for Lispix and is widely used to
exchange multidimensional data. However, it only supports data of up to three
dimensions. See the file specifications
for a description of the file format and the parameter keys (some of which are
specific to HyperSpy). This format is often used in
EDS/EDX experiments.
The .rpl file lists the characteristics of the corresponding .raw file so
that it can be loaded without human intervention. Thus, the reader parses a
.rpl file and reads the data from the corresponding
.raw file, or directly from a .raw file if the dictionary rpl_info is
provided.
It can also be used to exchange data with Bruker and used in combination with the ImportRPL Digital Micrograph plugin it is very useful for exporting data to Gatan’s Digital Micrograph.
Note
This format may not provide information on the calibration. If so, you should add that after loading the file.
API functions#
- rsciio.ripple.file_reader(filename, lazy=False, rpl_info=None, encoding='latin-1', chunks='auto')#
Read a ripple/raw file. Parse a lispix (https://www.nist.gov/services-resources/software/lispix) ripple (.rpl) file and reads the data from the corresponding raw (.raw) file; or, read a raw file if the dictionary
rpl_infois provided.- Parameters:
- filename
str,pathlib.Path Filename of the file to read or corresponding pathlib.Path.
- lazybool, default=False
Whether to open the file lazily or not. The file will stay open until closed in
compute()or closed manually.get_file_handle()can be used to access the file handler and close it manually.- rpl_info
dict, Default=None A dictionary containing the keywords in order to read a
.rawfile without corresponding.rplfile. IfNone, the keywords are parsed automatically from the.rplfile.- encoding
str, default=”latin-1” The encoding used to read the content of the file. Different file encodings, such as
"utf8"can be set via this argument.- chunks
tupleofintorNone, default=None Define the chunking used for saving the dataset. If
None, calculates chunks for the signal, with preferably at least one chunk per signal space.
- filename
- Returns:
listofdictList of dictionaries containing the following fields:
‘data’ – multidimensional
numpy.ndarrayordask.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.ripple.file_writer(filename, signal, encoding='latin-1')#
Write a ripple/raw file. Write a Lispix (https://www.nist.gov/services-resources/software/lispix) ripple (.rpl) file and saves the data in a corresponding raw (.raw) file.
- Parameters:
- filename
str,pathlib.Path Filename of the file to write to or corresponding pathlib.Path.
- signal
dict 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
- encoding
str, default=”latin-1” The encoding used to write the content of the file. Different file encodings, such as
"utf8"can be set via this argument.
- filename