get_wcs_model

:mod:`giant.utilities.wcs

giant.utilities.wcs.get_wcs_model(input, camera_model_guess, sample_step=100, rotation_world_to_camera=None)[source]

This function creates a giant .CameraModel that mimics the input WCS object.

We do this by doing a recalibration using the output of the WCS model to feed as an input into the calibration process. Essentially, we sample across the detector, use the WCS to convert each sample into a unit vector in the world frame, rotate the unit vectors in the world frame into the camera frame, and then do the calibration process using these vectors and the original pixels. The sampling is done in a grid between (0, 0) and (camera_model_guess.n_cols, camera_model_guess.n_rows) with a step size of sample_step.

The camera_model_guess should be a subclass instance of the .CameraModel class for the camera model you would like to use which is seeded with an initial guess (that at least can do a projection to a meaningful value, even if its wrong). Additionally, this instance should have the .CameraModel.estimation_parameters set correctly for what parameters you would like estimated. The same rules apply as for a normal calibration.

If you have already extracted the rotation between the world and camera frame from the wcs object you can provide it in the optional rotation_world_to_camera frame, otherwise it will be extracted from the WCS using the get_wcs_orientation function from this module assuming the boresight pixel is the center of the image

Parameters:
  • input (WCS) – The WCS to fit the model to

  • camera_model_guess (CameraModel) – the initial guess for the camera model/type of camera model to be extracted

  • sample_step (int) – the number of pixels between each sample

  • rotation_world_to_camera (Rotation | None)

Return type:

CameraModel