curryer.correction.psf¶
Attributes¶
Functions¶
|
Compute center-of-mass index for a one-dimensional weight vector. |
|
Project optical PSF onto Earth's surface using vectorized ray tracing. |
Convolve GCP reference image with dynamic PSF using FFT. |
|
Apply spacecraft motion blur to projected PSF. |
|
|
Zero-pad PSF to center its centroid on the grid. |
Resample PSF to match GCP reference image resolution. |
|
|
Normalize PSF to unit total power. |
|
Return |
Module Contents¶
- curryer.correction.psf.logger¶
- curryer.correction.psf.centroid(weights: numpy.ndarray) float¶
Compute center-of-mass index for a one-dimensional weight vector.
- Parameters:
weights (np.ndarray) – One-dimensional weight array.
- Returns:
Center-of-mass index position.
- Return type:
float
- Raises:
ValueError – If weight vector has zero total mass.
- curryer.correction.psf.project_psf(r_iss_ctrs_m: numpy.ndarray, optical_psfs: collections.abc.Iterable[curryer.correction.grid_types.OpticalPSFEntry], subimage: curryer.correction.grid_types.ImageGrid, los_set_hs: numpy.ndarray) curryer.correction.grid_types.ProjectedPSF¶
Project optical PSF onto Earth’s surface using vectorized ray tracing.
- Parameters:
r_iss_ctrs_m (np.ndarray) – Spacecraft position in ECEF coordinates, shape (3,), units: meters.
optical_psfs (Iterable[OpticalPSFEntry]) – Collection of optical PSF samples at different field angles.
subimage (ImageGrid) – Image grid defining the observation geometry.
los_set_hs (np.ndarray) – Line-of-sight unit vectors in instrument frame, shape (n_pixels, 3).
- Returns:
PSF projected onto Earth’s surface with lat, lon, height grids.
- Return type:
- Raises:
ValueError – If no optical PSF entries provided.
RuntimeError – If ray-ellipsoid intersection fails.
- curryer.correction.psf.convolve_gcp_with_psf(gcp: curryer.correction.grid_types.ImageGrid, psf: curryer.correction.grid_types.PSFGrid) curryer.correction.grid_types.ImageGrid¶
Convolve GCP reference image with dynamic PSF using FFT.
- curryer.correction.psf.convolve_psf_with_spacecraft_motion(psf: curryer.correction.grid_types.ProjectedPSF, composite_img: curryer.correction.grid_types.ImageGrid, config: curryer.correction.config.PSFSamplingConfig) curryer.correction.grid_types.PSFGrid¶
Apply spacecraft motion blur to projected PSF.
- Parameters:
psf (ProjectedPSF) – Projected PSF on Earth’s surface.
composite_img (ImageGrid) – Composite image defining spacecraft motion direction.
config (PSFSamplingConfig) – Configuration with PSF sampling parameters.
- Returns:
PSF convolved with spacecraft motion blur.
- Return type:
- curryer.correction.psf.zero_pad_psf(psf: curryer.correction.grid_types.PSFGrid) curryer.correction.grid_types.PSFGrid¶
Zero-pad PSF to center its centroid on the grid.
- curryer.correction.psf.resample_psf_to_gcp_resolution(psf: curryer.correction.grid_types.PSFGrid, gcp: curryer.correction.grid_types.ImageGrid) curryer.correction.grid_types.PSFGrid¶
Resample PSF to match GCP reference image resolution.
- curryer.correction.psf.normalize_psf(psf: curryer.correction.grid_types.PSFGrid) curryer.correction.grid_types.PSFGrid¶
Normalize PSF to unit total power.
- curryer.correction.psf.resolve_spacecraft_ecef(grid: curryer.correction.grid_types.ImageGrid, r_spacecraft_m: numpy.ndarray | None, default_altitude_m: float = 400000.0) tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]¶
Return
(r_spacecraft_m, boresight, t_matrix)for image-matching.When r_spacecraft_m is provided it is used directly; the boresight is the unit nadir vector
-r / |r|. When r_spacecraft_m isNonethe grid center lat/lon is used to build an approximate nadir position at default_altitude_m above the WGS-84 ellipsoid surface.The rotation matrix is always the
3×3identity — the boresight is already expressed in the CTRS frame via the nadir-approximation, so no additional rotation is needed.- Parameters:
grid (ImageGrid) – Observation grid, used for the center lat/lon when r_spacecraft_m is
None.r_spacecraft_m (ndarray of shape (3,) or None) – Spacecraft ECEF position in meters. Pass
Noneto fall back to the nadir approximation.default_altitude_m (float, optional) – Spacecraft altitude above the WGS-84 surface (meters) used when r_spacecraft_m is
None. Default 400 000 m (ISS nominal orbit). Override for other spacecraft (e.g. 505 000 m for CTIM).
- Returns:
r_spacecraft_m (ndarray, shape (3,)) – ECEF spacecraft position in meters.
boresight (ndarray, shape (3,)) – Nadir unit vector from spacecraft toward Earth center.
t_matrix (ndarray, shape (3, 3)) – Identity rotation matrix.