class pwspy.analysis.pws.PWSAnalysis(settings, extraReflectance, ref)[source]

Bases: pwspy.analysis._abstract.AbstractAnalysis

The standard PWS analysis routine. Initialize and then run for as many different ImCubes as you want. For a given set of settings and reference you only need to instantiate one instance of this class. You can then perform run on as many data cubes as you want.

  • settings (PWSAnalysisSettings) – The settings used for the analysis

  • extraReflectance (Union[ERMetaData, ExtraReflectanceCube, ExtraReflectionCube, None]) – An object used to correct for stray reflectance present in the imaging system. This can be of type: None: No correction will be performed. ERMetaData (Recommended): The metadata object referring to a calibration file for extra reflectance. It will be processed in conjunction with the reference immage to produce an ExtraReflectionCube representing the stray reflectance in units of camera counts/ms. ExtraReflectanceCube: Effectively identical to supplying an ERMataData object. ExtraReflectionCube: An object representing the stray reflection in units of counts/ms. It is up to the user to make sure that the data is scaled appropriately to match the data being analyzed.

  • ref (ImCube) – The reference acquisition used for analysis.


When running the run method in parallel memory for the object used must be copied to each new process. We can avoid that and save a lot of Ram by moving data that is shared between processes to shared memory. If you don’t want to implement this then just override it and raise NotImplementedError


Given an data cube to analyze this function returns an instanse of AnalysisResults. In the PWSAnalysisApp this function is run in parallel by the AnalysisManager.


cube (ImCube) – A data cube to be analyzed using the settings provided in the constructor of this class.

Return type

Tuple[PWSAnalysisResults, List[AnalysisWarning]]


A new instance of analysis results.