Calibration Information

CalibrationInfo

class LuxFlux.fluxEngineNET.CalibrationInfo : IDisposable

Calibration Information

This class 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 (US customary, 5280 feet): "Miles", "mi"

  • Yards (US customary, 3 feet): "Yards", "yd"

  • Feet (US customary, 12 iches): "Feet", "ft"

  • Inches (US customary, 2.54 cm): "Inches", "in"

  • Thou (US customary, 1/1000 inch): "Thou", "th"

  • Degrees (Angle): "deg"

  • Radians (Angle): "rad"

Please note that units are case sensitive, because SI prefixes are case sensitive!

Reminder: all strings in fluxEngine are encoded as UTF-8.

Public Functions

CalibrationInfo ()

Constructor

This will allocate an empty structure that may be filled with the accessor methods.

CalibrationInfo Clone ()

Create a copy of this structure.

void SetSetting (CalibrationSettingType type, double value, string unit)

Set a simple calibration setting.

Param type:

The setting type

Param value:

The value of the setting

Param unit:

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.

void ClearSetting (CalibrationSettingType type)

Clear a simple calibration setting

This will remove the setting from the calibration information structure, if present. If the setting was not present, this method will have no effect.

Param type:

The setting type

bool IsSettingPresent (CalibrationSettingType type)

Check whether a simple calibration setting is present.

Param type:

The setting type

Return:

Whether that setting is present in the calibration information structure

string GetSetingUnit (CalibrationSettingType type)

Get the unit of the stored calibration setting.

Param type:

The setting type

Return:

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’. Since all strings in fluxEngine are considered to be UTF-8 that example will be 3 bytes long, as U+00B5 will be encoded as 0xC2 0xB5 in UTF-8.

double GetSettingValue (CalibrationSettingType type, string unit)

Get the value of the stored calibration setting

The value will be converted to the specified unit automatically.

Param type:

The setting type

Param unit:

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.

Return:

The value of the setting, converted to the specified unit.

void SetWhiteReferenceReflectivity (WhiteReferenceReflectivity reflectivity)

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.

Param reflectivity:

The new white reference reflectivity curve

void 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.

bool IsWhiteReferenceReflectivitySet ()

Determine whether a white reference reflectivity curve was stored in the calibration information.

Return:

Whether a white reference reflectivity curve was stored

WhiteReferenceReflectivity 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 thrown.

ComparisonResult IsSimilarTo (CalibrationInfo other, double relativePrecision)

Compare two CalibrationInfo structures

This may be used to determine if both structures describe the same data. Since calibration information is provided in the form of floating point data, this comparison routine will also provide feedback in case both structures are not exactly (bitwise) identical, but are close enough in relative precision that they should be considerd equivalent. (The threshold for this may be specified by the user.)

Param other:

The structure to compare this structure to

Param relativePrecision:

The relative precision to which to compare various values to. Specify 0 here to always force absolute comparisons. A good default is 1e-7.

Return:

The comparison result of both structures

void Dispose ()

Dispose of this object

This will free all resources associated with this object. The object should not be used anymore after a call to this method.

ComparisonResult

enum LuxFlux.fluxEngineNET.ComparisonResult

Comparison result of two numeric structures

This result is returned by functions that compare structures (such as CalibrationInfo) that contain floating point values. Since a direct comparison of two floating point values will likely not yield exactly the same values, this enumeration exists to indicate the state when values are so similar that they are considered equivalent.

Values:

Identical

The structures are identical.

Equivalent

The structures are equivalent.

Different

The structures are different.

CalibrationSettingType

enum LuxFlux.fluxEngineNET.CalibrationSettingType

Simple calibration setting type

This enumeration lists the simple settings (that consist of a value and a unit) that describe a given measurement setup.

Values:

PixelSizeX

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.

InstrumentBaseDistance

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.

InstrumentAngleX

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.

WhiteReferenceReflectivity

class LuxFlux.fluxEngineNET.WhiteReferenceReflectivity

White Reference Reflectivity

This structure represents the actual reflectivity values of the white reference. Since no white reference is 100% reflective at all wavelengths, this curve may be used to obtain more accurate reflectance values in a given reflectance setup.

Public Members

double[] Wavelengths

The wavelengths of the reflectance curve.

double[] Reflectivity

The reflectivity values of the white reference at their corresponding wavelengths

This must have the same size as the Wavelengths array, otherwise this is invalid.

The reflectivity values are assumed to be in a range from 0 to 1, 0 meaning no reflectivity, 1 meaning full reflectivity. (It is possible to specify values beyond those limits, but the math will to make sense in that case.)

string WavelengthUnit

The unit of the wavelengths

See the class documentation for the CalibrationInfo class on how to specify units. Typically this will be "nm" to indicate nanometers.