Commit 832c0004 authored by Fang Yuedong's avatar Fang Yuedong
Browse files

add gc to Galaxy.py

parent 99d8c5a7
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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment