multicolorfits.crop_image#
- multicolorfits.crop_image(datain, hdrin, xbounds, ybounds, newref=None, savenew=False, overwrite=False)[source]#
Function to crop a 2D fits image to the specified pixel bounds.
- Parameters:
datain (array) – Input fits image array
hdrin (astropy.io.fits.header) – Input header
xbounds (list) – [min,max] x-axis pixel limits to use for new image slice
ybounds (list) – [min,max] y-axis pixel limits to use for new image slice
newref (None or str) – None, ‘center’, or ‘origin’. None (default) keeps the reference pixel sky coordinate the same. ‘center’ forces the reference pixel to be the new center, ‘origin’ forces it to the new origin.
savenew (bool or str) – False (default) does not save, otherwise specify a save path (e.g. savenew=’./mynewfits.fits’) to save the crop to disk
overwrite (bool) – Input option to astropy.io.fits.writeto(…, overwrite=False)
- Returns:
array, astropy.io.fits.header – cropdata, crophdr