Skip to content

Commit

Permalink
Correct use of nbatch_per_checkpoint for LSST_Image.
Browse files Browse the repository at this point in the history
  • Loading branch information
welucas2 committed May 24, 2024
1 parent 7290a11 commit b1f191a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion imsim/lsst_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,14 @@ def buildImage(self, config, base, image_num, obj_num, logger):
all_bounds = [stamp.bounds for stamp in all_stamps]
data = (full_image, all_bounds, all_vars, end_obj_num,
base.get('extra_builder',None))
self.checkpoint.save(chk_name, data)
logger.warning('File %d: Completed batch %d with objects [%d, %d), and wrote '
'checkpoint data to %s',
base.get('file_num', 0), batch+1, start_obj_num, end_obj_num,
self.checkpoint.file_name)
if (batch % self.nbatch_per_checkpoint == 0
or batch + 1 == nbatch):
self.checkpoint.save(chk_name, data)
logger.warning('Wrote checkpoint data to %s', self.checkpoint.file_name)

# Bring the image so far up to a flat noise variance
current_var = galsim.config.FlattenNoiseVariance(
Expand Down

0 comments on commit b1f191a

Please sign in to comment.