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
44ecd0f9
Commit
44ecd0f9
authored
Jun 27, 2025
by
Zhang Xin
Browse files
add get LED img tool
parent
acc35c4b
Pipeline
#9032
passed with stage
in 0 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
tools/get_LED_Img.py
0 → 100644
View file @
44ecd0f9
import
numpy
as
np
from
observation_sim.instruments
import
Chip
,
Filter
,
FilterParam
import
astropy.io.fits
as
fits
from
observation_sim.mock_objects
import
FlatLED
# 输入打开的LED名字列表led_type_list和对应的打开时间列表exp_t_list
def
get_LED_Img
(
chipID
=
8
,
led_type_list
=
[
'LED1'
],
exp_t_list
=
[
0.1
]):
chip
=
Chip
(
chipID
)
filter_id
,
filter_type
=
chip
.
getChipFilter
()
filt
=
Filter
(
filter_id
=
filter_id
,
filter_type
=
filter_type
,
filter_param
=
FilterParam
())
led_obj
=
FlatLED
(
chip
,
filt
)
led_flat
,
ledstat
,
letts
=
led_obj
.
drawObj_LEDFlat
(
led_type_list
=
led_type_list
,
exp_t_list
=
exp_t_list
)
return
led_flat
if
__name__
==
"__main__"
:
chipid
=
7
led_type_list
=
[
'LED5'
,
'LED6'
,
'LED7'
,
'LED8'
]
exp_t_list
=
[
0.1
,
8
,
9
,
10
]
led_img
=
get_LED_Img
(
chipID
=
chipid
,
led_type_list
=
led_type_list
,
exp_t_list
=
exp_t_list
)
fits
.
writeto
(
'test_led.fits'
,
led_img
)
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