gen_new_wcs#

niriss_tools.isophotal.gen_new_wcs(ref_path, ref_hdu_index=0, resolution=0.04, padding=100)[source]#

Generate a new WCS for a given reference image.

The new WCS is North-aligned, and can optionally take on a specified pixel scale. Padding is applied relative to the minimal extent of the reference image (ignoring NaNs).

Parameters:
ref_pathPathLike

The path of the reference image, to which all other images will be cropped.

ref_hdu_indexint, optional

The index of the HDU containing the reference image, by default 0.

resolutionfloat | Quantity, optional

The pixel scale used in the new WCS. If a float is supplied, the units are assumed to be arcseconds. By default 0.04.

paddingint | tuple[int, int], optional

The padding to apply around the reference image in pixels, by default 100. If a tuple is supplied, the values are applied in the order (axis2, axis1).

Returns:
new_wcsWCS

The new WCS, as calculated from the input parameters.

new_shape(int, int)

The shape of the array required to cover the reproject reference image, and the associated padding.