mcsas.utils.hdf module

Helper functions for HDF5 functionality

HDFCleanup(infile)[source]

Unused space is reclaimed by making a copy of the contents in the current hdf 5 file object, and moves the copy in place of the original. if the input argument supplied is a file name instead of an HDF5 object, the method returns nothing. Else, the method returns the new HDF5 object

class HDFMixin[source]

Bases: object

classmethod hdfLoad()[source]

Restores an instance of this type from a given HDF file location or group.

hdfStore(filename, rootLocation=None)[source]

Writes itself to an HDF file at the given position or group.

hdfWrite(hdf)[source]

To be overridden by sub classes to store themselves in an HDF structure. hdf: a HDFWriter instance.

class HDFWriter(hdfHandle, rootLocation=None)[source]

Bases: object

Represents an open HDF file location in memory and keeps track of the current address/name for reading or writing. Once this object looses scope, its data is actually written to file.

location
log(msg)[source]

Warning

method ‘utils.hdf.HDFWriter.log’ undocumented

classmethod open(filename, rootLocation=None)[source]

Warning

method ‘utils.hdf.HDFWriter.open’ undocumented

writeAttribute(key, value)[source]

Warning

method ‘utils.hdf.HDFWriter.writeAttribute’ undocumented

writeAttributes(**kwargs)[source]

Warning

method ‘utils.hdf.HDFWriter.writeAttributes’ undocumented

writeDataset(name, data)[source]

Warning

method ‘utils.hdf.HDFWriter.writeDataset’ undocumented

writeMember(obj, memberName)[source]

Warning

method ‘utils.hdf.HDFWriter.writeMember’ undocumented

writeMembers(obj, *members)[source]

Warning

method ‘utils.hdf.HDFWriter.writeMembers’ undocumented

getCallerInfo(referenceType=None, stackOffset=0)[source]

referenceType: Stop the search for a frame when this type for a local ‘self’ is found. stackOffset: grab that frame counted from the last instead of search