pwspy.dataTypes.DynMetaData

class pwspy.dataTypes.DynMetaData(metadata, filePath=None, fileFormat=None, acquisitionDirectory=None)[source]

Bases: pwspy.dataTypes._metadata.MetaDataBase, pwspy.dataTypes._metadata.AnalysisManager

A class that represents the metadata of a Dynamics acquisition.

class FileFormats(value)[source]

Bases: enum.Enum

An enumerator identifying the types of file formats that this class can be loaded from.

static decodeHdfMetadata(d)

Attempt to extract a dictionary of metadata from an HDF5 dataset.

Parameters

d (Dataset) – The h5py.Dataset to load from.

Return type

dict

Returns

A dictionary containing the metadata

encodeHdfMetadata(d)

Save this metadata object as a json string in an HDF5 dataset.

Parameters

d (Dataset) – The h5py.Dataset to save the metadata to.

Return type

Dataset

classmethod fromOldPWS(directory, lock=None, acquisitionDirectory=None)[source]

Loads old dynamics cubes which were saved the same as old pws cubes. a raw binary file with some metadata saved in random .mat files. Does not support automatic detection of binning, pixel size, camera dark counts, system name.

Parameters

directory (str) – The path to the folder containing the data files load the metadata from.

Return type

DynMetaData

Returns

A new instance of DynMetaData.

classmethod fromTiff(directory, lock=None, acquisitionDirectory=None)[source]
Parameters

directory – The path to the folder containing the data files load the metadata from.

Return type

DynMetaData

Returns

A new instance of DynMetaData loaded from file.

getAnalyses()
Return type

List[str]

Returns

A list of the names of analyses that were found.

classmethod getAnalysesAtPath(path)
Parameters

path (str) – The path to search for analysis files.

Return type

List[str]

Returns

A list of the names of analyses that were found.

static getAnalysisResultsClass()[source]
Return type

t_.Type[AbstractHDFAnalysisResults]

Returns

The class that is used to contain analysis results for this acquisition type.

getThumbnail()[source]

Return the image used for quick viewing of the acquisition. Has no numeric significance.

Return type

ndarray

loadAnalysis(name)
Parameters

name (str) – The name of the analysis to load.

Return type

AbstractHDFAnalysisResults

Returns

A new instance of an AnalysisResults object.

removeAnalysis(name)
Parameters

name (str) – The name of the analysis to be deleted

saveAnalysis(analysis, name, overwrite=False)
Parameters
  • analysis (AbstractHDFAnalysisResults) – An AnalysisResults object to be saved.

  • name (str) – The name to save the analysis as

  • overwrite (bool) – If True then any existing file of the same name will be replaced. If False an exception will be raised.

toDataClass(lock=None)[source]
Parameters

lock (mp.Lock) – A multiprocessing lock that can prevent help us synchronize demands on the hard drive when loading many files in parallel. Probably not needed.

Returns

The data object associated with this metadata object.

Return type

pwsdtmd.DynCube

property binning: int

The binning setting used by the camera. This is needed in order to properly correct dark counts. This is generally extracted from metadata saved by Micromanager

Return type

int

property exposure: float

The exposure time of the camera expressed in milliseconds.

Return type

float

property idTag: str

Returns: str: A unique string identifying this acquisition.

Return type

str

property pixelSizeUm: float

The pixelSize expressed in microns. This represents the length of each square pixel in object space. Binning has already been accounted for here. This is generally extracted from metadata saved my MicroManager

Return type

float

property systemName: str

The name of the system this was acquired on. The name is set in the PWS Acquisition Plugin for Micromanager.

Return type

str

property time: str

The date and time that the acquisition was taken.

Return type

str

property times: Tuple[float, ...]

A sequence indicatin the time associated with each 2D slice of the 3rd axis of the data array

Return type

Tuple[float, ...]

property wavelength: int

The wavelength that this acquisition was acquired at.

Return type

int