Skip to content

Commit

Permalink
feat(beamform): delete some class list attributes in 'process_finish'.
Browse files Browse the repository at this point in the history
These lists can hold fairly large chunks of data which will not get
cleared from memory otherwise.
  • Loading branch information
ljgray committed May 16, 2023
1 parent f4adb7a commit c328860
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions draco/analysis/beamform.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,18 @@ def process(self):

return formed_beam

def process_finish(self):
"""Clear lists holding copies of data.
These lists will persist beyond this task being done, so
the data stored there will continue to use memory.
"""
for attr in ["vis", "visweight", "bvec", "sumweight"]:
try:
delattr(self, attr)
except AttributeError:
pass

def _ha_array(self, ra, source_ra_index, source_ra, ha_side, is_sstream=True):
"""Hour angle for each RA/time bin to be processed.
Expand Down

0 comments on commit c328860

Please sign in to comment.