pwspy.analysis.pws.PWSAnalysisSettings

class pwspy.analysis.pws.PWSAnalysisSettings(filterOrder, filterCutoff, polynomialOrder, extraReflectanceId, referenceMaterial, wavelengthStart, wavelengthStop, skipAdvanced, autoCorrStopIndex, autoCorrMinSub, numericalAperture, relativeUnits, cameraCorrection)[source]

Bases: pwspy.analysis._abstract.AbstractAnalysisSettings

These settings determine the behavior of the PWSAnalysis class.

filterOrder

The order of the buttersworth filter used for lowpass filtering.

Type

int

filterCutoff

The cutoff frequency of the buttersworth filter used for lowpass filtering. Frequency unit is 1/wavelength . Set to None to skip lowpass filtering.

Type

float

polynomialOrder

The order of the polynomial which will be fit to the reflectance and then subtracted before calculating the analysis results.

Type

int

extraReflectanceId

The idtag of the extra reflection used for correction. Set to None if extra reflectance calibration is being skipped.

Type

str

referenceMaterial

The material that was being imaged in the reference acquisition

Type

Material

wavelengthStart

The acquisition spectra will be truncated at this wavelength before analysis.

Type

int

wavelengthStop

The acquisition spectra will be truncated after this wavelength before analysis.

Type

int

skipAdvanced

If True then skip analysis of the OPD and autocorrelation.

Type

bool

autoCorrStopIndex

The autocorrelation slope will be calculated up to this number of elements. More elements is theoretically better but it severely limited by SNR.

Type

int

autoCorrMinSub

If True then subtract the minimum of the ACF from ACF. This prevents numerical issues but doesn’t actually make any sense.

Type

bool

numericalAperture

The numerical aperture that the acquisition was imaged at.

Type

float

relativeUnits

relativeUnits: If True then all calculation are performed such that the reflectance is 1 if it matches the reference. If False then we use the theoretical reflectance of the reference (based on NA and reference material) to normalize our results to the actual physical reflectance of the sample (about 0.4% for water)

Type

bool

cameraCorrection

An object describing the dark counts and non-linearity of the camera used. If the data supplied to the PWSAnalysis class has already been corrected then this setting will not be used. Setting this to None will result in the camera correcting being automatically determined based on the image files’ metadata.

Type

Optional[pwspy.dataTypes._other.CameraCorrection]

asDict()[source]

Returns: A dictionary with setting names as the keys and the values of the settings as the values.

Return type

dict

classmethod fromJson(filePath, name)

Create a new instance of this class from a json text file.

Parameters
  • filePath (str) – The path to the folder containing the JSON file to be loaded.

  • name (str) – The name that the analysis was saved as.

Return type

AbstractAnalysisSettings

Returns

A new instance of an analysis settings class.

classmethod fromJsonString(string)

Use _fromDict to load a new instance of the cls from a json string.

Parameters

string (str) – A JSON formatted string to load the object from.

Return type

AbstractAnalysisSettings

Returns

A new instance of analysis settings class.

toJson(filePath, name)

Save this object to a json text file.

Parameters
  • filePath (str) – The path to the folder to contain the new JSON file.

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

toJsonString()

Use _asDict to convert an instance of this class to a json string.

Return type

str

Returns

A JSON formatted string.