class pwspy.analysis.pws.PWSAnalysisResults(file=None, variablesDict=None, analysisName=None)[source]

Bases: pwspy.analysis._abstract.AbstractHDFAnalysisResults

A loader for analysis results that will only load them from hard disk as needed.

static FieldDecorator(func)

Decorate functions in subclasses that access their fields from the HDF file with this decorator. It will: 1: Make it so the data is load from disk on the first access and stored in memory for every further access. 2: Report an understandable error if the field isn’t found in the HDF file. 3: Make the accessors work even if the the object isn’t associated with an HDF file.

classmethod create(settings, reflectance, meanReflectance, rms, polynomialRms, autoCorrelationSlope, rSquared, ld, imCubeIdTag, referenceIdTag, extraReflectionTag)[source]

Used to create results from existing variables. These results can then be saved to file.


A new instance of analysis results.

static fields()[source]

Returns: A sequence of string names of the datafields that the analysis results contains.

static fileName2Name(fileName)[source]

fileName (str) – The filename that the HDF file was saved as.

Return type



The analysis name.

classmethod load(directory, name)

Load an analyis results object from an HDF5 file located in directory.

  • directory (str) – The path to the folder containing the file.

  • name (str) – The name of the analysis.

Return type



A new instance of analysis results loaded from file.

static name2FileName(name)[source]

name (str) – An analysis name.

Return type



The corresponding file name for the hdf5 file.


The cached properties continue to stay in RAM until they are deleted, this method deletes all cached data to release the memory.

toHDF(directory, name, overwrite=False, compression=None)

Save the AnalysisResults object to an HDF file in directory. The name of the file will be determined by name. If you want to know what the full file name will be you can use this class’s name2FileName method.

  • directory (str) – The path to the folder to save the file in.

  • name (str) – The name of the analysis. This determines the file name.

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

  • compression (Optional[str]) – The value of this argument will be passed to h5py.create_dataset for numpy arrays. See h5py documentation for available options.


The version of PWSpy code that this file was saved with.