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
b823a7e2
Commit
b823a7e2
authored
Jan 08, 2025
by
Yan Zhaojun
Browse files
update
parent
62c408f8
Pipeline
#7736
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 @
b823a7e2
...
@@ -2159,67 +2159,63 @@ class IFSsimulator():
...
@@ -2159,67 +2159,63 @@ class IFSsimulator():
def
getFrameTransferImg
(
self
):
def
getFrameTransferImg
(
self
):
"""
"""
Returns
Returns
-------
-------
None.
None.
"""
"""
"""
"""
get frame transfer image from original image of self.image_b and self.image_r
get frame transfer image from original image of self.image_b and self.image_r
"""
"""
overscan
=
320
overscan
=
320
self
.
frame_b_4
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
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_3
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_b_2
=
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_b_1
=
np
.
zeros
((
1024
+
overscan
,
2048
),
dtype
=
float
)
self
.
frame_r_4
=
np
.
zeros
((
1536
+
overscan
,
3072
),
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_3
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
self
.
frame_r_2
=
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
)
self
.
frame_r_1
=
np
.
zeros
((
1536
+
overscan
,
3072
),
dtype
=
float
)
# OSH, part2 ,no change
# OSH, part2 ,no change
b_2
=
np
.
sum
(
self
.
image_b
[
0
:
1024
,
0
:
2048
],
axis
=
0
)
b_2
=
np
.
sum
(
self
.
image_b
[
0
:
1024
,
0
:
2048
],
axis
=
0
)
# flip right to left of part1
# flip right to left of part1
temp_b_1
=
np
.
fliplr
(
self
.
image_b
[
0
:
1024
,
2048
:
4096
])
# left to right
temp_b_1
=
np
.
fliplr
(
self
.
image_b
[
0
:
1024
,
2048
:
4096
])
# left to right
b_1
=
np
.
sum
(
temp_b_1
,
axis
=
0
)
b_1
=
np
.
sum
(
temp_b_1
,
axis
=
0
)
# part 4, left to right and up to down
# part 4, left to right and up to down
temp_b_4
=
np
.
fliplr
(
temp_b_4
=
np
.
fliplr
(
self
.
image_b
[
1024
:
1024
+
1024
,
2048
:
2048
+
2048
])
# left to right
self
.
image_b
[
1024
:
1024
+
1024
,
2048
:
2048
+
2048
])
# left to right
b_4
=
np
.
sum
(
temp_b_4
,
axis
=
0
)
b_4
=
np
.
sum
(
temp_b_4
,
axis
=
0
)
# part 3,OSE, up to dwon
# part 3,OSE, up to dwon
b_3
=
np
.
sum
(
self
.
image_b
[
1024
:
1024
+
1024
,
0
:
2048
],
axis
=
0
)
b_3
=
np
.
sum
(
self
.
image_b
[
1024
:
1024
+
1024
,
0
:
2048
],
axis
=
0
)
####
####
for
k
in
range
(
1024
+
overscan
):
for
k
in
range
(
1024
+
overscan
):
# part
# part
self
.
frame_b_4
[
k
,
:]
+=
b_4
*
0.09216
/
self
.
information
[
'exptime'
]
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_3
[
k
,
:]
+=
b_3
*
0.09216
/
self
.
information
[
'exptime'
]
self
.
frame_b_2
[
k
,
:]
+=
b_2
*
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'
]
self
.
frame_b_1
[
k
,
:]
+=
b_1
*
0.09216
/
self
.
information
[
'exptime'
]
###################
###################
# red channle
# red channle
# OSH, part2 ,no change
# OSH, part2 ,no change
r_2
=
np
.
sum
(
self
.
image_r
[
0
:
1536
,
0
:
3072
],
axis
=
0
)
r_2
=
np
.
sum
(
self
.
image_r
[
0
:
1536
,
0
:
3072
],
axis
=
0
)
# # flip right to left of part1
# # flip right to left of part1
temp_r_1
=
np
.
fliplr
(
self
.
image_r
[
0
:
1536
,
3072
:
6144
])
# left to right
temp_r_1
=
np
.
fliplr
(
self
.
image_r
[
0
:
1536
,
3072
:
6144
])
# left to right
r_1
=
np
.
sum
(
temp_r_1
,
axis
=
0
)
r_1
=
np
.
sum
(
temp_r_1
,
axis
=
0
)
# part 4, left to right and up to down
# part 4, left to right and up to down
temp_r_4
=
np
.
fliplr
(
temp_r_4
=
np
.
fliplr
(
self
.
image_r
[
1536
:
1536
+
1536
,
3072
:
6144
])
# left to right
self
.
image_r
[
1536
:
1536
+
1536
,
3072
:
6144
])
# left to right
r_4
=
np
.
sum
(
temp_r_4
,
axis
=
0
)
r_4
=
np
.
sum
(
temp_r_4
,
axis
=
0
)
# part 3,OSE, up to dwon
# part 3,OSE, up to dwon
r_3
=
np
.
sum
(
self
.
image_r
[
1536
:
1536
+
1536
,
0
:
3072
],
axis
=
0
)
r_3
=
np
.
sum
(
self
.
image_r
[
1536
:
1536
+
1536
,
0
:
3072
],
axis
=
0
)
for
k
in
range
(
1536
+
overscan
):
for
k
in
range
(
1536
+
overscan
):
# part 4, OSH zone;
# part 4, OSH zone;
self
.
frame_r_4
[
k
,
:]
+=
r_4
*
0.13824
/
self
.
information
[
'exptime'
]
self
.
frame_r_4
[
k
,
:]
+=
r_4
*
0.13824
/
self
.
information
[
'exptime'
]
...
@@ -2715,7 +2711,7 @@ class IFSsimulator():
...
@@ -2715,7 +2711,7 @@ class IFSsimulator():
self
.
image_r
[
0
:
1536
+
overscan
,
3442
*
3
:
3442
*
3
+
3072
+
prescan
+
overscan
]
+=
np
.
random
.
normal
(
self
.
image_r
[
0
:
1536
+
overscan
,
3442
*
3
:
3442
*
3
+
3072
+
prescan
+
overscan
]
+=
np
.
random
.
normal
(
loc
=
0.0
,
scale
=
self
.
information
[
'rn4_r'
],
size
=
(
1856
,
3442
))
loc
=
0.0
,
scale
=
self
.
information
[
'rn4_r'
],
size
=
(
1856
,
3442
))
##############################################################################
############
##############################################################################
def
appFrameTransferEffect
(
self
):
def
appFrameTransferEffect
(
self
):
"""
"""
...
@@ -2736,17 +2732,17 @@ class IFSsimulator():
...
@@ -2736,17 +2732,17 @@ class IFSsimulator():
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
:
2048
+
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
:
2048
+
prescan
]
+=
self
.
frame_b_1
[
0
:
1024
+
overscan
,
0
:
2048
]
prescan
]
+=
self
.
frame_b_1
[
0
:
1024
+
overscan
,
0
:
2048
]
########## zone 2, OSH #################
#
######### zone 2, OSH #################
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
+
2418
:
2418
+
2048
+
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
+
2418
:
2418
+
2048
+
prescan
]
+=
self
.
frame_b_2
[
0
:
1024
+
overscan
,
0
:
2048
]
prescan
]
+=
self
.
frame_b_2
[
0
:
1024
+
overscan
,
0
:
2048
]
########## zone 3, OSE ###################
#
######### zone 3, OSE ###################
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
+
2418
*
2
:
2418
*
2
+
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
+
2418
*
2
:
2418
*
2
+
2048
+
prescan
]
+=
self
.
frame_b_3
[
0
:
1024
+
overscan
,
0
:
2048
]
2048
+
prescan
]
+=
self
.
frame_b_3
[
0
:
1024
+
overscan
,
0
:
2048
]
########## zone 4, OSF ###############
#
######### zone 4, OSF ###############
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
+
2418
*
3
:
2418
*
3
+
self
.
image_b
[
0
:
1024
+
overscan
,
prescan
+
2418
*
3
:
2418
*
3
+
2048
+
prescan
]
+=
self
.
frame_b_4
[
0
:
1024
+
overscan
,
0
:
2048
]
2048
+
prescan
]
+=
self
.
frame_b_4
[
0
:
1024
+
overscan
,
0
:
2048
]
...
@@ -2760,16 +2756,16 @@ class IFSsimulator():
...
@@ -2760,16 +2756,16 @@ class IFSsimulator():
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
0
:
3442
*
0
+
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
0
:
3442
*
0
+
3072
+
prescan
]
+=
self
.
frame_r_1
[
0
:
1536
+
overscan
,
0
:
3072
]
3072
+
prescan
]
+=
self
.
frame_r_1
[
0
:
1536
+
overscan
,
0
:
3072
]
########## zone 2 ,OSh #################
#
######### zone 2 ,OSh #################
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
1
:
3442
*
1
+
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
1
:
3442
*
1
+
3072
+
prescan
]
+=
self
.
frame_r_2
[
0
:
1536
+
overscan
,
0
:
3072
]
3072
+
prescan
]
+=
self
.
frame_r_2
[
0
:
1536
+
overscan
,
0
:
3072
]
########## zone 1 ,OSE ###################
#
######### zone 1 ,OSE ###################
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
2
:
3442
*
2
+
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
2
:
3442
*
2
+
3072
+
prescan
]
+=
self
.
frame_r_3
[
0
:
1536
+
overscan
,
0
:
3072
]
3072
+
prescan
]
+=
self
.
frame_r_3
[
0
:
1536
+
overscan
,
0
:
3072
]
########## zone 4,OSF ###########
#
######### zone 4,OSF ###########
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
3
:
3442
*
3
+
self
.
image_r
[
0
:
1536
+
overscan
,
prescan
+
3442
*
3
:
3442
*
3
+
3072
+
prescan
]
+=
self
.
frame_r_4
[
0
:
1536
+
overscan
,
0
:
3072
]
3072
+
prescan
]
+=
self
.
frame_r_4
[
0
:
1536
+
overscan
,
0
:
3072
]
...
...
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