Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Liu Dezi
csst_msc_sim
Commits
be11dd52
Commit
be11dd52
authored
2 years ago
by
Fang Yuedong
Browse files
Options
Download
Plain Diff
Merge branch 'master' of
ssh://119.78.210.97:31415/data/simudata/CSSOSDataProductsSims/codes/CSST
parents
4e616043
be7e7bbc
release_v2.0
11-csst
29-darktime-exptime-shtopen-shtstat-t
C6_codes
current_stable_for_tests
develop
fitsStamp
liudezi-develop-patch-58263
master
new_sim
new_sim_sls
release_v1.0
sim_scheduler
sls_rot_wcs
staylight_header
wcs_test
wcs_test_gridGalaxy
v2.1.0
v2.0.0
v1.0.5
v1.0.4
v1.0.3
v1.0.2
internal_test_20240425
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ObservationSim/Instrument/Chip/Chip.py
+19
-6
ObservationSim/Instrument/Chip/Chip.py
setup.py
+1
-1
setup.py
with
20 additions
and
7 deletions
+20
-7
ObservationSim/Instrument/Chip/Chip.py
+
19
-
6
View file @
be11dd52
...
...
@@ -316,9 +316,22 @@ class Chip(FocalPlane):
BoolDeadPix
=
False
self
.
logger
=
logger
# Get Poisson noise generator
seed
=
int
(
config
[
"random_seeds"
][
"seed_poisson"
])
+
pointing_ID
*
30
+
self
.
chipID
rng_poisson
=
galsim
.
BaseDeviate
(
seed
)
poisson_noise
=
galsim
.
PoissonNoise
(
rng_poisson
,
sky_level
=
0.
)
# Add sky background
if
sky_map
is
None
:
sky_map
=
filt
.
getSkyNoise
(
exptime
=
self
.
exptime
)
sky_map
=
sky_map
*
np
.
ones_like
(
img
.
array
)
sky_map
=
galsim
.
Image
(
array
=
sky_map
)
# Apply Poisson noise to the sky map
# (NOTE): only for photometric chips
# since it utilize the photon shooting
# to draw stamps
if
self
.
survey_type
==
"photometric"
:
sky_map
.
addNoise
(
poisson_noise
)
elif
img
.
array
.
shape
!=
sky_map
.
shape
:
raise
ValueError
(
"The shape img and sky_map must be equal."
)
elif
tel
is
not
None
:
# If sky_map is given in flux
...
...
@@ -361,10 +374,10 @@ class Chip(FocalPlane):
del
shutt_gsimg
del
shuttimg
# Add Poisson noise
seed
=
int
(
config
[
"random_seeds"
][
"seed_poisson"
])
+
pointing_ID
*
30
+
self
.
chipID
rng_poisson
=
galsim
.
BaseDeviate
(
seed
)
poisson_noise
=
galsim
.
PoissonNoise
(
rng_poisson
,
sky_level
=
0.
)
# Add Poisson noise
to the resulting images
# (NOTE): this can only applied to the slitless image
# since it dose not use photon shooting to draw stamps
if
self
.
survey_type
==
"spectroscopic"
:
img
.
addNoise
(
poisson_noise
)
# Add cosmic-rays
...
...
@@ -580,7 +593,7 @@ class Chip(FocalPlane):
if
config
[
"ins_effects"
][
"add_bias"
]
==
True
:
biaslevel
=
self
.
bias_level
overscan
=
biaslevel
-
2
elif
config
[
"ins_effects"
][
"add_bias"
]
==
Tru
e
:
elif
config
[
"ins_effects"
][
"add_bias"
]
==
Fals
e
:
biaslevel
=
0
overscan
=
0
darklevel
=
self
.
dark_noise
*
(
self
.
flat_exptime
+
0.5
*
self
.
readout_time
)
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
-
1
View file @
be11dd52
...
...
@@ -26,7 +26,7 @@ extensions = [
setup
(
name
=
'CSSTSim'
,
version
=
'0.5.
1
'
,
version
=
'0.5.
2
'
,
packages
=
find_packages
(),
# install_requires=[
# 'numpy>=1.18.5',
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets