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

Fix keywords writing in stare.py

parent 108c1070
__version__ = '1.5.1'
__version__ = '1.5.2'
......@@ -113,8 +113,8 @@ class GBStare():
self.skylist.append(nod)
name_sky.append(os.path.basename(frame))
#print len(self.skylist)
#print len(self.starelist)
#print name_obj
#print name_sky
# Check if there is at least one Obj image.
......@@ -261,6 +261,7 @@ class GBStare():
mdark = ccdproc.CCDData.read(masterdark, unit=u.adu)
sky_corrected = ccdproc.subtract_dark(med_obj,mdark,exposure_time=CONFIG['KEYS']['EXPTIME'],exposure_unit=u.second)
sky_corrected = sky_corrected.data
mdark_mjd = mdark.header[CONFIG['KEYS']['MJD']]
self.messages.append('There is no sky image, the masterdark has been subtracted.')
else:
sky_corrected = med_obj.data
......@@ -293,13 +294,27 @@ class GBStare():
keyA = ''.join((CONFIG['SPEC_USED'][0],str(n),'SKY'))
mjdA = ''.join((CONFIG['SPEC_MJD'][0],str(n),'SKY'))
#value_keyA = self.starelist[n].header[CONFIG['KEYS']['FILENAME']]
value_keyA = self.starelist[n].header[CONFIG['KEYS']['IMANAME']]
value_mjdA = self.starelist[n].header[CONFIG['KEYS']['MJD']]
#value_keyA = self.skylist[n].header[CONFIG['KEYS']['FILENAME']]
value_keyA = self.skylist[n].header[CONFIG['KEYS']['IMANAME']]
value_mjdA = self.skylist[n].header[CONFIG['KEYS']['MJD']]
corrected.header[keyA] = (value_keyA,CONFIG['SPEC_USED'][1])
corrected.header[mjdA] = (value_mjdA,CONFIG['SPEC_MJD'][1])
try:
if use_dark:
keyA = ''.join((CONFIG['SPEC_USED'][0],'0','SKY'))
mjdA = ''.join((CONFIG['SPEC_MJD'][0],'0','SKY'))
value_keyA = os.path.basename(masterdark)
value_mjdA = mdark_mjd
corrected.header[keyA] = (value_keyA,CONFIG['SPEC_USED'][1])
corrected.header[mjdA] = (value_mjdA,CONFIG['SPEC_MJD'][1])
except:
pass
#Cnome = self.starelist[0].header[CONFIG['KEYS']['FILENAME']]
Cnome = self.starelist[0].header[CONFIG['KEYS']['IMANAME']]
#print Cnome
......
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