本文整理匯總了Python中pyfits.HDUList方法的典型用法代碼示例。如果您正苦於以下問題:Python pyfits.HDUList方法的具體用法?Python pyfits.HDUList怎麽用?Python pyfits.HDUList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyfits
的用法示例。
在下文中一共展示了pyfits.HDUList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: saveScrns
# 需要導入模塊: import pyfits [as 別名]
# 或者: from pyfits import HDUList [as 別名]
def saveScrns(self, DIR):
"""
Saves the currently loaded phase screens to file,
saving the r0 value in the fits header (in units of pixels).
Saved phase data is in radians @500nm
Args:
DIR (string): The directory to save the screens
"""
for scrn in range(self.scrnNo):
logger.info("Write Sreen {}....".format(scrn))
hdu = fits.PrimaryHDU(self.wholeScrns[scrn])
hdu.header["R0"] = self.wholeScrnR0 / self.pixel_scale
hdulist = fits.HDUList([hdu])
hdulist.writeto(DIR+"/scrn{}.fits".format(scrn))
hdulist.close()
logger.info("Done!")
示例2: MakeFITS
# 需要導入模塊: import pyfits [as 別名]
# 或者: from pyfits import HDUList [as 別名]
def MakeFITS(model, fitsfile=None):
'''
Generate a FITS file for a given :py:mod:`everest` run.
:param model: An :py:mod:`everest` model instance
'''
# Get the fits file name
if fitsfile is None:
outfile = os.path.join(model.dir, model._mission.FITSFile(
model.ID, model.season, model.cadence))
else:
outfile = os.path.join(model.dir, fitsfile)
if os.path.exists(outfile) and not model.clobber:
return
elif os.path.exists(outfile):
os.remove(outfile)
log.info('Generating FITS file...')
# Create the HDUs
primary = PrimaryHDU(model)
lightcurve = LightcurveHDU(model)
pixels = PixelsHDU(model)
aperture = ApertureHDU(model)
images = ImagesHDU(model)
hires = HiResHDU(model)
# Combine to get the HDUList
hdulist = pyfits.HDUList(
[primary, lightcurve, pixels, aperture, images, hires])
# Output to the FITS file
hdulist.writeto(outfile)
return