Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_msc_sim
Commits
9a8229fa
You need to sign in or sign up before continuing.
Commit
9a8229fa
authored
Apr 13, 2024
by
Zhang Xin
Browse files
LED state and time write to Header; fix Header target key '+' error
parent
fcbac14e
Changes
5
Hide whitespace changes
Inline
Side-by-side
ObservationSim/Config/Header/ImageHeader.py
View file @
9a8229fa
...
@@ -419,7 +419,10 @@ def generatePrimaryHeader(xlen = 9216, ylen = 9232, pointing_id = '00000001', po
...
@@ -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'
)
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'
)
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['RA_NOM'] = ra_hms
# h_prim['DEC_NOM'] = dec_hms
# h_prim['DEC_NOM'] = dec_hms
...
...
ObservationSim/MockObject/FlatLED.py
View file @
9a8229fa
...
@@ -106,6 +106,11 @@ class FlatLED(object):
...
@@ -106,6 +106,11 @@ class FlatLED(object):
return
np
.
ones
([
self
.
chip
.
npix_y
,
self
.
chip
.
npix_x
])
return
np
.
ones
([
self
.
chip
.
npix_y
,
self
.
chip
.
npix_x
])
ledFlat
=
np
.
zeros
([
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
)):
for
i
in
np
.
arange
(
len
(
led_type_list
)):
led_type
=
led_type_list
[
i
]
led_type
=
led_type_list
[
i
]
exp_t
=
exp_t_list
[
i
]
exp_t
=
exp_t_list
[
i
]
...
@@ -126,7 +131,10 @@ class FlatLED(object):
...
@@ -126,7 +131,10 @@ class FlatLED(object):
unitFlatImg
=
unitFlatImg
*
t_spec
unitFlatImg
=
unitFlatImg
*
t_spec
# print("DEBUG1:---------------",np.mean(unitFlatImg))
# print("DEBUG1:---------------",np.mean(unitFlatImg))
ledFlat
=
ledFlat
+
unitFlatImg
*
exp_t
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
]):
def
drawObj_LEDFlat_slitless
(
self
,
led_type_list
=
[
'LED1'
],
exp_t_list
=
[
0.1
]):
if
len
(
led_type_list
)
!=
len
(
exp_t_list
):
if
len
(
led_type_list
)
!=
len
(
exp_t_list
):
...
@@ -154,8 +162,9 @@ class FlatLED(object):
...
@@ -154,8 +162,9 @@ class FlatLED(object):
flat_cube
=
self
.
chip
.
flat_cube
,
led_spec
=
led_spec
)
flat_cube
=
self
.
chip
.
flat_cube
,
led_spec
=
led_spec
)
ledFlat
=
ledFlat
+
ledspec_map
ledFlat
=
ledFlat
+
ledspec_map
ledStat
=
ledStat
[
0
:
int
(
led_type
[
3
:])
-
1
]
+
nledStat
+
ledStat
[
int
(
led_type
[
3
:]):]
return
ledFlat
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
]):
def
drawObj_LEDFlat
(
self
,
led_type_list
=
[
'LED1'
],
exp_t_list
=
[
0.1
]):
if
self
.
chip
.
survey_type
==
"photometric"
:
if
self
.
chip
.
survey_type
==
"photometric"
:
...
...
ObservationSim/sim_steps/add_LED_flat.py
View file @
9a8229fa
...
@@ -13,8 +13,10 @@ def add_LED_Flat(self, chip, filt, tel, pointing, catalog, obs_param):
...
@@ -13,8 +13,10 @@ def add_LED_Flat(self, chip, filt, tel, pointing, catalog, obs_param):
print
(
"LED OPEN--------"
)
print
(
"LED OPEN--------"
)
led_obj
=
FlatLED
(
chip
,
filt
)
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
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
:
if
obs_param
[
"shutter_effect"
]
==
True
:
pf_map
=
pf_map
*
chip
.
shutter_img
pf_map
=
pf_map
*
chip
.
shutter_img
...
...
config/obs_config_Calibration_BIAS.yaml
View file @
9a8229fa
...
@@ -61,7 +61,8 @@ call_sequence:
...
@@ -61,7 +61,8 @@ call_sequence:
# # Run CTE simulation
# # Run CTE simulation
CTE_effect
:
{}
CTE_effect
:
{}
# Add prescan and overscan
# Add prescan and overscan
prescan_overscan
:
{}
prescan_overscan
:
add_dark
:
YES
# Add bias
# Add bias
bias
:
bias
:
bias_16channel
:
YES
bias_16channel
:
YES
...
@@ -72,5 +73,5 @@ call_sequence:
...
@@ -72,5 +73,5 @@ call_sequence:
gain_16channel
:
YES
gain_16channel
:
YES
# Output the final image
# Output the final image
quantization_and_output
:
quantization_and_output
:
format_output
:
NO
format_output
:
YES
...
...
\ No newline at end of file
config/obs_config_Calibration_FLAT.yaml
View file @
9a8229fa
...
@@ -61,7 +61,8 @@ call_sequence:
...
@@ -61,7 +61,8 @@ call_sequence:
# # Run CTE simulation
# # Run CTE simulation
CTE_effect
:
{}
CTE_effect
:
{}
# Add prescan and overscan
# Add prescan and overscan
prescan_overscan
:
{}
prescan_overscan
:
add_dark
:
YES
# Add bias
# Add bias
bias
:
bias
:
bias_16channel
:
YES
bias_16channel
:
YES
...
@@ -72,5 +73,5 @@ call_sequence:
...
@@ -72,5 +73,5 @@ call_sequence:
gain_16channel
:
YES
gain_16channel
:
YES
# Output the final image
# Output the final image
quantization_and_output
:
quantization_and_output
:
format_output
:
NO
format_output
:
YES
...
...
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment