def _readFITS(self, filename, fluxname):
fs = pyfits.open(filename)
# pyfits cannot close the file on .close() if there are still
# references to mmapped data
self._wavetable = fs[1].data.field('wavelength').copy()
if fluxname is None:
fluxname = 'flux'
self._fluxtable = fs[1].data.field(fluxname).copy()
self.waveunits = units.Units(fs[1].header['tunit1'].lower())
self.fluxunits = units.Units(fs[1].header['tunit2'].lower())
# Retain the header information as a convenience for the user.
# If duplicate keywords exist, the value in the extension
# header will override that in the primary.
self.fheader = dict(fs[0].header)
self.fheader.update(dict(fs[1].header))
fs.close()
评论列表
文章目录