Commit aba1331f authored by Monica Rainer's avatar Monica Rainer
Browse files

Add keyword for wavelength calibration successful/failed

parent e3f89d49
......@@ -136,6 +136,8 @@ class GBWls():
mwl.header[CONFIG['RON_EFF'][0]] = (math.sqrt(len(self.wllist))*CONFIG['RON'],CONFIG['RON_EFF'][1])
mwl.header[CONFIG['GAIN_EFF'][0]] = (len(self.wllist)*CONFIG['GAIN'],CONFIG['GAIN_EFF'][1])
mwl.header[CONFIG['DRS_VERSION'][0]] = (CONFIG['VERSION'], CONFIG['DRS_VERSION'][1])
hdu = fits.PrimaryHDU(data=mwl.data,header=mwl.header)
masterwl = fits.HDUList([hdu])
masterwl.writeto(nome,clobber=True)
......@@ -228,7 +230,10 @@ class GBWls():
for comment in comments:
self.messages.append(comment)
keyfail = ''.join((CONFIG['CAL_FAILED'][0],str(x+32)))
if calib_failed:
wl.header[keyfail] = (False,CONFIG['CAL_FAILED'][1])
self.messages.append(' *** WARNING ***')
self.messages.append('The default wavelength calibration for the order %s will be taken from the database and as such it will not be optimal for the night.' % str(x+32))
try:
......@@ -250,6 +255,7 @@ class GBWls():
self.messages.append('There is no default wavelength calibration in the database, please observe a new lamp, otherwise the spectra will not be wavelength calibrated.')
else:
wl.header[keyfail] = (True,CONFIG['CAL_FAILED'][1])
for key in coeffs:
keyword = ''.join((CONFIG['WLCOEFFS'][key][0],str(x+32)))
wl.header[keyword] = (coeffs[key],CONFIG['WLCOEFFS'][key][1])
......@@ -285,6 +291,7 @@ class GBWls():
wlextract.data = np.asarray(wlextract.data, dtype='float32')
wlextract.header = wl.header
wlextract.header[CONFIG['KEY_WEXT'][0]] = (CONFIG['WEXT']*2,CONFIG['KEY_WEXT'][1])
hdu = fits.PrimaryHDU(data=wlextract.data,header=wlextract.header)
wlextr = fits.HDUList([hdu])
wlextr.writeto(extracted,clobber=True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment