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
adb75244
Commit
adb75244
authored
Oct 25, 2021
by
Xin Zhang
Browse files
fix cosmic ray bug -expTime, add output cr number
parent
844aa0ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
ObservationSim/Instrument/Chip/Chip.py
View file @
adb75244
...
...
@@ -355,10 +355,10 @@ class Chip(FocalPlane):
# Add cosmic-rays
if
config
[
"cosmic_ray"
].
lower
()
==
"y"
and
pointing_type
==
'MS'
:
print
(
" Adding Cosmic-Ray"
,
flush
=
True
)
cr_map
=
effects
.
produceCR_Map
(
cr_map
,
cr_event_num
=
effects
.
produceCR_Map
(
xLen
=
self
.
npix_x
,
yLen
=
self
.
npix_y
,
exTime
=
self
.
exptime
+
0.5
*
self
.
readout_time
,
cr_pixelRatio
=
0.003
*
(
1
+
0.5
*
self
.
readout_time
/
self
.
exptime
),
cr_pixelRatio
=
0.003
*
(
self
.
exptime
+
0.5
*
self
.
readout_time
)
/
150.
,
gain
=
self
.
gain
,
attachedSizes
=
self
.
attachedSizes
,
seed
=
SeedCosmicRay
+
pointing_ID
*
30
+
self
.
chipID
)
# seed: obj-imaging:+0; bias:+1; dark:+2; flat:+3;
...
...
@@ -469,7 +469,7 @@ class Chip(FocalPlane):
seed
=
SeedBiasNonuni
+
self
.
chipID
)
if
config
[
"cosmic_ray"
].
lower
()
==
"y"
:
if
config
[
"cray_differ"
].
lower
()
==
"y"
:
cr_map
=
effects
.
produceCR_Map
(
cr_map
,
cr_event_num
=
effects
.
produceCR_Map
(
xLen
=
self
.
npix_x
,
yLen
=
self
.
npix_y
,
exTime
=
0.01
,
cr_pixelRatio
=
0.003
*
(
0.01
+
0.5
*
self
.
readout_time
)
/
(
self
.
exptime
+
0.5
*
self
.
readout_time
),
...
...
@@ -541,7 +541,7 @@ class Chip(FocalPlane):
)
if
config
[
"cosmic_ray"
].
lower
()
==
"y"
:
if
config
[
"cray_differ"
].
lower
()
==
"y"
:
cr_map
=
effects
.
produceCR_Map
(
cr_map
,
cr_event_num
=
effects
.
produceCR_Map
(
xLen
=
self
.
npix_x
,
yLen
=
self
.
npix_y
,
exTime
=
self
.
flat_exptime
+
0.5
*
self
.
readout_time
,
cr_pixelRatio
=
0.003
*
(
self
.
flat_exptime
+
0.5
*
self
.
readout_time
)
/
(
self
.
exptime
+
0.5
*
self
.
readout_time
),
...
...
@@ -632,7 +632,7 @@ class Chip(FocalPlane):
gain
=
1
,
seed_bias
=
SeedBiasNonuni
+
self
.
chipID
)
if
config
[
"cosmic_ray"
].
lower
()
==
"y"
:
if
config
[
"cray_differ"
].
lower
()
==
"y"
:
cr_map
=
effects
.
produceCR_Map
(
cr_map
,
cr_event_num
=
effects
.
produceCR_Map
(
xLen
=
self
.
npix_x
,
yLen
=
self
.
npix_y
,
exTime
=
self
.
dark_exptime
+
0.5
*
self
.
readout_time
,
cr_pixelRatio
=
0.003
*
(
self
.
dark_exptime
+
0.5
*
self
.
readout_time
)
/
(
self
.
exptime
+
0.5
*
self
.
readout_time
),
...
...
ObservationSim/Instrument/Chip/Effects.py
View file @
adb75244
...
...
@@ -669,7 +669,7 @@ def produceCR_Map(xLen, yLen, exTime, cr_pixelRatio, gain, attachedSizes, seed=2
CRmap
[
sly
,
slx
]
+=
crMatrix_n
[
oky
,:][:,
okx
]
return
CRmap
.
astype
(
np
.
int32
)
;
return
CRmap
.
astype
(
np
.
int32
)
,
cr_event_size
def
ShutterEffectArr
(
GSImage
,
t_shutter
=
1.3
,
dist_bearing
=
735
,
dt
=
1E-3
):
...
...
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