Save cropped fits to file?
See original GitHub issueSay I have the following code:
from astropy.io import fits
from photutils.utils import cutout_footprint
hdulist = fits.open('myimage.fits')
hdu_data = hdulist[0].data
# Some center and box
xc, yc, xbox, ybox = 1000., 1000., 500., 700.
hdu_crop = cutout_footprint(hdu_data, (xc, yc), (ybox, xbox))[0]
How can I save the cropped image to a new fits file and conserve the header information?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
How do I crop a fits.gz file and then view the ... - Stack Overflow
This FITS file has the image data in the primary HDU just like the input. import numpy as np from astropy.io import fits...
Read more >How can I crop a fits file and get correct WCS header info ...
Just choose the rectangle tool, drag, and then choose Image->Crop. It doesn't save the WCS, though apparently that is on the development roadmap ......
Read more >Using Windows Paint to Save, Crop and Manipulate Graphics ...
Cropping a picture If you want to crop your picture, click on dashed box symbol. Then click and drag your cursor to form...
Read more >Crop a picture to fit in a shape - Microsoft Support
Click Picture Tools > Format, and in the Size group, click the arrow under Crop. Crop button found on the Picture Tools Format...
Read more >How to save a Cropped Image - Capture One
Rotate the crop to suit by grabbing just outside the corners of the crop frame (the cursor will change to a curved arrow)....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Done in https://github.com/astropy/photutils/commit/c883e8ef3e3eb6ee3f25890854a155506d195b6b.
Thanks, will do.