plot_alignment_residuals

giant.calibration.visualizer:

giant.calibration.visualizer.plot_alignment_residuals(calib, pdf_name=None)[source]

This function plots the residual alignment errors per image as roll/pitch/yaw for both the estimated static and temperature alignments (if done).

The residual plots are generated by comparing the current values of Image.rotation_inertial_to_camera to calib...._alignment*calib.alignment_base_frame_func(image.observation_date) and converting the residual into roll, pitch, yaw Tait-Bryan angles (xyz) rotation. This function will generate 1 figure for each type of alignment that has been performed, plotting the residuals versus camera temperature. The residuals are computed as the rotation from the computed frame using the estimated alignment to the observed frame for each image.

Note

This function will take into account misalignment estimated in the camera model itself if it finds one, however, it is recommended that before calling this function you reset the misalignment to 0 in the camera model and then call estimate_attitude() again before using this function.

You should have called at least one of estimate_static_alignment() or estimate_temperature_dependent_alignment() before using this function. In addition, you should have called method estimate_attitude() for the results generated from this function to be meaningful. Finally, the alignment_base_frame_func must not be None.

If the pdf_name param is provided, the figures will be saved to a pdf file of the same name, and will not be displayed interactively.

Raises:

ValueError – If both static_alignment and temperature_dependent_alignment are None or if alignment_base_frame_func is None.

Parameters:
  • calib (Calibration) – The Calibration instance

  • pdf_name (Path | str | None) – Used as the file name for saving the figures to a pdf