GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
224 stars 105 forks source link

Let vectors in SiliconSensor release their previous allocated memory when getting a smaller target image. #1246

Closed rmjarvis closed 1 year ago

rmjarvis commented 1 year ago

The SiliconSensor class uses a rather large amount of memory when the postage stamp is large. Proportional to the number of pixels, as you might imagine. However, once it's done with the large image and goes on to smaller postage stamps, it doesn't release that memory. This PR lets those vectors release the allocated memory whenever the target image size decreases. It also does the same with the _delta image -- releasing the memory when it gets smaller.