Commit 82ce5623 authored by Monica Rainer's avatar Monica Rainer
Browse files

Fix bug in failed wavelength calibration

parent 801c2ac8
......@@ -66,16 +66,18 @@ CONFIG['OFFLINE'] = False
# Directories
#
#CONFIG['BASE_RAW'] = '/mnt/nfs/RAW'
CONFIG['BASE_RAW'] = '/home/monica/Documenti/gianob/gianobdrs/varie/commissioning_marzo/raw'
CONFIG['BASE_RAMP'] = '/home/avet/gianorp/databases'
CONFIG['USR_DIR'] = os.environ.get('HOME')
CONFIG['TMP_DIR'] = tempfile.gettempdir()
CONFIG['APP_DIR'] = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
#CONFIG['BASE_RAW'] = '/mnt/nfs/RAW'
CONFIG['BASE_RAW'] = '/home/monica/Documenti/gianob/gianobdrs/varie/commissioning_marzo/raw'
CONFIG['BASE_RED_DIR'] = os.path.join(CONFIG['APP_DIR'],'reduced')
#CONFIG['BASE_RED_DIR'] = '/mnt/nfs/REDUCED'
CONFIG['BASE_RAMP'] = '/home/avet/gianorp/databases'
CONFIG['RAW_DIR'] = os.path.join(CONFIG['BASE_RAW'],CONFIG['DATE'])
CONFIG['OFFLINE_DIR'] = False
CONFIG['RED_DIR'] = os.path.join(CONFIG['BASE_RED_DIR'],CONFIG['DATE'])
......
......@@ -474,6 +474,7 @@ def UNe_calibrate(lamp,order,select_lines,all_lines,use_oliva=CONFIG['CAL_FUNC']
messages = []
#print order
calib_failed = False
# define gaussian function:
def gaussian(x,p,c,sg):
......@@ -710,7 +711,7 @@ def UNe_calibrate(lamp,order,select_lines,all_lines,use_oliva=CONFIG['CAL_FUNC']
if use_oliva:
#coeffs = OrderedDict({'k1':coeffk1,'k2':coeffk2,'k3':coeffk3,'l0':coeffl0,'xc':coeffxc0,'rms':coeffrms})
coeffs.update({'k1':coeffk1,'k2':coeffk2,'k3':coeffk3,'l0':coeffl0,'xc':coeffxc0,'rms':coeffrms})
calib_failed = False
#calib_failed = False
#calib = lambdafit(pixrange,lambda0,xc0)
#coeffs = OrderedDict({'k1':k1,'k2':k2,'k3':k3,'l0':lambda0,'xc':xc0,'rms':rvrmse.value})
......@@ -750,7 +751,8 @@ def UNe_calibrate(lamp,order,select_lines,all_lines,use_oliva=CONFIG['CAL_FUNC']
coeffc3 = fitpoly3[3]
coeffrms = round(rvrmse.value,2)
calib_failed = False
#calib_failed = False
#coeffs = OrderedDict({'c0':coeffc0,'c1':coeffc1,'c2':coeffc2,'c3':coeffc3,'rms':coeffrms})
coeffs.update({'c0':coeffc0,'c1':coeffc1,'c2':coeffc2,'c3':coeffc3,'rms_poly':coeffrms})
......
......@@ -18,7 +18,7 @@ Options:
--une : U-Ne lamps are reduced
--fp : FP lamps are reduced
--only_calib : only calibration are reduced, no science images
--use_flat=<flag> : flat-field is removed, options are global/order/nor [Default: order]
--use_flat=<flag> : flat-field is removed, options are global/order/nor/none [Default: order]
"""
......
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