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
f4cf5529
Commit
f4cf5529
authored
Nov 30, 2024
by
Wei Chengliang
Browse files
Optimized memory in add_objects
parent
2ac619d1
Pipeline
#7386
passed with stage
in 0 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
catalog/data/starSpecInterp.so
100755 → 100644
View file @
f4cf5529
No preview for this file type
observation_sim/ObservationSim.py
View file @
f4cf5529
...
...
@@ -154,13 +154,12 @@ class Observation(object):
chip_output
.
Log_error
(
e
)
chip_output
.
Log_error
(
"Failed simulation on step: %s"
%
(
step
))
break
chip_output
.
Log_info
(
"check running:1: pointing-%d chip-%d pid-%d memory-%6.2fGB"
%
(
pointing
.
id
,
chip
.
chipID
,
os
.
getpid
(),
(
psutil
.
Process
(
os
.
getpid
()).
memory_info
().
rss
/
1024
/
1024
/
1024
)))
del
chip
.
img
del
chip
.
flat_img
del
chip
.
prnu_img
del
chip
.
shutter_img
chip_output
.
Log_info
(
"check running:1: pointing-%d chip-%d pid-%d memory-%6.2fGB"
%
(
pointing
.
id
,
chip
.
chipID
,
os
.
getpid
(),
(
psutil
.
Process
(
os
.
getpid
()).
memory_info
().
rss
/
1024
/
1024
/
1024
)))
def
runExposure_MPI_PointingList
(
self
,
pointing_list
,
chips
=
None
):
comm
=
MPI
.
COMM_WORLD
...
...
@@ -239,5 +238,6 @@ class Observation(object):
"finished running chip#%d..."
%
(
chip
.
chipID
))
for
handler
in
chip_output
.
logger
.
handlers
[:]:
chip_output
.
logger
.
removeHandler
(
handler
)
del
chip_output
gc
.
collect
()
process_counter
+=
nchips_per_fp
observation_sim/sim_steps/add_objects.py
View file @
f4cf5529
...
...
@@ -233,11 +233,12 @@ def add_objects(self, chip, filt, tel, pointing, catalog, obs_param):
self
.
chip_output
.
Log_error
(
"obj id: %s"
%
(
obj
.
param
[
'id'
]))
self
.
chip_output
.
Log_error
(
" e1: %.5f
\n
e2: %.5f
\n
size: %f
\n
bfrac: %f
\n
detA: %f
\n
g1: %.5f
\n
g2: %.5f
\n
"
%
(
obj
.
param
[
'e1'
],
obj
.
param
[
'e2'
],
obj
.
param
[
'size'
],
obj
.
param
[
'bfrac'
],
obj
.
param
[
'detA'
],
obj
.
param
[
'g1'
],
obj
.
param
[
'g2'
]))
# Unload SED:
obj
.
unload_SED
()
del
obj
# gc.collect()
cat
.
starDDL
.
freeGlobeData
()
del
cat
.
starDDL
if
chip
.
survey_type
==
"spectroscopic"
and
not
self
.
overall_config
[
"run_option"
][
"out_cat_only"
]
and
chip
.
slsPSFOptim
:
# from observation_sim.instruments.chip import chip_utils as chip_utils
...
...
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