Calibration Information
CalibrationSettingType
- class fluxEngine.CalibrationSettingType(value)
Simple calibration setting type
This enumeration lists the simple settings (that consist of a value and a unit) that describe a given measurement setup.
- InstrumentAngleX = 2
The angle of the instrument in the y-z plane
An angle of 0 indicates perpendicularity to the measurement sample, any deviation indicates that the instrument has been rotated relative to the sample along an axis aligned with the x direction.
- InstrumentBaseDistance = 1
The distance of the instrument to the sample
The quantity associated with this must have a length unit (e.g. 10 cm).
This quantity only makes sense if the target that is looked at is relatively flat.
- PixelSizeX = 0
The pixel size in x direction
How large is a pixel in x direction when looking at the measurement target. (This is not the size of the pixel in the sensor chip!) The quantity associated with this must have a length unit (e.g. 3 mm). This applies equally to line cameras and imager cameras; in the case of imager cameras this will also be used for the size in y direction.
Note that this may be quite large; when processing satellite images this may be of the order of kilometers.
This quantity only makes sense if the target that is looked at is relatively flat.
CalibrationInfo
- class fluxEngine.CalibrationInfo
Calibration Information
This structure contains calibration information that influences how data is processed. Some fluxEngine filters that process data may use information such as the angle of the instrument to perform more accurate calculations.
There are two types of information stored here: simple quantities that consist of a value and a unit, as well as more complex quantities. All simple quantities may be set by a common set of getter and setter methods, while the more complex pieces of information have specific methods of their own.
For the available simple quantities take a look at the CalibrationSettingType enumeration.
All fluxEngine filters will have a default behavior if a certain piece of information is not set. For example, the angle of the instrument is assumed to be perpendicular to the sample if nothing else has been set.
Units are treated as strings in this API to allow for future extensibility. The following units are currently supported:
Unitless:
""
(empty string)Kilometers:
"Kilometers"
,"km"
Meters:
"Meters"
,"m"
Centimeters:
"Centimeters"
,"cm"
Millimeters:
"Millimeters"
,"mm"
Micrometers:
"Micrometers"
,"µm"
(U+00B5),"μm"
(U+03BC)Nanometers:
"Nanometers"
,"nm"
Angstroms:
"Angstroms"
,"Angstrom"
,"Å"
(U+212B),"Å"
(U+00C5)Picometers:
"Picometers"
,"pm"
Miles (imperial, 5280 feet):
"Miles"
,"mi"
Yards (imperial, 3 feet):
"Yards"
,"yd"
Feet (imperial, 12 iches):
"Feet"
,"ft"
Inches (imperial, 2.54 cm):
"Inches"
,"in"
Thou (imperial, 1/1000 inch):
"Thou"
,"th"
Degrees (Angle):
"deg"
Radians (Angle):
"rad"
Please note that units are case sensitive, because SI prefixes are case sensitive!
- clearSetting(settingType)
Clear a simple calibration setting
If the setting in question wasn’t set, this method will have no effect.
- Parameters:
settingType (CalibrationSettingType) – The simple calibration setting type
- clearWhiteReferenceReflectivity()
Clear the white reference reflectivity curve
Removes any existing white reference reflectivity curve in the calibration information structure. If no such curve was present this method has no effect.
- getSetting(settingType)
Get the value and unit of the stored calibration setting
- Parameters:
settingType (CalibrationSettingType) – The simple calibration setting type
- Returns:
The value and unit of the setting.
- Return type:
(float, str)
- getSettingUnit(settingType)
Get the unit of the stored calibration setting
- Parameters:
settingType (CalibrationSettingType) – The simple calibration setting type
- Returns:
The unit of the calibration setting. The unit string will be one of the strings documented in the class documentation of CalibrationInfo. For units that have multiple representations the first abbreviated representation will be returned. For example, micrometers will return a string containing 2 characters, the first being the unicode symbol for micro, U+00B5, the second being ‘m’.
- Return type:
str
- getSettingValue(settingType, unit)
Get the value of the stored calibration setting
The value will be converted to the specified unit automatically.
- Parameters:
settingType (CalibrationSettingType) – The simple calibration setting type
unit (str) – The unit to convert the value into. This must be a compatible unit (e.g. a length unit for lengths). See the class documentation of CalibrationInfo for details on how to specify units.
- Returns:
The value of the setting, converted to the specified unit.
- Return type:
float
- getWhiteReferenceReflectivity()
Get the white reference reflectivity stored in the calibration inforamtion
This will retrieve the white reference reflectivity curve stored in the calibration information. If no such curve has been stored, an error will be raised.
- Returns:
A tuple containing (in order) the wavelengths of the curve, the reflectivities belonging to those wavleengths, and the unit of the wavelengths as a string. See the class documentation for CalibrationInfo for a list of units.
- Return type:
tuple(list(float), list(float), str)
- isSettingPresent(settingType)
Determine if a simple calibration setting has been set
- Parameters:
settingType (CalibrationSettingType) – The simple calibration setting type
- Returns:
Whether the setting was present
- Return type:
bool
- isWhiteReferenceReflectivityPresent()
Determine whether a white reference reflectivity curve was stored in the calibration information
- Returns:
Whether a white reference reflectivity curve was stored
- Return type:
bool
- setSetting(settingType, value, unit)
Set a simple calibration setting
- Parameters:
settingType (CalibrationSettingType) – The simple calibration setting type
value (float) – The value for the calibration setting
unit (str) – The unit of the setting. For a list of units, please see the class documentation of CalibrationInfo. This unit must be of the right type (length unit, angle unit, etc.) for the given setting.
- setWhiteReferenceReflectivity(wavelengths, reflectivities, wavelengthUnit)
Set the white reference reflectivity
This special setting may be used to supply a reflectance curve for the white reference that is used in the measurement setup. The white reference measurement will automatically be corrected by fluxEngine by this reflectance curve to more closely be able to calculate the true reflectance of the sample.
If a previous white reference reflectivity curve was present in the calibration information structure, it will be replaced.
The number of elements in the wavelengths an reflectivities vectors must be the same, otherwise an exception will be raised.
- Parameters:
wavelengths (numpy.array or list(float)) – A vector of wavelengths (x labels) of the curve
reflectivities (numpy.array or list(float)) – The reflectance values of the white reference, corresponding to the supplied wavelengths. The values must fall between 0.0 (no reflectivity) and 1.0 (full reflectivity). A good white reference typically has a relatively flat reflectivity that is larger than 0.9 for all relevant wavelengths.
wavelengthUnit (str) – The unit of the wavelengths, see the class documentation of CalibrationInfo for a list of possible units. Typically this will be
"nm"
to indicate that the curve has been specified in nanometers.