本文整理汇总了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