wf_psf.utils.ccd_misalignments

CCD misalignments.

A module with utilities to handle CCD missalignments.

Author:

Tobias Liaudat <tobias.liaudat@cea.fr>

Classes

CCDMisalignmentCalculator(tiles_path[, ...])

CCD Misalignment Calculator.

class wf_psf.utils.ccd_misalignments.CCDMisalignmentCalculator(tiles_path: str, x_lims: list[float] | ndarray = [0, 1000.0], y_lims: list[float] | ndarray = [0, 1000.0], tel_focal_length: float = 24.5, tel_diameter: float = 1.2)[source]

Bases: object

CCD Misalignment Calculator.

This class processes and analyzes CCD misalignment data using tile position information.

The tiles_data array is a data cube where each slice is a 4×3 matrix representing the four corners of a tile. The first two columns correspond to x/y coordinates (in mm), and the third column represents z displacement (in µm).

Parameters:
  • tiles_path (str) – Path to the stored tiles data file.

  • x_lims (Union[list[float], np.ndarray] = [0, 1e3], optional) – x-coordinate limits in the WaveDiff coordinate system (focal plane). Shape: (2,). Defaults to [0, 1e3].

  • y_lims (Union[list[float], np.ndarray] = [0, 1e3], optional) – y-coordinate limits in the WaveDiff coordinate system (focal plane). Shape: (2,). Defaults to [0, 1e3].

  • tel_focal_length (float, optional) – Telescope focal length in meters. Defaults to 24.5.

  • tel_diameter (float, optional) – Telescope aperture diameter in meters. Defaults to 1.2.

tiles_data

Loaded tile data from the specified file.

Type:

np.ndarray

tiles_x_lims

Minimum and maximum x-coordinate values from tiles_data.

Type:

np.ndarray

tiles_y_lims

Minimum and maximum y-coordinate values from tiles_data.

Type:

np.ndarray

tiles_z_lims

Minimum and maximum z-coordinate values from tiles_data.

Type:

np.ndarray

tiles_z_average

Average z-coordinate value across all tiles.

Type:

float

ccd_polygons

List of CCD boundary polygons.

Type:

list[mpltPath.Path]

scaled_data

Scaled tile data.

Type:

np.ndarray

n_points_per_ccd

Number of points per CCD.

Type:

int

kdtree

KDTree structure for spatial queries.

Type:

KDTree

normal_list

List of normal vectors for CCD planes.

Type:

np.ndarray

d_list

List of plane offset values for CCD planes.

Type:

np.ndarray

Methods

check_position_format(pos)

Check and format input position.

check_position_tile_limits(pos)

Check if position is within tile limits.

check_position_wavediff_limits(pos)

Check if position is within wavediff limits.

compute_z_from_plane_data(pos, normal, d)

Compute z value from plane data.

get_ccd_from_position(pos)

Get CCD ID from the position.

get_dz_from_position(pos)

Get z-axis displacement for a focal plane position.

get_zk4_from_position(pos)

Get defocus Zernike contribution from focal plane position.

scale_position_to_tile_reference(pos)

Scale input position into tiles coordinate system.

scale_position_to_wavediff_reference(pos)

Scale input position into wavediff coordinate system.

static check_position_format(pos)[source]

Check and format input position.

Parameters:

pos (Union[list, np.ndarray]) – Input position.

Returns:

Formatted position.

Return type:

np.ndarray

check_position_tile_limits(pos)[source]

Check if position is within tile limits.

check_position_wavediff_limits(pos)[source]

Check if position is within wavediff limits.

static compute_z_from_plane_data(pos, normal, d)[source]

Compute z value from plane data.

Plane equation: normal . pos + d = 0

If normal = (a,b,c), and, a*x + b*y + c*z + d = 0, then, z = (-a*x -b*y -d) / c

Parameters:
  • pos (np.ndarray) – Focal plane position in wavediff coordinate system respecting self.x_lims and self.y_lims. Shape: (2,)

  • normal (np.ndarray) – Plane normal vector. Shape: (3,)

  • d (np.ndarray) – d value from the plane ecuation. Shape (3,)

get_ccd_from_position(pos)[source]

Get CCD ID from the position.

The ID correponds to the orden in the input self.tiles_data

Parameters:

pos (np.ndarray) – Focal plane position respecting self.x_lims and self.y_lims. Shape: (2,)

get_dz_from_position(pos)[source]

Get z-axis displacement for a focal plane position.

Parameters:

pos (np.ndarray) – Focal plane position respecting self.x_lims and self.y_lims. Shape: (2,)

Returns:

dz – The delta in z-axis (perpendicular to the focal plane) in [m].

Return type:

float

get_zk4_from_position(pos)[source]

Get defocus Zernike contribution from focal plane position.

Parameters:

pos (np.ndarray) – Focal plane position respecting self.x_lims and self.y_lims. Shape: (2,)

Returns:

Zernike 4 value in wavediff convention corresponding to the delta z of the given input position pos.

Return type:

float

scale_position_to_tile_reference(pos)[source]

Scale input position into tiles coordinate system.

Parameters:

pos (np.ndarray) – Focal plane position in wavediff coordinate system respecting self.x_lims and self.y_lims. Shape: (2,)

scale_position_to_wavediff_reference(pos)[source]

Scale input position into wavediff coordinate system.

Parameters:

pos (np.ndarray) – Tile position in input tile coordinate system. Shape: (2,)