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_ifs_sim
Commits
07cc70ef
Commit
07cc70ef
authored
Jan 23, 2025
by
Yan Zhaojun
Browse files
update
parent
60009e75
Pipeline
#7864
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_ifs_sim/csst_ifs_sim.py
View file @
07cc70ef
...
@@ -2335,57 +2335,22 @@ class IFSsimulator():
...
@@ -2335,57 +2335,22 @@ class IFSsimulator():
"""
"""
self
.
log
.
info
(
'Added dark current to bule and red channel'
)
self
.
log
.
info
(
'Added dark current to bule and red channel'
)
checkV
=
(
self
.
information
[
'dark1_b'
]
<
0.0001
or
self
.
information
[
'dark1_b'
]
>
0.001
if
self
.
information
[
'dark1_b'
]
<
0.0001
or
self
.
information
[
'dark1_b'
]
>
0.001
:
or
self
.
information
[
'dark2_b'
]
<
0.0001
or
self
.
information
[
'dark2_b'
]
>
0.001
self
.
log
.
error
(
or
self
.
information
[
'dark3_b'
]
<
0.0001
or
self
.
information
[
'dark3_b'
]
>
0.001
'dark1_b value error, it shoub be in [0.0001, 0.001]!'
)
or
self
.
information
[
'dark4_b'
]
<
0.0001
or
self
.
information
[
'dark4_b'
]
>
0.001
raise
ValueError
(
or
self
.
information
[
'dark1_r'
]
<
0.0001
or
self
.
information
[
'dark1_r'
]
>
0.001
'dark1_b value error, it shoub be in [0.0001, 0.001]!'
)
or
self
.
information
[
'dark2_r'
]
<
0.0001
or
self
.
information
[
'dark2_r'
]
>
0.001
or
self
.
information
[
'dark3_r'
]
<
0.0001
or
self
.
information
[
'dark3_r'
]
>
0.001
if
self
.
information
[
'dark2_b'
]
<
0.0001
or
self
.
information
[
'dark2_b'
]
>
0.001
:
or
self
.
information
[
'dark4_r'
]
<
0.0001
or
self
.
information
[
'dark4_r'
]
>
0.001
)
self
.
log
.
error
(
'dark2_b value error, it shoub be in [0.0001, 0.001]!'
)
if
checkV
:
raise
ValueError
(
'dark2_b value error, it shoub be in [0.0001, 0.001]!'
)
if
self
.
information
[
'dark3_b'
]
<
0.0001
or
self
.
information
[
'dark3_b'
]
>
0.001
:
self
.
log
.
error
(
'dark3_b value error, it shoub be in [0.0001, 0.001]!'
)
raise
ValueError
(
'dark3_b value error, it shoub be in [0.0001, 0.001]!'
)
if
self
.
information
[
'dark4_b'
]
<
0.0001
or
self
.
information
[
'dark4_b'
]
>
0.001
:
self
.
log
.
error
(
'dark4_b value error, it shoub be in [0.0001, 0.001]!'
)
raise
ValueError
(
'dark4_b value error, it shoub be in [0.0001, 0.001]!'
)
####################################################################
if
self
.
information
[
'dark1_r'
]
<
0.0001
or
self
.
information
[
'dark1_r'
]
>
0.001
:
self
.
log
.
error
(
'dark1_r value error, it shoub be in [0.0001, 0.001]!'
)
raise
ValueError
(
'dark1_r value error, it shoub be in [0.0001, 0.001]!'
)
if
self
.
information
[
'dark2_r'
]
<
0.0001
or
self
.
information
[
'dark2_r'
]
>
0.001
:
self
.
log
.
error
(
self
.
log
.
error
(
'dark
2_r
value error, it shoub be in [0.0001, 0.001]!'
)
'dark value error, it shoub be in [0.0001, 0.001]!'
)
raise
ValueError
(
raise
ValueError
(
'dark
2_r
value error, it shoub be in [0.0001, 0.001]!'
)
'dark value error, it shoub be in [0.0001, 0.001]!'
)
if
self
.
information
[
'dark3_r'
]
<
0.0001
or
self
.
information
[
'dark3_r'
]
>
0.001
:
self
.
log
.
error
(
'dark3_r value error, it shoub be in [0.0001, 0.001]!'
)
raise
ValueError
(
'dark3_r value error, it shoub be in [0.0001, 0.001]!'
)
if
self
.
information
[
'dark4_r'
]
<
0.0001
or
self
.
information
[
'dark4_r'
]
>
0.001
:
self
.
log
.
error
(
'dark4_r value error, it shoub be in [0.0001, 0.001]!'
)
raise
ValueError
(
'dark4_r value error, it shoub be in [0.0001, 0.001]!'
)
# #################################################################
# #################################################################
# blue zone 4
# blue zone 4
self
.
image_b
[
0
:
1024
,
0
:
2048
]
+=
self
.
information
[
'exptime'
]
*
\
self
.
image_b
[
0
:
1024
,
0
:
2048
]
+=
self
.
information
[
'exptime'
]
*
\
self
.
information
[
'dark2_b'
]
self
.
information
[
'dark2_b'
]
...
@@ -2616,56 +2581,20 @@ class IFSsimulator():
...
@@ -2616,56 +2581,20 @@ class IFSsimulator():
average=0.0 and std=readout noise.
average=0.0 and std=readout noise.
"""
"""
self
.
log
.
info
(
'readnoise added in blue channel'
)
self
.
log
.
info
(
'readnoise added in blue channel'
)
checkV
=
(
self
.
information
[
'rn1_b'
]
>
10
or
self
.
information
[
'rn1_b'
]
<
3
if
self
.
information
[
'rn1_b'
]
>
10
or
self
.
information
[
'rn1_b'
]
<
3
:
or
self
.
information
[
'rn2_b'
]
>
10
or
self
.
information
[
'rn2_b'
]
<
3
self
.
log
.
error
(
or
self
.
information
[
'rn3_b'
]
>
10
or
self
.
information
[
'rn3_b'
]
<
3
'rn1_b value error, it shoub be in [3, 10]!'
)
or
self
.
information
[
'rn4_b'
]
>
10
or
self
.
information
[
'rn4_b'
]
<
3
raise
ValueError
(
or
self
.
information
[
'rn1_r'
]
>
10
or
self
.
information
[
'rn1_r'
]
<
3
'rn1_b value error, it shoub be in [3, 10]!'
)
or
self
.
information
[
'rn2_r'
]
>
10
or
self
.
information
[
'rn2_r'
]
<
3
or
self
.
information
[
'rn3_r'
]
>
10
or
self
.
information
[
'rn3_r'
]
<
3
if
self
.
information
[
'rn2_b'
]
>
10
or
self
.
information
[
'rn2_b'
]
<
3
:
or
self
.
information
[
'rn4_r'
]
>
10
or
self
.
information
[
'rn4_r'
]
<
3
)
self
.
log
.
error
(
'rn2_b value error, it shoub be in [3, 10]!'
)
if
checkV
:
raise
ValueError
(
'rn2_b value error, it shoub be in [3, 10]!'
)
if
self
.
information
[
'rn3_b'
]
>
10
or
self
.
information
[
'rn3_b'
]
<
3
:
self
.
log
.
error
(
'rn3_b value error, it shoub be in [3, 10]!'
)
raise
ValueError
(
'rn3_b value error, it shoub be in [3, 10]!'
)
if
self
.
information
[
'rn4_b'
]
>
10
or
self
.
information
[
'rn4_b'
]
<
3
:
self
.
log
.
error
(
'rn4_b value error, it shoub be in [3, 10]!'
)
raise
ValueError
(
'rn4_b value error, it shoub be in [3, 10]!'
)
####################################################################
if
self
.
information
[
'rn1_r'
]
>
10
or
self
.
information
[
'rn1_r'
]
<
3
:
self
.
log
.
error
(
'rn1_r value error, it shoub be in [3, 10]!'
)
raise
ValueError
(
'rn1_r value error, it shoub be in [3, 10]!'
)
if
self
.
information
[
'rn2_r'
]
>
10
or
self
.
information
[
'rn2_r'
]
<
3
:
self
.
log
.
error
(
'rn2_r value error, it shoub be in [3, 10]!'
)
raise
ValueError
(
'rn2_r value error, it shoub be in [3, 10]!'
)
if
self
.
information
[
'rn3_r'
]
>
10
or
self
.
information
[
'rn3_r'
]
<
3
:
self
.
log
.
error
(
'rn3_r value error, it shoub be in [3, 10]!'
)
raise
ValueError
(
'rn3_r value error, it shoub be in [3, 10]!'
)
if
self
.
information
[
'rn4_r'
]
>
10
or
self
.
information
[
'rn4_r'
]
<
3
:
self
.
log
.
error
(
self
.
log
.
error
(
'rn
4_r
value error, it shoub be in [3, 10]!'
)
'rn value error, it shoub be in [3, 10]!'
)
raise
ValueError
(
raise
ValueError
(
'rn4_r value error, it shoub be in [3, 10]!'
)
'rn value error, it shoub be in [3, 10]!'
)
# 33
# blue zone 1
# blue zone 1
np
.
random
.
seed
()
np
.
random
.
seed
()
...
@@ -2785,53 +2714,20 @@ class IFSsimulator():
...
@@ -2785,53 +2714,20 @@ class IFSsimulator():
"""
"""
Convert from electrons to ADUs using the value read from the configuration file.
Convert from electrons to ADUs using the value read from the configuration file.
"""
"""
if
self
.
information
[
'gain1_b'
]
>
2
or
self
.
information
[
'gain1_b'
]
<
1
:
checkV
=
(
self
.
information
[
'gain1_b'
]
>
2
or
self
.
information
[
'gain1_b'
]
<
1
self
.
log
.
error
(
or
self
.
information
[
'gain2_b'
]
>
2
or
self
.
information
[
'gain2_b'
]
<
1
'gain1_b value error, it shoub be in [1, 2]!'
)
or
self
.
information
[
'gain3_b'
]
>
2
or
self
.
information
[
'gain3_b'
]
<
1
raise
ValueError
(
or
self
.
information
[
'gain4_b'
]
>
2
or
self
.
information
[
'gain4_b'
]
<
1
'gain1_b value error, it shoub be in [1, 2]!'
)
or
self
.
information
[
'gain1_r'
]
>
2
or
self
.
information
[
'gain1_r'
]
<
1
or
self
.
information
[
'gain2_r'
]
>
2
or
self
.
information
[
'gain2_r'
]
<
1
if
self
.
information
[
'gain2_b'
]
>
2
or
self
.
information
[
'gain2_b'
]
<
1
:
or
self
.
information
[
'gain3_r'
]
>
2
or
self
.
information
[
'gain3_r'
]
<
1
self
.
log
.
error
(
or
self
.
information
[
'gain4_r'
]
>
2
or
self
.
information
[
'gain4_r'
]
<
1
)
'gain2_b value error, it shoub be in [1, 2]!'
)
raise
ValueError
(
'gain2_b value error, it shoub be in [1, 2]!'
)
if
self
.
information
[
'gain3_b'
]
>
2
or
self
.
information
[
'gain3_b'
]
<
1
:
self
.
log
.
error
(
'gain3_b value error, it shoub be in [1, 2]!'
)
raise
ValueError
(
'gain3_b value error, it shoub be in [1, 2]!'
)
if
self
.
information
[
'gain4_b'
]
>
2
or
self
.
information
[
'gain4_b'
]
<
1
:
self
.
log
.
error
(
'gain4_b value error, it shoub be in [1, 2]!'
)
raise
ValueError
(
'gain4_b value error, it shoub be in [1, 2]!'
)
####################################################################
if
self
.
information
[
'gain1_r'
]
>
2
or
self
.
information
[
'gain1_r'
]
<
1
:
self
.
log
.
error
(
'gain1_r value error, it shoub be in [1, 2]!'
)
raise
ValueError
(
'gain1_r value error, it shoub be in [1, 2]!'
)
if
self
.
information
[
'gain2_r'
]
>
2
or
self
.
information
[
'gain2_r'
]
<
1
:
if
checkV
:
self
.
log
.
error
(
self
.
log
.
error
(
'gain
2_r
value error, it shoub be in [1, 2]!'
)
'gain value error, it shoub be in [1, 2]!'
)
raise
ValueError
(
raise
ValueError
(
'gain2_r value error, it shoub be in [1, 2]!'
)
'gain value error, it shoub be in [1, 2]!'
)
if
self
.
information
[
'gain3_r'
]
>
2
or
self
.
information
[
'gain3_r'
]
<
1
:
self
.
log
.
error
(
'gain3_r value error, it shoub be in [1, 2]!'
)
raise
ValueError
(
'gain3_r value error, it shoub be in [1, 2]!'
)
if
self
.
information
[
'gain4_r'
]
>
2
or
self
.
information
[
'gain4_r'
]
<
1
:
self
.
log
.
error
(
'gain4_r value error, it shoub be in [1, 2]!'
)
raise
ValueError
(
'gain4_r value error, it shoub be in [1, 2]!'
)
####################################################################
####################################################################
self
.
log
.
info
(
self
.
log
.
info
(
...
@@ -2896,55 +2792,20 @@ class IFSsimulator():
...
@@ -2896,55 +2792,20 @@ class IFSsimulator():
in the information dictionary (key bias).
in the information dictionary (key bias).
#
#
"""
"""
checkV
=
(
self
.
information
[
'bias1_b'
]
>
2000
or
self
.
information
[
'bias1_b'
]
<
100
or
self
.
information
[
'bias2_b'
]
>
2000
or
self
.
information
[
'bias2_b'
]
<
100
or
self
.
information
[
'bias3_b'
]
>
2000
or
self
.
information
[
'bias3_b'
]
<
100
or
self
.
information
[
'bias4_b'
]
>
2000
or
self
.
information
[
'bias4_b'
]
<
100
or
self
.
information
[
'bias1_r'
]
>
2000
or
self
.
information
[
'bias1_r'
]
<
100
or
self
.
information
[
'bias2_r'
]
>
2000
or
self
.
information
[
'bias2_r'
]
<
100
or
self
.
information
[
'bias3_r'
]
>
2000
or
self
.
information
[
'bias3_r'
]
<
100
or
self
.
information
[
'bias4_r'
]
>
2000
or
self
.
information
[
'bias4_r'
]
<
100
if
self
.
information
[
'bias1_b'
]
>
2000
or
self
.
information
[
'bias1_b'
]
<
100
:
if
checkV
:
self
.
log
.
error
(
'bias1_b value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
'bias1_b value error, it shoub be in [100, 2000]!'
)
if
self
.
information
[
'bias2_b'
]
>
2000
or
self
.
information
[
'bias2_b'
]
<
100
:
self
.
log
.
error
(
'bias2_b value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
'bias2_b value error, it shoub be in [100, 2000]!'
)
if
self
.
information
[
'bias3_b'
]
>
2000
or
self
.
information
[
'bias3_b'
]
<
100
:
self
.
log
.
error
(
'bias3_b value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
'bias3_b value error, it shoub be in [100, 2000]!'
)
if
self
.
information
[
'bias4_b'
]
>
2000
or
self
.
information
[
'bias4_b'
]
<
100
:
self
.
log
.
error
(
'bias4_b value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
'bias4_b value error, it shoub be in [100, 2000]!'
)
####################################################################
if
self
.
information
[
'bias1_r'
]
>
2000
or
self
.
information
[
'bias1_r'
]
<
100
:
self
.
log
.
error
(
'bias1_r value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
'bias1_r value error, it shoub be in [100, 2000]!'
)
if
self
.
information
[
'bias2_r'
]
>
2000
or
self
.
information
[
'bias2_r'
]
<
100
:
self
.
log
.
error
(
'bias2_r value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
'bias2_r value error, it shoub be in [100, 2000]!'
)
if
self
.
information
[
'bias3_r'
]
>
2000
or
self
.
information
[
'bias3_r'
]
<
100
:
self
.
log
.
error
(
'bias3_r value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
'bias3_r value error, it shoub be in [100, 2000]!'
)
if
self
.
information
[
'bias4_r'
]
>
2000
or
self
.
information
[
'bias4_r'
]
<
100
:
self
.
log
.
error
(
self
.
log
.
error
(
'bias
4_r
value error, it shoub be in [100, 2000]!'
)
'bias value error, it shoub be in [100, 2000]!'
)
raise
ValueError
(
raise
ValueError
(
'bias
4_r
value error, it shoub be in [100, 2000]!'
)
'bias value error, it shoub be in [100, 2000]!'
)
########################################################################
########################################################################
...
...
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