Created
February 9, 2016 17:27
-
-
Save boada/0584be63101e18df2ea5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mk_thumb_wcs(header,data,ra,dec,window,output): | |
try: | |
wcs = astWCS.WCS(header,mode='pyfits') | |
except: | |
wcs = astWCS.WCS(header,mode='pyfits',extensionName='SCI') | |
imdict = astImages.clipImageSectionWCS(data, wcs, ra, dec, | |
window, returnWCS=True) | |
thumb = imdict['data'] #data array | |
newwcs = imdict['wcs'] #wcs info | |
astImages.saveFITS(output, thumb, imageWCS=newwcs) | |
return thumb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment