Every OpenHSI camera is unique and requires calibration before use. This module provides the abstractions to create the calibration data which are then used in operation.
Calibration Routines
Tip
This module can be imported using from openhsi.calibrate import *
*type(object) -> the object’s type type(name, bases, dict, **kwds) -> a new type*
Using the SettingsBuilderMixin
There are a few ways to create a SettingsBuilder class that words for your custom camera. (They involve Python metaclasses and mixins)
For example, you can then create a SettingsBuilder class that works for your custom camera by doing one of the following.
Note
Below we use the ‘SimulatedCamera’ class. When calibrating a real camera you would replace SimulatedCamera with your camera class.
# using helper functionSettingsBuilder = create_settings_builder("SettingsBuilder",SimulatedCamera)# using MetaclassesSettingsBuilder = SettingsBuilderMetaclass("SettingsBuilder",SimulatedCamera,{})# initialisingsb = SettingsBuilder(json_path="../assets/cam_settings.json", cal_path="../assets/cam_calibration.nc")
Allocated 17.48 MB of RAM. There was 1463.06 MB available.
# pure mixinclass CalibrateOpenHSI(SettingsBuilderMixin, SimulatedCamera):passsb = CalibrateOpenHSI(mode="flat",json_path="../assets/cam_settings.json", cal_path="../assets/cam_calibration.nc")
Allocated 17.48 MB of RAM. There was 1450.69 MB available.
Find illuminated sensor area
We assume the x axis (or detector columns) are used for the spectral channels, the rows correspond to the cross-track dimension and are limited by the optics (slit). The useable area is cropped out (windowing can also be used to reduce data intake).