def _getLevel1File(self): warnings.resetwarnings() warnings.filterwarnings("ignore", category=UserWarning, append=True) header = pf.open(self.sci_names[0], ignore_missing_end=True)[0].header basename = helpers.getBaseName(header) filename = basename + "_files.json" return filename
def _getLevel1File(self): warnings.resetwarnings() warnings.filterwarnings('ignore', category=UserWarning, append=True) header = pf.open(self.sci_names[0],ignore_missing_end=True)[0].header basename = helpers.getBaseName(header) filename = basename+'_files.json' return filename
def write_spec(self, filename=None, path='.'): c1 = fits.Column(name='wave', format='E', array=self.wave) c2 = fits.Column(name='flux', format='E', array=self.flux) c3 = fits.Column(name='uflux', format='E', array=self.uflux) coldefs = fits.ColDefs([c1,c2,c3]) tbhdu = fits.BinTableHDU.from_columns(coldefs) hdu = fits.PrimaryHDU(header=self.header) thdulist = fits.HDUList([hdu,tbhdu]) if filename is None: basename = helpers.getBaseName(self.header) filename = path+'/'+basename+'_combspec.fits' thdulist.writeto(filename,clobber=True) return filename
def writeSpec(self, filename=None, path='.',order=1): c1 = pf.Column(name='wave', format='D', array=self.wave) c2 = pf.Column(name='flux', format='D', array=self.flux) c3 = pf.Column(name='uflux', format='D', array=self.uflux) coldefs = pf.ColDefs([c1,c2,c3]) tbhdu = pf.BinTableHDU.from_columns(coldefs) hdu = pf.PrimaryHDU(header=self.header) thdulist = pf.HDUList([hdu,tbhdu]) if filename is None: basename = helpers.getBaseName(self.header) filename = path+'/'+basename+'_calspec'+str(order)+'.fits' thdulist.writeto(filename,clobber=True) return filename
def write_spec(self, filename=None, path='.'): c1 = fits.Column(name='wave', format='E', array=self.wave) c2 = fits.Column(name='flux', format='E', array=self.flux) c3 = fits.Column(name='uflux', format='E', array=self.uflux) c4 = fits.Column(name='sky_sci', format='E', array=self.sky_sci) c5 = fits.Column(name='sky_std', format='E', array=self.sky_std) c6 = fits.Column(name='sky_model', format='E', array=self.sky_model) coldefs = fits.ColDefs([c1, c2, c3, c4, c5, c6]) tbhdu = fits.BinTableHDU.from_columns(coldefs) hdu = fits.PrimaryHDU(header=self.header) thdulist = fits.HDUList([hdu, tbhdu]) if filename is None: basename = helpers.getBaseName(self.header) filename = path + '/' + basename + '_combspec.fits' thdulist.writeto(filename, overwrite=True) return filename
def writeSpec(self, filename=None, path='.', order=1): c1 = pf.Column(name='wave', format='D', array=self.wave) c2 = pf.Column(name='flux', format='D', array=self.flux) c3 = pf.Column(name='uflux', format='D', array=self.uflux) c4 = pf.Column(name='sky_sci', format='D', array=self.sky_sci) c5 = pf.Column(name='sky_std', format='D', array=self.sky_std) coldefs = pf.ColDefs([c1, c2, c3, c4, c5]) tbhdu = pf.BinTableHDU.from_columns(coldefs) hdu = pf.PrimaryHDU(header=self.header) thdulist = pf.HDUList([hdu, tbhdu]) if filename is None: basename = helpers.getBaseName(self.header) filename = path + '/' + basename + '_calspec' + str( order) + '.fits' thdulist.writeto(filename, clobber=True) return filename