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
0b7b3a2b
Commit
0b7b3a2b
authored
Jan 21, 2025
by
Zhang Xin
Browse files
griddata memory issue
parent
b2d70812
Pipeline
#7831
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
observation_sim/mock_objects/FlatLED.py
View file @
0b7b3a2b
...
@@ -143,10 +143,21 @@ class FlatLED(MockObject):
...
@@ -143,10 +143,21 @@ class FlatLED(MockObject):
n_x
=
np
.
arange
(
0
,
self
.
chip
.
npix_x
,
1
)
n_x
=
np
.
arange
(
0
,
self
.
chip
.
npix_x
,
1
)
n_y
=
np
.
arange
(
0
,
self
.
chip
.
npix_y
,
1
)
n_y
=
np
.
arange
(
0
,
self
.
chip
.
npix_y
,
1
)
M
,
N
=
np
.
meshgrid
(
n_x
,
n_y
)
M
,
N
=
np
.
meshgrid
(
n_x
,
n_y
)
U
=
griddata
(
X_
,
Z_
,
(
x_seg_len
=
4
M
[
0
:
self
.
chip
.
npix_y
,
0
:
self
.
chip
.
npix_x
],
y_seg_len
=
8
N
[
0
:
self
.
chip
.
npix_y
,
0
:
self
.
chip
.
npix_x
]),
x_seg
=
int
(
self
.
chip
.
npix_x
/
x_seg_len
)
method
=
'nearest'
).
astype
(
np
.
float32
)
y_seg
=
int
(
self
.
chip
.
npix_y
/
y_seg_len
)
U
=
np
.
zeros
([
self
.
chip
.
npix_y
,
self
.
chip
.
npix_x
],
dtype
=
np
.
float32
)
for
y_seg_i
in
np
.
arange
(
y_seg_len
):
for
x_seg_i
in
np
.
arange
(
x_seg_len
):
U
[
y_seg_i
*
y_seg
:(
y_seg_i
+
1
)
*
y_seg
,
x_seg_i
*
x_seg
:(
x_seg_i
+
1
)
*
x_seg
]
=
griddata
(
X_
,
Z_
,
(
M
[
y_seg_i
*
y_seg
:(
y_seg_i
+
1
)
*
y_seg
,
x_seg_i
*
x_seg
:(
x_seg_i
+
1
)
*
x_seg
],
N
[
y_seg_i
*
y_seg
:(
y_seg_i
+
1
)
*
y_seg
,
x_seg_i
*
x_seg
:(
x_seg_i
+
1
)
*
x_seg
]),
method
=
'linear'
)
# U = griddata(X_, Z_, (
# M[0:self.chip.npix_y, 0:self.chip.npix_x],
# N[0:self.chip.npix_y, 0:self.chip.npix_x]),
# method='nearest').astype(np.float32)
U
=
U
/
np
.
mean
(
U
)
U
=
U
/
np
.
mean
(
U
)
flatImage
=
U
flatImage
=
U
if
LED_Img_flag
:
if
LED_Img_flag
:
...
...
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