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
Liu Dezi
csst_msc_sim
Commits
adb75244
Commit
adb75244
authored
3 years ago
by
Xin Zhang
Browse files
Options
Download
Email Patches
Plain Diff
fix cosmic ray bug -expTime, add output cr number
parent
844aa0ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ObservationSim/Instrument/Chip/Chip.py
+5
-5
ObservationSim/Instrument/Chip/Chip.py
ObservationSim/Instrument/Chip/Effects.py
+1
-1
ObservationSim/Instrument/Chip/Effects.py
with
6 additions
and
6 deletions
+6
-6
ObservationSim/Instrument/Chip/Chip.py
+
5
-
5
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
),
...
...
This diff is collapsed.
Click to expand it.
ObservationSim/Instrument/Chip/Effects.py
+
1
-
1
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
):
...
...
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