wf_psf.utils.ccd_misalignments
CCD misalignments.
A module with utilities to handle CCD missalignments.
- Author:
Tobias Liaudat <tobias.liaudat@cea.fr>
Classes
|
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:
objectCCD 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
- scaled_data
Scaled tile data.
- Type:
np.ndarray
- 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 and format input position.
Check if position is within tile limits.
Check if position is within wavediff limits.
compute_z_from_plane_data(pos, normal, d)Compute z value from plane data.
Get CCD ID from the position.
get_dz_from_position(pos)Get z-axis displacement for a focal plane position.
Get defocus Zernike contribution from focal plane position.
Scale input position into tiles coordinate system.
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
- 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:
- 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: