SciFiReaders.readers.SID.Nsid_reader.NSIDReader

class SciFiReaders.readers.SID.Nsid_reader.NSIDReader(file_path)[source]

Bases: sidpy.sid.reader.Reader

Creates an instance of NSIDReader which can read one or more HDF5 datasets formatted according to NSID into sidpy.Dataset objects

Parameters

file_path (str, h5py.File, or h5py.Group) – Path to a HDF5 file or a handle to an open HDF5 file or group object

Notes

Please consider using the self._h5_file object to get handles to specific datasets or sub-trees that need to be read instead of opening the file again outside the context of this Reader.

Methods

can_read

Checks whether or not this Reader can read the provided file

read

Reads all available NSID main datasets or the specified h5_object

read_all

Reads all HDF5 datasets formatted according to NSID specifications.

can_read()[source]

Checks whether or not this Reader can read the provided file

Returns

True if this Reader can read the provided file and if this file contains at least one NSID-formatted main dataset. Else, False

Return type

bool

read(h5_object=None)[source]

Reads all available NSID main datasets or the specified h5_object

Parameters

h5_object (h5py.Dataset or h5py.Group) – HDF5 Dataset to read or the HDF5 group under which to read all datasets

Returns

Datasets present in the provided file

Return type

sidpy.Dataset or list of sidpy.Dataset objects

read_all(recursive=True, parent=None)[source]

Reads all HDF5 datasets formatted according to NSID specifications.

Parameters
  • recursive (bool, default = True) – We might just remove this kwarg

  • parent (h5py.Group, Default = None) – HDF5 group under which to read all available datasets. By default, all datasets within the HDF5 file are read.

Returns

Datasets present in the provided file

Return type

sidpy.Dataset or list of sidpy.Dataset objects