dfreproject.sip =============== .. py:module:: dfreproject.sip Functions --------- .. autoapisummary:: dfreproject.sip.get_sip_coeffs dfreproject.sip.apply_sip_distortion dfreproject.sip.apply_inverse_sip_distortion dfreproject.sip.iterative_inverse_sip Module Contents --------------- .. py:function:: get_sip_coeffs(wcs: astropy.wcs.WCS) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor] Extract SIP polynomial coefficients from a WCS object. Parameters: ----------- wcs : astropy.wcs.WCS WCS object potentially containing SIP distortion Returns: -------- dict: Dictionary containing SIP coefficient matrices A, B, AP, BP and orders .. py:function:: apply_sip_distortion(u: torch.Tensor, v: torch.Tensor, sip_coeffs: Tuple, device: str = 'cpu') Apply SIP distortion to intermediate pixel coordinates. Parameters: ----------- u, v : torch.Tensor Intermediate pixel coordinates (before distortion) sip_coeffs : Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor] SIP coefficient matrices device : torch.device, optional Device to place tensors on Returns: -------- tuple: (u', v') distorted coordinates .. py:function:: apply_inverse_sip_distortion(u: torch.Tensor, v: torch.Tensor, sip_coeffs: Tuple, device: str = 'cpu') Apply inverse SIP distortion to go from distorted to intermediate coordinates. Parameters: ----------- u, v : torch.Tensor Distorted coordinates sip_coeffs : Tuple SIP coefficient matrices device : torch.device, optional Device to place tensors on Returns: -------- tuple: (u', v') undistorted coordinates .. py:function:: iterative_inverse_sip(u: torch.Tensor, v: torch.Tensor, sip_coeffs: Tuple, device: str = 'cpu', max_iter: int = 20, tol: float = 1e-08) Iteratively solve for undistorted coordinates when inverse SIP coefficients are not available. Parameters: ----------- u, v : torch.Tensor Distorted coordinates sip_coeffs : Tuple SIP coefficient matrices device : torch.device, optional Device to place tensors on max_iter : int, optional Maximum number of iterations tol : float, optional Convergence tolerance Returns: -------- tuple: (u', v') undistorted coordinates