regrid_cube¶
-
FITS_tools.regrid_cube(cubedata, cubeheader, targetheader, preserve_bad_pixels=True, order=1, mode='constant', out_of_bounds=nan, **kwargs)[source] [edit on github]¶ Attempt to reproject a cube onto another cube’s header. Uses interpolation via
map_coordinatesAssumptions:
- Both the cube and the target are 3-dimensional, with lon/lat/spectral axes
- Both cube and header use CD/CDELT rather than PC
kwargswill be passed tomap_coordinatesParameters: cubedata :
ndarrayA three-dimensional data cube
The header or WCS corresponding to the image
The header or WCS to interpolate onto
preserve_bad_pixels : bool
Try to set NAN pixels to NAN in the zoomed image. Otherwise, bad pixels will be set to zero
out_of_bounds : float or np.nan
Pixels in the output image that were out of bounds in the old image will be set to this value if mode=’constant’
mode : str
The mode of treatment of out-of-bounds pixels; can be ‘constant’, ‘wrap’, ‘reflect’, or ‘nearest’. See
map_coordinatesfor details.Returns: newcubedata :
ndarrayThe regridded cube