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_ifs_sim
Commits
62c408f8
Commit
62c408f8
authored
Jan 08, 2025
by
Yan Zhaojun
Browse files
update
parent
1aa0db48
Pipeline
#7735
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
csst_ifs_sim/csst_ifs_sim.py
View file @
62c408f8
...
...
@@ -356,7 +356,7 @@ class cosmicrays():
exposure time.
"""
def
__init__
(
self
,
log
,
image
,
exposuretime
,
crInfo
=
None
,
information
=
None
):
def
__init__
(
self
,
log
,
image
,
exposuretime
,
crInfo
=
None
,
information
=
None
):
"""
Cosmic ray generation class. Can either draw events from distributions or
set the energy of the events to a constant.
...
...
@@ -376,7 +376,7 @@ class cosmicrays():
# set up the information dictionary, first with defaults and then overwrite with inputs if given
self
.
information
=
(
dict
(
cosmicraylengths
=
'/home/yan/csst-master/data/cdf_cr_length.dat'
,
cosmicraydistance
=
'/home/yan/csst-master/data/cdf_cr_total.dat'
,
exptime
=
exposuretime
))
cosmicraydistance
=
'/home/yan/csst-master/data/cdf_cr_total.dat'
,
exptime
=
exposuretime
))
if
information
is
not
None
:
self
.
information
.
update
(
information
)
...
...
@@ -2157,76 +2157,76 @@ class IFSsimulator():
return
FlatMat
####################################################################
def
getFrameTransferImg
(
self
):
"""
Returns
-------
None.
"""
"""
get frame transfer image from original image of self.image_b and self.image_r
"""
overscan
=
320
self
.
frame_b_4
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_b_3
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_b_2
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_b_1
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_r_4
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
self
.
frame_r_3
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
self
.
frame_r_2
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
self
.
frame_r_1
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
# OSH, part2 ,no change
b_2
=
np
.
sum
(
self
.
image_b
[
0
:
1024
,
0
:
2048
],
axis
=
0
)
# flip right to left of part1
temp_b_1
=
np
.
fliplr
(
self
.
image_b
[
0
:
1024
,
2048
:
4096
])
# left to right
b_1
=
np
.
sum
(
temp_b_1
,
axis
=
0
)
# part 4, left to right and up to down
temp_b_4
=
np
.
fliplr
(
self
.
image_b
[
1024
:
1024
+
1024
,
2048
:
2048
+
2048
])
# left to right
b_4
=
np
.
sum
(
temp_b_4
,
axis
=
0
)
# part 3,OSE, up to dwon
b_3
=
np
.
sum
(
self
.
image_b
[
1024
:
1024
+
1024
,
0
:
2048
],
axis
=
0
)
####
for
k
in
range
(
1024
+
overscan
):
# part
self
.
frame_b_4
[
k
,
:]
+=
b_4
*
0.09216
/
self
.
information
[
'exptime'
]
self
.
frame_b_3
[
k
,
:]
+=
b_3
*
0.09216
/
self
.
information
[
'exptime'
]
self
.
frame_b_2
[
k
,
:]
+=
b_2
*
0.09216
/
self
.
information
[
'exptime'
]
self
.
frame_b_1
[
k
,
:]
+=
b_1
*
0.09216
/
self
.
information
[
'exptime'
]
###################
# red channle
# OSH, part2 ,no change
r_2
=
np
.
sum
(
self
.
image_r
[
0
:
1536
,
0
:
3072
],
axis
=
0
)
# # flip right to left of part1
temp_r_1
=
np
.
fliplr
(
self
.
image_r
[
0
:
1536
,
3072
:
6144
])
# left to right
r_1
=
np
.
sum
(
temp_r_1
,
axis
=
0
)
# part 4, left to right and up to down
temp_r_4
=
np
.
fliplr
(
self
.
image_r
[
1536
:
1536
+
1536
,
3072
:
6144
])
# left to right
r_4
=
np
.
sum
(
temp_r_4
,
axis
=
0
)
# part 3,OSE, up to dwon
r_3
=
np
.
sum
(
self
.
image_r
[
1536
:
1536
+
1536
,
0
:
3072
],
axis
=
0
)
for
k
in
range
(
1536
+
overscan
):
# part 4, OSH zone;
self
.
frame_r_4
[
k
,
:]
+=
r_4
*
0.13824
/
self
.
information
[
'exptime'
]
self
.
frame_r_3
[
k
,
:]
+=
r_3
*
0.13824
/
self
.
information
[
'exptime'
]
self
.
frame_r_2
[
k
,
:]
+=
r_2
*
0.13824
/
self
.
information
[
'exptime'
]
self
.
frame_r_1
[
k
,
:]
+=
r_1
*
0.13824
/
self
.
information
[
'exptime'
]
# end
def
getFrameTransferImg
(
self
):
"""
Returns
-------
None.
"""
"""
get frame transfer image from original image of self.image_b and self.image_r
"""
overscan
=
320
self
.
frame_b_4
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_b_3
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_b_2
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_b_1
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_r_4
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
self
.
frame_r_3
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
self
.
frame_r_2
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
self
.
frame_r_1
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
# OSH, part2 ,no change
b_2
=
np
.
sum
(
self
.
image_b
[
0
:
1024
,
0
:
2048
],
axis
=
0
)
# flip right to left of part1
temp_b_1
=
np
.
fliplr
(
self
.
image_b
[
0
:
1024
,
2048
:
4096
])
# left to right
b_1
=
np
.
sum
(
temp_b_1
,
axis
=
0
)
# part 4, left to right and up to down
temp_b_4
=
np
.
fliplr
(
self
.
image_b
[
1024
:
1024
+
1024
,
2048
:
2048
+
2048
])
# left to right
b_4
=
np
.
sum
(
temp_b_4
,
axis
=
0
)
# part 3,OSE, up to dwon
b_3
=
np
.
sum
(
self
.
image_b
[
1024
:
1024
+
1024
,
0
:
2048
],
axis
=
0
)
####
for
k
in
range
(
1024
+
overscan
):
# part
self
.
frame_b_4
[
k
,
:]
+=
b_4
*
0.09216
/
self
.
information
[
'exptime'
]
self
.
frame_b_3
[
k
,
:]
+=
b_3
*
0.09216
/
self
.
information
[
'exptime'
]
self
.
frame_b_2
[
k
,
:]
+=
b_2
*
0.09216
/
self
.
information
[
'exptime'
]
self
.
frame_b_1
[
k
,
:]
+=
b_1
*
0.09216
/
self
.
information
[
'exptime'
]
###################
# red channle
# OSH, part2 ,no change
r_2
=
np
.
sum
(
self
.
image_r
[
0
:
1536
,
0
:
3072
],
axis
=
0
)
# # flip right to left of part1
temp_r_1
=
np
.
fliplr
(
self
.
image_r
[
0
:
1536
,
3072
:
6144
])
# left to right
r_1
=
np
.
sum
(
temp_r_1
,
axis
=
0
)
# part 4, left to right and up to down
temp_r_4
=
np
.
fliplr
(
self
.
image_r
[
1536
:
1536
+
1536
,
3072
:
6144
])
# left to right
r_4
=
np
.
sum
(
temp_r_4
,
axis
=
0
)
# part 3,OSE, up to dwon
r_3
=
np
.
sum
(
self
.
image_r
[
1536
:
1536
+
1536
,
0
:
3072
],
axis
=
0
)
for
k
in
range
(
1536
+
overscan
):
# part 4, OSH zone;
self
.
frame_r_4
[
k
,
:]
+=
r_4
*
0.13824
/
self
.
information
[
'exptime'
]
self
.
frame_r_3
[
k
,
:]
+=
r_3
*
0.13824
/
self
.
information
[
'exptime'
]
self
.
frame_r_2
[
k
,
:]
+=
r_2
*
0.13824
/
self
.
information
[
'exptime'
]
self
.
frame_r_1
[
k
,
:]
+=
r_1
*
0.13824
/
self
.
information
[
'exptime'
]
# end
###############################################################################
def
applyflatfield
(
self
,
simnumber
):
...
...
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