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_mci_sim
Commits
9bcac26c
Commit
9bcac26c
authored
Apr 14, 2024
by
Yan Zhaojun
Browse files
test
parent
0b0310c4
Pipeline
#4069
running with stage
in 0 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_mci_sim/csst_mci_sim.py
View file @
9bcac26c
...
...
@@ -3138,15 +3138,16 @@ class MCIsimulator():
For details, see the documentation for the cosmicrays class in the support package.
"""
self
.
readCosmicRayInformation
()
self
.
cr
[
'exptime'
]
=
self
.
information
[
'exptime'
]
#to scale the number of cosmics with exposure time
#cosmic ray image
crImage
=
np
.
zeros
((
self
.
information
[
'ysize'
],
self
.
information
[
'xsize'
]),
dtype
=
float
)
#cosmic ray instance
cosmics_g
=
cosmicrays
.
cosmicrays
(
self
.
log
,
crImage
,
crInfo
=
self
.
cr
)
cosmics_r
=
cosmicrays
.
cosmicrays
(
self
.
log
,
crImage
,
crInfo
=
self
.
cr
)
cosmics_i
=
cosmicrays
.
cosmicrays
(
self
.
log
,
crImage
,
crInfo
=
self
.
cr
)
cosmics_g
=
cosmicrays
.
cosmicrays
(
self
.
log
,
crImage
,
self
.
information
[
'exptime'
],
crInfo
=
self
.
cr
)
cosmics_r
=
cosmicrays
.
cosmicrays
(
self
.
log
,
crImage
,
self
.
information
[
'exptime'
],
crInfo
=
self
.
cr
)
cosmics_i
=
cosmicrays
.
cosmicrays
(
self
.
log
,
crImage
,
self
.
information
[
'exptime'
],
crInfo
=
self
.
cr
)
#add cosmic rays up to the covering fraction
#CCD_cr = cosmics.addUpToFraction(self.information['coveringFraction'], limit=None)
...
...
csst_mci_sim/mci_data/mci_all_9K.config
View file @
9bcac26c
...
...
@@ -14,22 +14,24 @@ prescan = 27
overscan
=
320
#charge trap information file
parallelTrapfile
=
MCI_inputdata
/
data
/
cdm_euclid_parallel
.
dat
serialTrapfile
=
MCI_inputdata
/
data
/
cdm_euclid_serial
.
dat
parallelTrapfile
=
MCI_inputData
/
data
/
cdm_euclid_parallel
.
dat
serialTrapfile
=
MCI_inputData
/
data
/
cdm_euclid_serial
.
dat
#cosmetic defects input file
cosmeticsFile_g
=
MCI_input
d
ata
/
data
/
Cosmetics_g
.
txt
cosmeticsFile_g
=
MCI_input
D
ata
/
data
/
Cosmetics_g
.
txt
cosmeticsFile_r
=
MCI_input
d
ata
/
data
/
Cosmetics_r
.
txt
cosmeticsFile_r
=
MCI_input
D
ata
/
data
/
Cosmetics_r
.
txt
cosmeticsFile_i
=
MCI_input
d
ata
/
data
/
Cosmetics_i
.
txt
cosmeticsFile_i
=
MCI_input
D
ata
/
data
/
Cosmetics_i
.
txt
###comicray information file
cosmicraylengths
=
MCI_input
d
ata
/
data
/
cdf_cr_length
.
dat
cosmicraylengths
=
MCI_input
D
ata
/
data
/
cdf_cr_length
.
dat
cosmicraydistance
=
MCI_input
d
ata
/
data
/
cdf_cr_total
.
dat
cosmicraydistance
=
MCI_input
D
ata
/
data
/
cdf_cr_total
.
dat
...
...
csst_mci_sim/support/cosmicrays.py
View file @
9bcac26c
...
...
@@ -31,7 +31,7 @@ class cosmicrays():
:param information: cosmic ray track information (file containing track length and energy information) and
exposure time.
"""
def
__init__
(
self
,
log
,
image
,
crInfo
=
None
,
information
=
None
):
def
__init__
(
self
,
log
,
image
,
exptime
,
crInfo
=
None
,
information
=
None
):
"""
Cosmic ray generation class. Can either draw events from distributions or
set the energy of the events to a constant.
...
...
@@ -43,6 +43,9 @@ class cosmicrays():
exposure time.
"""
#setup logger
self
.
exptime
=
exptime
self
.
log
=
log
#image and size
...
...
@@ -53,8 +56,8 @@ class cosmicrays():
# self.information = (dict(cosmicraylengths='/home/yan/csst-master/data/cdf_cr_length.dat',
# cosmicraydistance='/home/yan/csst-master/data/cdf_cr_total.dat',
# exptime=565))
if
information
is
not
None
:
self
.
information
.
update
(
information
)
#
if information is not None:
#
self.information.update(information)
if
crInfo
is
not
None
:
self
.
cr
=
crInfo
...
...
@@ -321,7 +324,7 @@ class cosmicrays():
self
.
cosmicrayMap
=
np
.
zeros
((
self
.
ysize
,
self
.
xsize
))
#how many events to draw at once, too large number leads to exceeding the covering fraction
cr_n
=
int
(
295
*
self
.
information
[
'
exptime
'
]
/
565.
*
coveringFraction
/
1.4
)
cr_n
=
int
(
295
*
self
.
exptime
/
565.
*
coveringFraction
/
1.4
)
covering
=
0.0
...
...
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