||
Found a strange thing that the BZERO & BSCALE cards can't be written to the header by the code below
hdu = fits.open(fits_file)
h = hdu[0].header
img = hdu[0].data
h['BZERO'] = 0.
h['BSCALE'] = 1.
fits.writeto(fits_file,img,h)
This will cause problems when using getsources, since it reads these cards. A solution is (though I don't know why)
hdu = fits.open(fits_file)
hdu[0].header['BZERO'] = 0.
hdu[0].header['BSCALE'] = 1.
fits.writeto(fits_file,hdu[0].data,hdu[0].header)
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-6-4 01:17
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社