Commit 9a8229fa authored by Zhang Xin's avatar Zhang Xin
Browse files

LED state and time write to Header; fix Header target key '+' error

parent fcbac14e
......@@ -419,7 +419,10 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointing_id = '00000001', po
ra_hms = format(co.ra.hms.h, '02.0f') + format(co.ra.hms.m, '02.0f') + format(co.ra.hms.s, '02.1f')
dec_hms = format(co.dec.dms.d, '02.0f') + format(abs(co.dec.dms.m), '02.0f') + format(abs(co.dec.dms.s), '02.0f')
h_prim['TARGET'] = ra_hms + '+' + dec_hms
if dec > 0:
h_prim['TARGET'] = ra_hms + '+' + dec_hms
else:
h_prim['TARGET'] = ra_hms + dec_hms
#
# h_prim['RA_NOM'] = ra_hms
# h_prim['DEC_NOM'] = dec_hms
......
......@@ -106,6 +106,11 @@ class FlatLED(object):
return np.ones([self.chip.npix_y,self.chip.npix_x])
ledFlat = np.zeros([self.chip.npix_y,self.chip.npix_x])
ledStat = '00000000000000'
ledTimes = [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
nledStat = '2'
for i in np.arange(len(led_type_list)):
led_type = led_type_list[i]
exp_t = exp_t_list[i]
......@@ -126,7 +131,10 @@ class FlatLED(object):
unitFlatImg = unitFlatImg * t_spec
# print("DEBUG1:---------------",np.mean(unitFlatImg))
ledFlat = ledFlat+unitFlatImg*exp_t
return ledFlat
ledStat = ledStat[0:int(led_type[3:])-1]+nledStat+ledStat[int(led_type[3:]):]
ledTimes[int(led_type[3:])-1] = exp_t * 1000
return ledFlat, ledStat, ledTimes
def drawObj_LEDFlat_slitless(self, led_type_list=['LED1'], exp_t_list=[0.1]):
if len(led_type_list) != len(exp_t_list):
......@@ -154,8 +162,9 @@ class FlatLED(object):
flat_cube=self.chip.flat_cube, led_spec=led_spec)
ledFlat = ledFlat + ledspec_map
return ledFlat
ledStat = ledStat[0:int(led_type[3:])-1]+nledStat+ledStat[int(led_type[3:]):]
ledTimes[int(led_type[3:])-1] = exp_t * 1000
return ledFlat, ledStat, ledTimes
def drawObj_LEDFlat(self, led_type_list=['LED1'], exp_t_list=[0.1]):
if self.chip.survey_type == "photometric":
......
......@@ -13,8 +13,10 @@ def add_LED_Flat(self, chip, filt, tel, pointing, catalog, obs_param):
print("LED OPEN--------")
led_obj = FlatLED(chip, filt)
led_flat = led_obj.drawObj_LEDFlat(led_type_list=obs_param["LED_TYPE"], exp_t_list=obs_param["LED_TIME"])
led_flat, ledstat, letts = led_obj.drawObj_LEDFlat(led_type_list=obs_param["LED_TYPE"], exp_t_list=obs_param["LED_TIME"])
pf_map = led_flat
self.updateHeaderInfo(header_flag='ext', keys = ['LEDSTAT'], values = [ledstat])
self.updateHeaderInfo(header_flag='ext', keys = ['LEDT01','LEDT02','LEDT03','LEDT04','LEDT05','LEDT06','LEDT07','LEDT08','LEDT09','LEDT10','LEDT11','LEDT12','LEDT13','LEDT14'], values = letts)
if obs_param["shutter_effect"] == True:
pf_map = pf_map * chip.shutter_img
......
......@@ -61,7 +61,8 @@ call_sequence:
# # Run CTE simulation
CTE_effect: {}
# Add prescan and overscan
prescan_overscan: {}
prescan_overscan:
add_dark: YES
# Add bias
bias:
bias_16channel: YES
......@@ -72,5 +73,5 @@ call_sequence:
gain_16channel: YES
# Output the final image
quantization_and_output:
format_output: NO
format_output: YES
...
\ No newline at end of file
......@@ -61,7 +61,8 @@ call_sequence:
# # Run CTE simulation
CTE_effect: {}
# Add prescan and overscan
prescan_overscan: {}
prescan_overscan:
add_dark: YES
# Add bias
bias:
bias_16channel: YES
......@@ -72,5 +73,5 @@ call_sequence:
gain_16channel: YES
# Output the final image
quantization_and_output:
format_output: NO
format_output: YES
...
\ No newline at end of file
Supports Markdown
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