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

Modify group reduction

parent 03d52c74
No preview for this file type
...@@ -144,7 +144,7 @@ CONFIG['UNKNOWN'] = 'UNKNOWN' ...@@ -144,7 +144,7 @@ CONFIG['UNKNOWN'] = 'UNKNOWN'
# CONFIG['EXTMODE'] keyword values to determine to extraction mode # CONFIG['EXTMODE'] keyword values to determine to extraction mode
CONFIG['EXTPAIR'] = 'PAIR_EXT' CONFIG['EXTPAIR'] = 'PAIR_EXT'
CONFIG['EXTAVG'] = 'GRPAVG_EXT' CONFIG['EXTAVG'] = 'GRPAVG_EXT'
CONFIG['EXTDEFAULT'] = CONFIG['EXTAVG'] CONFIG['EXTDEFAULT'] = CONFIG['EXTPAIR']
# CONFIG['TARG_TYPE'] keyword values to determine type of object (science, telluric, ...) # CONFIG['TARG_TYPE'] keyword values to determine type of object (science, telluric, ...)
CONFIG['TELLURIC'] = 'TELLURIC' CONFIG['TELLURIC'] = 'TELLURIC'
CONFIG['FASTROT'] = 'FASTROT' CONFIG['FASTROT'] = 'FASTROT'
...@@ -163,8 +163,8 @@ CONFIG['SNR'] = (' '.join((CONFIG['KEY_DRS'],'SNR')),'SNR in the middle of the o ...@@ -163,8 +163,8 @@ CONFIG['SNR'] = (' '.join((CONFIG['KEY_DRS'],'SNR')),'SNR in the middle of the o
CONFIG['STRAIGHT_PAR'] = OrderedDict([ ('P1',' '.join((CONFIG['KEY_DRS'],'STR2DP1'))), ('P2',' '.join((CONFIG['KEY_DRS'],'STR2DP2'))), ('P3',' '.join((CONFIG['KEY_DRS'],'STR2DP3'))), ('P4',' '.join((CONFIG['KEY_DRS'],'STR2DP4'))), ('P5',' '.join((CONFIG['KEY_DRS'],'STR2DP5'))), ('P6',' '.join((CONFIG['KEY_DRS'],'STR2DP6'))) ]) CONFIG['STRAIGHT_PAR'] = OrderedDict([ ('P1',' '.join((CONFIG['KEY_DRS'],'STR2DP1'))), ('P2',' '.join((CONFIG['KEY_DRS'],'STR2DP2'))), ('P3',' '.join((CONFIG['KEY_DRS'],'STR2DP3'))), ('P4',' '.join((CONFIG['KEY_DRS'],'STR2DP4'))), ('P5',' '.join((CONFIG['KEY_DRS'],'STR2DP5'))), ('P6',' '.join((CONFIG['KEY_DRS'],'STR2DP6'))) ])
CONFIG['DRS_MJD'] = (' '.join((CONFIG['KEY_DRS'],'MJD')),'Mid-exposure MJD of the (combined) image') CONFIG['DRS_MJD'] = (' '.join((CONFIG['KEY_DRS'],'MJD')),'Mid-exposure MJD of the (combined) image')
CONFIG['BERV'] = (' '.join((CONFIG['KEY_DRS'],'BERV')),'Barycentric correction [km/s]') CONFIG['BERV'] = (' '.join((CONFIG['KEY_DRS'],'BERV')),'Barycentric correction [km/s]')
CONFIG['HJD'] = (' '.join((CONFIG['KEY_DRS'],'HJD')),'Mid-exposure HJD_UTC of the (combined) image') CONFIG['HJD'] = (' '.join((CONFIG['KEY_DRS'],'HJD')),'Mid-exposure HJD (MJD, UTC) of the (combined) image')
CONFIG['BJD'] = (' '.join((CONFIG['KEY_DRS'],'BJD')),'Mid-exposure BJD_TDB of the (combined) image') CONFIG['BJD'] = (' '.join((CONFIG['KEY_DRS'],'BJD')),'Mid-exposure BJD (MJD, TDB) of the (combined) image')
CONFIG['AIRMASS'] = (' '.join((CONFIG['KEY_DRS'],'AIRMASS')),'Airmass of the combined image') CONFIG['AIRMASS'] = (' '.join((CONFIG['KEY_DRS'],'AIRMASS')),'Airmass of the combined image')
CONFIG['MASTERFLAT'] = (' '.join((CONFIG['KEY_DRS'],'FLAT')),'Flat-field used for the reduction') CONFIG['MASTERFLAT'] = (' '.join((CONFIG['KEY_DRS'],'FLAT')),'Flat-field used for the reduction')
CONFIG['MASTERLAMP'] = (' '.join((CONFIG['KEY_DRS'],'LAMP')),'Calibration lamp used for the reduction') CONFIG['MASTERLAMP'] = (' '.join((CONFIG['KEY_DRS'],'LAMP')),'Calibration lamp used for the reduction')
......
...@@ -83,7 +83,8 @@ def gofio_init(docopt_args): ...@@ -83,7 +83,8 @@ def gofio_init(docopt_args):
CONFIG['S1D'] = True CONFIG['S1D'] = True
CONFIG['S1D_NORM'] = False CONFIG['S1D_NORM'] = False
if docopt_args['--group']:
CONFIG['EXTDEFAULT'] = CONFIG['EXTAVG']
maskc = ''.join(('GIANOB_MASKC_',CONFIG['DATE'],'.fits')) maskc = ''.join(('GIANOB_MASKC_',CONFIG['DATE'],'.fits'))
CONFIG['MASK_C'] = os.path.join(CONFIG['RES_DIR'], maskc) CONFIG['MASK_C'] = os.path.join(CONFIG['RES_DIR'], maskc)
......
...@@ -316,7 +316,7 @@ class GBStare(): ...@@ -316,7 +316,7 @@ class GBStare():
return Cnome return Cnome
def reduce(self,fitsfile,slit_pos): def reduce(self,fitsfile):
""" """
Straighten, divide by the masterflat, optimal extraction Straighten, divide by the masterflat, optimal extraction
""" """
...@@ -370,6 +370,18 @@ class GBStare(): ...@@ -370,6 +370,18 @@ class GBStare():
try: nspec = imstr.header[CONFIG['KEYS']['NCOMBINE']] try: nspec = imstr.header[CONFIG['KEYS']['NCOMBINE']]
except: nspec = 1 except: nspec = 1
# search for slit position
try:
slit_value = imstr.header[CONFIG['KEYS']['SLIT']]
if slit_value == CONFIG['A']:
slit_pos = CONFIG['A_POS']
elif slit_value == CONFIG['B']:
slit_pos = CONFIG['B_POS']
else:
slit_pos = CONFIG['C_POS']
except: slit_pos = CONFIG['C_POS']
# use only the regions of the orders # use only the regions of the orders
try: try:
goodmask = ccdproc.CCDData.read(CONFIG['MASK_C'], unit=u.adu) goodmask = ccdproc.CCDData.read(CONFIG['MASK_C'], unit=u.adu)
...@@ -679,7 +691,7 @@ class GBStare(): ...@@ -679,7 +691,7 @@ class GBStare():
warnings.simplefilter('ignore', category=AstropyWarning) warnings.simplefilter('ignore', category=AstropyWarning)
if self.qualitycheck(): if self.qualitycheck():
obj = self.createObj(False) obj = self.createObj(False)
calib, straight, dbreduced = self.reduce(obj,CONFIG['C_POS']) calib, straight, dbreduced = self.reduce(obj)
try: try:
db.insert_dbreduced(self.dbnight, dbreduced['s1d'], stamp) db.insert_dbreduced(self.dbnight, dbreduced['s1d'], stamp)
...@@ -705,7 +717,7 @@ class GBStare(): ...@@ -705,7 +717,7 @@ class GBStare():
#print self.stare #print self.stare
if self.qualitycheck(): if self.qualitycheck():
obj = self.createObj(True) obj = self.createObj(True)
calib, straight, dbreduced = self.reduce(obj,CONFIG['C_POS']) calib, straight, dbreduced = self.reduce(obj)
if straight: if straight:
os.remove(obj) os.remove(obj)
os.remove(straight) os.remove(straight)
...@@ -719,7 +731,7 @@ class GBStare(): ...@@ -719,7 +731,7 @@ class GBStare():
self.stare = self.group['stares'] self.stare = self.group['stares']
if self.qualitycheck(): if self.qualitycheck():
obj = self.createObj(True) obj = self.createObj(True)
calib, straight, dbreduced = self.reduce(obj,CONFIG['C_POS']) calib, straight, dbreduced = self.reduce(obj)
if straight: if straight:
os.remove(obj) os.remove(obj)
os.remove(straight) os.remove(straight)
......
...@@ -1211,7 +1211,7 @@ def berv_corr(hdr): ...@@ -1211,7 +1211,7 @@ def berv_corr(hdr):
#bjd = bjd.value #bjd = bjd.value
ltt_helio = times.light_travel_time(radec, 'heliocentric') ltt_helio = times.light_travel_time(radec, 'heliocentric')
hjd = times.utc + ltt_helio hjd = times.utc + ltt_helio
hjd = hjd.value hjd = hjd.value - 2400000.5
#berv = bc.get_BC_vel(JDUTC=mjd, ra=ra, dec=dec, lat = latitude, longi = longitude, alt = elevation, pmra = pma, pmdec = pmd, epoch=epoch, ephemeris = 'de430', leap_update=True) #berv = bc.get_BC_vel(JDUTC=mjd, ra=ra, dec=dec, lat = latitude, longi = longitude, alt = elevation, pmra = pma, pmdec = pmd, epoch=epoch, ephemeris = 'de430', leap_update=True)
berv = bc.get_BC_vel(JDUTC=mjd, ra=ra, dec=dec, lat = latitude, longi = longitude, alt = elevation, pmra = pma, pmdec = pmd, epoch=epoch, leap_update=True) berv = bc.get_BC_vel(JDUTC=mjd, ra=ra, dec=dec, lat = latitude, longi = longitude, alt = elevation, pmra = pma, pmdec = pmd, epoch=epoch, leap_update=True)
...@@ -1219,7 +1219,7 @@ def berv_corr(hdr): ...@@ -1219,7 +1219,7 @@ def berv_corr(hdr):
corr_time = bc.utc_tdb.JDUTC_to_BJDTDB(mjd, ra=ra, dec=dec, lat = latitude, longi = longitude, alt = elevation, pmra = pma, pmdec = pmd, epoch=epoch, leap_update=True) corr_time = bc.utc_tdb.JDUTC_to_BJDTDB(mjd, ra=ra, dec=dec, lat = latitude, longi = longitude, alt = elevation, pmra = pma, pmdec = pmd, epoch=epoch, leap_update=True)
corr_time = corr_time[0][0] corr_time = corr_time[0][0] - 2400000.5
return berv, hjd, corr_time return berv, hjd, corr_time
......
...@@ -7,8 +7,8 @@ Usage: ...@@ -7,8 +7,8 @@ Usage:
gofioDRS.py [-g=<config>] gofioDRS.py [-g=<config>]
gofioDRS.py <date> [-g=<config>] gofioDRS.py <date> [-g=<config>]
gofioDRS.py <date> <calib_date> [-g=<config>] gofioDRS.py <date> <calib_date> [-g=<config>]
gofioDRS.py <date> [--dark --flat --une --fp --all_calib --only_calib --use_flat=<flag> --s1d=<s1d>] gofioDRS.py <date> [--dark --flat --une --fp --all_calib --only_calib --use_flat=<flag> --s1d=<s1d> --group]
gofioDRS.py <date> <calib_date> [--dark --flat --une --fp --all_calib --only_calib --use_flat=<flag> --s1d=<s1d>] gofioDRS.py <date> <calib_date> [--dark --flat --une --fp --all_calib --only_calib --use_flat=<flag> --s1d=<s1d> --group]
Options: Options:
-h,--help : show this screen -h,--help : show this screen
...@@ -27,6 +27,8 @@ Options: ...@@ -27,6 +27,8 @@ Options:
options are global/order/nor/none [Default: order] options are global/order/nor/none [Default: order]
--s1d=<s1d> : s1d outputs are created, either normalized or not --s1d=<s1d> : s1d outputs are created, either normalized or not
options are yes/no/norm [Default: yes] options are yes/no/norm [Default: yes]
--group : group reduction of all the images of the same
observing block
""" """
......
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