DistortionCorrectionSIP
- class ctapointing.camera.DistortionCorrectionSIP(**kwargs: Any)
Bases:
DistortionCorrectionClass implementing simple polynomial distortion correction for images
Pixel corrections are implemented according to “The SIP Convention for Representing Distortion in FITS Image Headers”
Currently, a 2nd order polynominal correction is implemented. For the transformation from ideal (intermediate) pixel coordinates to physical pixel coordinates:
\[ \begin{align}\begin{aligned}x_p = A_{10} x^1 y^0 + A_{20} x^2 y^0 + A_{11} x^1 y^1 + A_{02} x^0 y^2\\y_p = B_{10} x^1 y^0 + B_{20} x^2 y^0 + B_{11} x^1 y^1 + B_{02} x^0 y^2\end{aligned}\end{align} \]For the inverse transformation from physical pixel coordinates to ideal (intermediate) pixel coordinates:
\[ \begin{align}\begin{aligned}x = AP_{10} x_p^1 y_p^0 + AP_{20} x_p^2 y_p^0 + AP_{11} x_p^1 y_p^1 + AP_{02} x_p^0 y_p^2\\y = BP_{10} x_p^1 y_p^0 + BP_{20} x_p^2 y_p^0 + BP_{11} x_p^1 y_p^1 + BP_{02} x_p^0 y_p^2\end{aligned}\end{align} \]Attributes Summary
An instance of a Python dict.
An instance of a Python dict.
Methods Summary
apply_correction(coords)Apply distortion correction from ideal (intermediate) pixel coordinates
(x, y)to physical pixel coordinates(xp, yp).apply_inverse_correction(coords_p)Apply distortion correction from physical pixel coordinates
(xp, yp)to ideal (intermediate) pixel coordinates(x, y).Attributes Documentation
- coeff
An instance of a Python dict.
One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.
Changed in version 5.0: Added key_trait for validating dict keys.
Changed in version 5.0: Deprecated ambiguous
trait,traitsargs in favor ofvalue_trait,per_key_traits.
- coeff_inv
An instance of a Python dict.
One or more traits can be passed to the constructor to validate the keys and/or values of the dict. If you need more detailed validation, you may use a custom validator method.
Changed in version 5.0: Added key_trait for validating dict keys.
Changed in version 5.0: Deprecated ambiguous
trait,traitsargs in favor ofvalue_trait,per_key_traits.
Methods Documentation
- apply_correction(coords)
Apply distortion correction from ideal (intermediate) pixel coordinates
(x, y)to physical pixel coordinates(xp, yp).- Parameters:
coords (np.array) – 2D array of ideal pixel positions
- Returns:
coords_p – 2D array of physical pixel positions
- Return type:
np.array
- apply_inverse_correction(coords_p)
Apply distortion correction from physical pixel coordinates
(xp, yp)to ideal (intermediate) pixel coordinates(x, y).- Parameters:
coords_p (np.array) – 2D array of physical pixel positions
- Returns:
coords – 2D array of ideal pixel positions
- Return type:
np.array
- apply_correction(coords)
Apply distortion correction from ideal (intermediate) pixel coordinates
(x, y)to physical pixel coordinates(xp, yp).- Parameters:
coords (np.array) – 2D array of ideal pixel positions
- Returns:
coords_p – 2D array of physical pixel positions
- Return type:
np.array
- apply_inverse_correction(coords_p)
Apply distortion correction from physical pixel coordinates
(xp, yp)to ideal (intermediate) pixel coordinates(x, y).- Parameters:
coords_p (np.array) – 2D array of physical pixel positions
- Returns:
coords – 2D array of ideal pixel positions
- Return type:
np.array