spym.io.omicronscala

Package Contents

Functions

load(parFile) This method load data and metadata associated to an Omicron SCALA .par file.
to_dataset(parFile, scaling=True) This method load an Omicron SCALA .par file into an xarray Dataset.
to_nexus(parFile, filename=None, **kwargs) This method convert an Omicron SCALA .par file into a NeXus file.
spym.io.omicronscala.load(parFile)

This method load data and metadata associated to an Omicron SCALA .par file.

Args:
parFile: the name of the .par file to be loaded
Returns:
a container for the channels in the .par file with their data and metadata
Examples:

f = omicronscala.load(‘/path/to/file.par’) # load the file

ch0 = f[0] # assign first channel ch0.label # returns channel name label ch0.data # returns channel data as a numpy array ch0.attrs # returns channel metadata as a dictionary

spym.io.omicronscala.to_dataset(parFile, scaling=True)

This method load an Omicron SCALA .par file into an xarray Dataset.

The xarray package is required.

Args:

parFile: the name of the .par file to be loaded scaling: if True convert data to physical units (default),

if False keep data in ADC units
Returns:
an xarray Dataset
Examples:

ds = omicronscala.to_dataset(‘/path/to/file.par’)

ds <xarray.Dataset>

ds.Z_Forward <xarray.DataArray>

spym.io.omicronscala.to_nexus(parFile, filename=None, **kwargs)

This method convert an Omicron SCALA .par file into a NeXus file.

The nxarray package is required.

Args:

parFile: the name of the .par file to be converted filename: (optional) path of the NeXus file to be saved.

If not provided, a NeXus file is saved in the same folder of the .par file.

**kwargs: any optional argument accepted by nexus NXdata.save() method

Returns:
nothing
Examples:
omicronscala.to_nexus(‘/path/to/file.par’)