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
47e36fbb
Commit
47e36fbb
authored
Aug 01, 2024
by
Zhang Xin
Browse files
fix bug: close gain 16 channel: header not update gain value; sls slit bug
parent
edffea7b
Pipeline
#6510
passed with stage
in 0 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
observation_sim/mock_objects/Galaxy.py
View file @
47e36fbb
...
@@ -375,7 +375,7 @@ class Galaxy(MockObject):
...
@@ -375,7 +375,7 @@ class Galaxy(MockObject):
1
,
origin_star
[
1
]
+
galImg
.
array
.
shape
[
1
]
-
1
]
1
,
origin_star
[
1
]
+
galImg
.
array
.
shape
[
1
]
-
1
]
if
gal_origin
[
1
]
<
grating_split_pos_chip
<
gal_end
[
1
]:
if
gal_origin
[
1
]
<
grating_split_pos_chip
<
gal_end
[
1
]:
subSlitPos
=
int
(
grating_split_pos_chip
-
gal_origin
[
1
]
+
1
)
subSlitPos
=
int
(
grating_split_pos_chip
-
gal_origin
[
1
])
# part img disperse
# part img disperse
star_p1s
=
[]
star_p1s
=
[]
...
@@ -407,12 +407,12 @@ class Galaxy(MockObject):
...
@@ -407,12 +407,12 @@ class Galaxy(MockObject):
for
galImg
in
galImg_List
:
for
galImg
in
galImg_List
:
subImg_p2
=
galImg
.
array
[:,
subImg_p2
=
galImg
.
array
[:,
subSlitPos
+
1
:
galImg
.
array
.
shape
[
1
]]
subSlitPos
:
galImg
.
array
.
shape
[
1
]]
star_p2
=
galsim
.
Image
(
subImg_p2
)
star_p2
=
galsim
.
Image
(
subImg_p2
)
star_p2
.
setOrigin
(
0
,
0
)
star_p2
.
setOrigin
(
0
,
0
)
star_p2s
.
append
(
star_p2
)
star_p2s
.
append
(
star_p2
)
origin_p2
=
[
origin_star
[
0
],
grating_split_pos_chip
]
origin_p2
=
[
origin_star
[
0
],
grating_split_pos_chip
]
xcenter_p2
=
max
(
x_nominal
,
grating_split_pos_chip
-
1
)
-
0
xcenter_p2
=
max
(
x_nominal
,
grating_split_pos_chip
)
-
0
ycenter_p2
=
y_nominal
-
0
ycenter_p2
=
y_nominal
-
0
sdp_p2
=
SpecDisperser
(
orig_img
=
star_p2s
,
xcenter
=
xcenter_p2
,
sdp_p2
=
SpecDisperser
(
orig_img
=
star_p2s
,
xcenter
=
xcenter_p2
,
...
...
observation_sim/mock_objects/MockObject.py
View file @
47e36fbb
...
@@ -477,7 +477,7 @@ class MockObject(object):
...
@@ -477,7 +477,7 @@ class MockObject(object):
gal_end
=
[
origin_star
[
0
]
+
starImg
.
array
.
shape
[
0
]
-
gal_end
=
[
origin_star
[
0
]
+
starImg
.
array
.
shape
[
0
]
-
1
,
origin_star
[
1
]
+
starImg
.
array
.
shape
[
1
]
-
1
]
1
,
origin_star
[
1
]
+
starImg
.
array
.
shape
[
1
]
-
1
]
if
gal_origin
[
1
]
<
grating_split_pos_chip
<
gal_end
[
1
]:
if
gal_origin
[
1
]
<
grating_split_pos_chip
<
gal_end
[
1
]:
subSlitPos
=
int
(
grating_split_pos_chip
-
gal_origin
[
1
]
+
1
)
subSlitPos
=
int
(
grating_split_pos_chip
-
gal_origin
[
1
])
# part img disperse
# part img disperse
star_p1s
=
[]
star_p1s
=
[]
for
starImg
in
starImg_List
:
for
starImg
in
starImg_List
:
...
@@ -508,12 +508,12 @@ class MockObject(object):
...
@@ -508,12 +508,12 @@ class MockObject(object):
for
starImg
in
starImg_List
:
for
starImg
in
starImg_List
:
subImg_p2
=
starImg
.
array
[:,
subImg_p2
=
starImg
.
array
[:,
subSlitPos
+
1
:
starImg
.
array
.
shape
[
1
]]
subSlitPos
:
starImg
.
array
.
shape
[
1
]]
star_p2
=
galsim
.
Image
(
subImg_p2
)
star_p2
=
galsim
.
Image
(
subImg_p2
)
star_p2
.
setOrigin
(
0
,
0
)
star_p2
.
setOrigin
(
0
,
0
)
star_p2s
.
append
(
star_p2
)
star_p2s
.
append
(
star_p2
)
origin_p2
=
[
origin_star
[
0
],
grating_split_pos_chip
]
origin_p2
=
[
origin_star
[
0
],
grating_split_pos_chip
]
xcenter_p2
=
max
(
x_nominal
,
grating_split_pos_chip
-
1
)
-
0
xcenter_p2
=
max
(
x_nominal
,
grating_split_pos_chip
)
-
0
ycenter_p2
=
y_nominal
-
0
ycenter_p2
=
y_nominal
-
0
sdp_p2
=
SpecDisperser
(
orig_img
=
star_p2s
,
xcenter
=
xcenter_p2
,
sdp_p2
=
SpecDisperser
(
orig_img
=
star_p2s
,
xcenter
=
xcenter_p2
,
...
...
observation_sim/sim_steps/readout_output.py
View file @
47e36fbb
...
@@ -44,6 +44,7 @@ def apply_gain(self, chip, filt, tel, pointing, catalog, obs_param):
...
@@ -44,6 +44,7 @@ def apply_gain(self, chip, filt, tel, pointing, catalog, obs_param):
seed
=
self
.
overall_config
[
"random_seeds"
][
"seed_gainNonUniform"
]
+
chip
.
chipID
)
seed
=
self
.
overall_config
[
"random_seeds"
][
"seed_gainNonUniform"
]
+
chip
.
chipID
)
elif
obs_param
[
"gain_16channel"
]
==
False
:
elif
obs_param
[
"gain_16channel"
]
==
False
:
chip
.
img
/=
chip
.
gain
chip
.
img
/=
chip
.
gain
chip
.
gain_channel
=
np
.
ones
(
chip
.
nsecy
*
chip
.
nsecx
)
*
chip
.
gain
return
chip
,
filt
,
tel
,
pointing
return
chip
,
filt
,
tel
,
pointing
...
...
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