Image Resampling#
To later merge each individual PUNCH spacecraft observation into a unified virtual observatory later in the pipeline, first each observation must be reprojected into a standardized frame.
Concept#
Each observation contains a corresponding World Coordinate System (WCS), describing the physical coordinates of each pixel in the data. With an output WCS defined for the full PUNCH field of view observation, the AstroPy reproject package can be used to transform the data from the spacecraft frame into the full mosaic frame.
Note that here we use the adaptive reprojection methodology based on a DeForest (2004) algorithm - better preserving structure and photometry.
Applying correction#
Image resampling is carried out in the punchbowl.level2.resmaple.reproject_cube
function:
- punchbowl.level2.resample.reproject_cube(input_cube: NDCube, output_wcs: WCS, output_shape: tuple[int, int]) ndarray
Core reprojection function.
- Core reprojection function of the PUNCH mosaic generation module.
With an input data array and corresponding WCS object, the function performs a reprojection into the output WCS object system, along with a specified pixel size for the output array. This utilizes the adaptive reprojection routine implemented in the reprojection astropy package.
- Parameters:
input_cube (NDCube) – input cube to be reprojected
output_wcs – astropy WCS object describing the coordinate system to transform to
output_shape – pixel shape of the reprojected output array
- Returns:
output array after reprojection of the input array
- Return type:
np.ndarray
Example Call#
>>> reprojected_arrays = reproject_cube(input_cube, output_wcs, output_shape)
If you wish to incorporate this as a Prefect task in a custom pipeline,
using something like the punchbowl.level2.resmaple.reproject_many_flow
is recommended.