SplitCamera

giant.camera_models.split_camera:

class giant.camera_models.split_camera.SplitCamera(model1, model2, camera_frame_split_axis=CameraFrameSplitAxis.X, camera_frame_split_threshold=0.0, image_plane_split_axis=ImagePlaneSplitAxis.X, image_plane_split_threshold=0.0, field_of_view=0.0, n_rows=1, n_cols=1, use_a_priori=False)[source]

Bases: CameraModel

A camera model that combines two different camera models for different regions of the detector.

This class allows for the creation of a hybrid camera model that uses two different camera models for different regions of the detector. The split is defined in both the camera frame (using camera_frame_split_axis and camera_frame_split_threshold) and in the image plane (using image_plane_split_axis and image_plane_split_threshold).

The SplitCamera inherits from the CameraModel base class and implements all required methods, delegating to either model1 or model2 based on the defined split.

Initialize a new SplitCamera instance.

Parameters:
  • model1 (CameraModel) – The first camera model to use

  • model2 (CameraModel) – The second camera model to use

  • camera_frame_split_axis (CameraFrameSplitAxis) – The axis in the camera frame to use for splitting

  • camera_frame_split_threshold (float) – The threshold value for splitting in the camera frame

  • image_plane_split_axis (ImagePlaneSplitAxis) – The axis in the image plane to use for splitting

  • image_plane_split_threshold (float) – The threshold value for splitting in the image plane

  • field_of_view (float | None) – The field of view of the camera in degrees

  • n_rows (int) – The number of rows in the image

  • n_cols (int) – The number of columns in the image

  • use_a_priori (bool) – Whether to use a priori information in calibration

property model1: CameraModel

Get the first camera model.

Returns:

The first camera model used in the split camera

property model2: CameraModel

Get the second camera model.

Returns:

The second camera model used in the split camera

property camera_frame_split_axis: CameraFrameSplitAxis

Get the axis used for splitting in the camera frame.

Returns:

The CameraFrameSplitAxis enum value representing the split axis in the camera frame

property image_plane_split_axis: ImagePlaneSplitAxis

Get the axis used for splitting in the image plane.

Returns:

The ImagePlaneSplitAxis enum value representing the split axis in the image plane

property estimation_parameters: list[str]

Get the list of parameters to be estimated during calibration.

This property combines the estimation parameters from both component camera models, prefixing them with ‘m1_’ and ‘m2_’ to distinguish between the two models.

Returns:

A list of strings representing the parameters to be estimated

property state_vector: list[float]

Get the current state vector of the camera model.

This property combines the state vectors from both component camera models.

Returns:

A list of float numbers representing the current state of the camera model

property field_of_view: float

A radial field of view of the camera specified in degrees.

The field of view should be set to at least the half width diagonal field of view of the camera. The field of view is used when querying star catalogs.

The diagonal field of view is defined as

+-----------+
|          /|
|         / |
|        /  |
|      V/   |
|     O/    |
|    F/     |
|   */      |
|  2/       |
|  /        |
| /         |
|/          |
+-----------+

If you specify this parameter to be None, the field of view will be computed using the camera model if possible.

n_rows

The number of rows in the active pixel array for the camera

n_cols

The number of columns in the active pixel array for the camera

use_a_priori

This boolean value is used to determine whether to append the identity matrix to the Jacobian matrix returned by compute_jacobian() in order to include the current estimate of the camera model in the calibration process.

Summary of Methods

project_onto_image

This method transforms 3D points (or directions) expressed in the camera frame into the corresponding 2D image locations.

project_directions

This method transforms 3D directions expressed in the camera frame into the corresponding 2D image directions.

compute_jacobian

This method computes the Jacobian matrix \(\partial\mathbf{x}_P/\partial\mathbf{c}\) where \(\mathbf{c}\) is a vector of camera model parameters.

compute_pixel_jacobian

This method computes the Jacobian matrix \(\partial\mathbf{x}_P/\partial\mathbf{x}_C\) where \(\mathbf{x}_C\) is a vector in the camera frame that projects to \(\mathbf{x}_P\) which is the pixel location.

compute_unit_vector_jacobian

This method computes the Jacobian matrix \(\partial\mathbf{x}_C/\partial\mathbf{x}_P\) where \(\mathbf{x}_C\) is a vector in the camera frame that projects to \(\mathbf{x}_P\) which is the pixel location.

apply_update

This method takes in a delta update to camera parameters (\(\Delta\mathbf{c}\)) and applies the update to the current instance in place.

pixels_to_unit

Convert pixel image locations to unit vectors expressed in the camera frame.

undistort_pixels

Compute undistorted pixel locations (gnomic/pinhole locations) for given distorted pixel locations.

distort_pixels

Apply distortion to gnomic pixel locations.

overwrite

Replace self with the properties of model in place.

to_elem

Store this camera model in an lxml.etree.SubElement object for saving in a GIANT xml file.

from_elem

Construct a new instance of SplitCamera from an etree._Element object.

check_in_fov

Determines if any points in the array are within the field of view of the camera.