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
832c0004
Commit
832c0004
authored
Mar 11, 2023
by
Fang Yuedong
Browse files
add gc to Galaxy.py
parent
99d8c5a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
ObservationSim/MockObject/Galaxy.py
View file @
832c0004
import
numpy
as
np
import
galsim
import
gc
import
os
,
sys
import
astropy.constants
as
cons
from
astropy.table
import
Table
...
...
@@ -180,6 +181,7 @@ class Galaxy(MockObject):
photons
.
x
+=
x_nominal
photons
.
y
+=
y_nominal
photons_list
.
append
(
photons
)
del
gal
# print('xmax = %d, ymax = %d '%(xmax, ymax))
...
...
@@ -205,6 +207,7 @@ class Galaxy(MockObject):
sensor
.
accumulate
(
photons_list
[
i
],
stamp
)
else
:
sensor
.
accumulate
(
photons_list
[
i
],
stamp
,
resume
=
True
)
del
sensor
chip
.
img
[
bounds
]
=
stamp
[
bounds
]
...
...
@@ -238,6 +241,7 @@ class Galaxy(MockObject):
# # print("nphotons_sum = ", nphotons_sum)
del
photons_list
del
stamp
gc
.
collect
()
return
True
,
pos_shear
def
drawObj_slitless
(
self
,
tel
,
pos_img
,
psf_model
,
bandpass_list
,
filt
,
chip
,
nphotons_tot
=
None
,
g1
=
0
,
g2
=
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