pwspy.analysis.dynamics.DynamicsAnalysisSettings

class pwspy.analysis.dynamics.DynamicsAnalysisSettings(extraReflectanceId, referenceMaterial, numericalAperture, relativeUnits, cameraCorrection, diffusionRegressionLength=3)[source]

Bases: pwspy.analysis._abstract.AbstractAnalysisSettings

These settings determine the behavior of the DynamicsAnalysis class. :type extraReflectanceId: Optional[str] :param extraReflectanceId: The unique IDTag of the extraReflectance calibration that was used on this analysis. :type referenceMaterial: Material :param referenceMaterial: The material that was imaged in the reference image of this analysis. Found as an in pwspy.moduleConst.Material. The

theoretically predicted reflectance of the reference image is used in the extraReflectance correction.

Parameters
  • numericalAperture (float) – The illumination NA of the system. This is used for two purposes. First, we want to make sure that the NA of our data matches the NA of our extra reflectance correction cube. Second, the theoretically predicted reflectance of our reference is based not only on what our refereMaterial is but also the NA since reflectance is angle dependent.

  • relativeUnits (bool) – 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)

  • cameraCorrection (Optional[CameraCorrection]) – An object describing the dark counts and non-linearity of the camera used. If the data supplied to the DynamicsAnalysis 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.

  • diffusionRegressionLength (int) – The original matlab scripts for analysis of dynamics data determined the slope of the log(ACF) by looking only at the first two indices, (log(ACF)[1]-log(ACF)[0])/dt. This results in very noisy results. However as you at higher index value of the log(ACF) the noise becomes much worse. A middle ground is to perform linear regression on the first 4 indices to determine the slope. You can adjust that number here.

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.