Commit 30cf7cee authored by Monica Rainer's avatar Monica Rainer
Browse files

Add new masterdarks

parent 9fc7a645
......@@ -181,8 +181,11 @@ CONFIG['DB_RAMP_COLS'] = {'fpath':'FPATH' , 'obstype':'OBSTYPE' , 'dateobs':'DAT
CONFIG['DB_CALIB'] = 'drs_calib.db'
CONFIG['DB_CALIB_PATH'] = os.path.join(CONFIG['CALIB_DB_DIR'], CONFIG['DB_CALIB'])
CONFIG['DB_CALIB_TBL'] = 'calibrations'
#CONFIG['DB_CALIB_COLS'] = {'01_data': 'date_calib', 'dark10': 'masterdark10', 'dark30': 'masterdark30', 'dark60': 'masterdark60', 'dark100': 'masterdark100', 'flat': 'masterflat', 'flatstr': 'masterflat_str', 'flatnor': 'masterflat_nor', 'une': 'wl_une', 'une_str': 'wl_une_str', 'une_calib':'wl_une_calib' ,'fp': 'wl_fp', 'fp_str': 'wl_fp_str', 'fp_calib':'wl_fp_calib'}
CONFIG['DB_CALIB_COLS'] = OrderedDict([('01_data', 'date_calib'), ('dark10', 'masterdark10'), ('dark30', 'masterdark30'), ('dark60', 'masterdark60'), ('dark100', 'masterdark100'), ('flat', 'masterflat'), ('flatstr', 'masterflat_str'), ('flatnor', 'masterflat_nor'), ('une', 'wl_une'), ('une_str', 'wl_une_str'), ('une_calib', 'wl_une_calib'), ('fp', 'wl_fp'), ('fp_str', 'wl_fp_str'), ('fp_calib','wl_fp_calib')])
#CONFIG['DB_CALIB_COLS'] = OrderedDict([('01_data', 'date_calib'), ('dark10', 'masterdark10'), ('dark30', 'masterdark30'), ('dark60', 'masterdark60'), ('dark100', 'masterdark100'), ('flat', 'masterflat'), ('flatstr', 'masterflat_str'), ('flatnor', 'masterflat_nor'), ('une', 'wl_une'), ('une_str', 'wl_une_str'), ('une_calib', 'wl_une_calib'), ('fp', 'wl_fp'), ('fp_str', 'wl_fp_str'), ('fp_calib','wl_fp_calib')])
CONFIG['DB_CALIB_COLS'] = OrderedDict([('01_data', 'date_calib'), ('dark10', 'masterdark10'), ('dark30', 'masterdark30'), ('dark60', 'masterdark60'), ('dark100', 'masterdark100'), ('dark200', 'masterdark200'), ('dark300', 'masterdark300'), ('dark600', 'masterdark600'),('flat', 'masterflat'), ('flatstr', 'masterflat_str'), ('flatnor', 'masterflat_nor'), ('une', 'wl_une'), ('une_str', 'wl_une_str'), ('une_calib', 'wl_une_calib'), ('fp', 'wl_fp'), ('fp_str', 'wl_fp_str'), ('fp_calib','wl_fp_calib')])
CONFIG['DB_CALIB_DATATYPE'] = OrderedDict()
for colname in CONFIG['DB_CALIB_COLS']:
CONFIG['DB_CALIB_DATATYPE'][colname] = 'TEXT'
......@@ -247,8 +250,10 @@ CONFIG['USE_FLAT'] = {'global':False, 'order':True, 'nor':False} # global: flat
CONFIG['FLAT_EXPT'] = 100.0
CONFIG['WLCAL_EXPT'] = 100.0
CONFIG['FP_EXPT'] = 60.0
CONFIG['DARKLIST'] = {10:[],30:[],60:[],100:[]} # exptime dei dark
CONFIG['NDARK'] = 4 # quanti tipi di dark (esempio: 10,30,60,100 sec = 4) meglio sovrastimare
CONFIG['DARKLIST'] = {10:[],30:[],60:[],100:[],200:[],300:[],600:[]} # exptime dei dark
CONFIG['NDARK'] = len(CONFIG['DARKLIST']) # quanti tipi di dark (esempio: 10,30,60,100 sec = 4) meglio sovrastimare
CONFIG['WEXT'] = 5 # extraction window for wavelength calibration, it will extract 2*wext around the center of the order
#
# CCD info
......@@ -265,7 +270,7 @@ CONFIG['W_ORD'] = 41 # width of straighten order in pixel
# Quality checks
#
CONFIG['DARK_MEAN'] = {10:[5.0,5.0,10.0,8.0],30:[15.0,12.0,25.0,18.0],60:[25.0,20.0,40.0,32.0],100:[30.0,25.0,65.0,45.0]} # Dark quality check: mean signal below this number (4 quadrant for 4 exposure time)
CONFIG['DARK_MEAN'] = {10:[10.0,10.0,10.0,10.0], 30:[25.0,25.0,25.0,25.0], 60:[50.0,50.0,50.0,50.0], 100:[80.0,80.0,80.0,80.0], 200:[800.0,800.0,800.0,800.0], 300:[800.0,800.0,800.0,800.0], 600:[800.0,800.0,800.0,800.0]} # Dark quality check: mean signal below this number (4 quadrant for 7 exposure time)
CONFIG['FLATSIGNAL'] = 300 # lowest flat signal expected to pass quality check
CONFIG['SCIENCECHECK'] = [500,540,140,160] # region x1:x2,y1:y2 for images' quality check
#CONFIG['NODSIGNAL'] = 2*CONFIG['DARK_MEAN']['quadrant'][0] # lowest image signal expected to pass quality check
......
......@@ -21,6 +21,18 @@ def create_db_calib():
"(" + \
",".join([CONFIG['DB_CALIB_COLS'][colname] + ' ' + CONFIG['DB_CALIB_DATATYPE'][colname] for colname in CONFIG['DB_CALIB_COLS']]) + \
')')
for colname in CONFIG['DB_CALIB_COLS']:
try:
cursor.execute('ALTER TABLE {table} ADD COLUMN {column} {datatype}'\
.format(table=CONFIG['DB_CALIB_TBL'],column=CONFIG['DB_CALIB_COLS'][colname], datatype=CONFIG['DB_CALIB_DATATYPE'][colname]))
except:
#print CONFIG['DB_CALIB_TBL']
print colname
#print CONFIG['DB_CALIB_DATATYPE'][colname]
pass
dbcalib.commit()
return dbcalib
......
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