Calibration.estimate_temperature_dependent_alignment

giant.calibration.calibration_class:

Calibration.estimate_temperature_dependent_alignment()[source]

This method estimates a temperature dependent (not static) alignment between a base frame and the camera frame over multiple images.

This method uses the alignment_base_frame_func to retrieve the rotation from the inertial frame to the base frame the alignment is to be done with respect to for each image time. Then, the rotation from the inertial frame to the camera frame is retrieved for each image from the Image.rotation_inertial_to_camera attribute for each image (which is updated by a call to estimate_attitude()). These frame definitions are then provided to the temperature_dependent_alignment_estimator whose estimate() method is then called to estimate the temperature dependent alignment. The estimated alignment is then stored as a 3x2 numpy array where the first column is the static offset for the alignment, the second column is the temperature dependent slope, and each row represents the euler angle according to the requested order (so if the requested order is 'xyx' then the rotation from the base frame to the camera frame at temperature t can be computed using:

>>> from giant.rotations import euler_to_rotmat, Rotation
>>> from giant.calibration.calibration_class import Calibration
>>> cal = Calibration()
>>> cal.estimate_temperature_dependent_alignment()
>>> t = -22.5
>>> angles = cal.temperature_dependent_alignment@[1, t]
>>> order = cal.temperature_dependent_alignment_estimator.order
>>> rotation_base_to_camera = Rotation(euler_to_rotmat(angles, order))

This example is obviously incomplete but gives the concept of how things could be used.

Note that to do alignment, the base frame and the camera frame should generally be fixed with respect to one another (with the exception of small variations with temperature). This means that you can’t do alignment with respect to something like the inertial frame in general, unless your camera is magically fixed with respect to the inertial frame.

Generally, this method should be called after you have estimated the attitude for each image, because the estimated image pointing is used to estimate the alignment. As such, only images where there are successfully matched stars are used in the estimation.

Note

This method will attempt to account for misalignment estimated along with the camera model when performing the estimation; however, this is not recommended. Instead, once you have performed your camera model calibration, you should consider resetting the camera model misalignment to 0 and then calling estimate_attitude() before a call to this function.

Return type:

None