@@ -272,6 +272,7 @@ def makeMosaic(deferredDatasetRefs,
272272 nExpected ,
273273 deleteIfComplete ,
274274 deleteRegardless ,
275+ doNotDelete ,
275276 logger = None ):
276277 """Make a binned mosaic image from a list of deferredDatasetRefs.
277278
@@ -297,6 +298,8 @@ def makeMosaic(deferredDatasetRefs,
297298 is the number which was found.
298299 deleteRegardless : `bool`, optional
299300 If True, delete the binned images regardless of how many are found.
301+ doNotDelete : `bool`, optional
302+ If True, do not delete the binned images after reading them.
300303 logger : `logging.Logger`, optional
301304 The logger, created if not provided.
302305 deleteAfterReading : `bool`
@@ -321,6 +324,11 @@ def makeMosaic(deferredDatasetRefs,
321324 if logger is None :
322325 logger = logging .getLogger (__name__ )
323326
327+ if doNotDelete :
328+ if deleteRegardless :
329+ raise ValueError ("doNotDelete and deleteRegardless are mutually exclusive" )
330+ deleteIfComplete = False
331+
324332 instrument = camera .getName ()
325333
326334 detectorNameList = []
@@ -437,6 +445,7 @@ def plotFocalPlaneMosaic(butler,
437445 timeout ,
438446 deleteIfComplete = True ,
439447 deleteRegardless = False ,
448+ doNotDelete = False ,
440449 logger = None ):
441450 """Save a full focal plane binned mosaic image for a given expId.
442451
@@ -468,6 +477,10 @@ def plotFocalPlaneMosaic(butler,
468477 is the number which was found.
469478 deleteRegardless : `bool`, optional
470479 If True, delete the binned images regardless of how many are found.
480+ `doNotDelete` trumps `deleteIfComplete`, but raises a ValueError if
481+ used with `deleteRegardless`.
482+ doNotDelete : `bool`, optional
483+ If True, do not delete the binned images after reading them.
471484 logger : `logging.Logger`, optional
472485 The logger, created if not provided.
473486
@@ -488,6 +501,7 @@ def plotFocalPlaneMosaic(butler,
488501 timeout = timeout ,
489502 deleteIfComplete = deleteIfComplete ,
490503 deleteRegardless = deleteRegardless ,
504+ doNotDelete = doNotDelete ,
491505 logger = logger )
492506
493507 if mosaic is None :
@@ -507,6 +521,7 @@ def getMosaicImage(butler,
507521 timeout ,
508522 deleteIfComplete = True ,
509523 deleteRegardless = False ,
524+ doNotDelete = False ,
510525 logger = None ):
511526 """Save a full focal plane binned mosaic image for a given expId.
512527
@@ -534,6 +549,8 @@ def getMosaicImage(butler,
534549 is the number which was found.
535550 deleteRegardless : `bool`, optional
536551 If True, delete the binned images regardless of how many are found.
552+ doNotDelete : `bool`, optional
553+ If True, do not delete the binned images after reading them.
537554 logger : `logging.Logger`, optional
538555 The logger, created if not provided.
539556
@@ -567,6 +584,7 @@ def getMosaicImage(butler,
567584 nExpected = nExpected ,
568585 deleteIfComplete = deleteIfComplete ,
569586 deleteRegardless = deleteRegardless ,
587+ doNotDelete = doNotDelete ,
570588 logger = logger
571589 ).output_mosaic
572590 if mosaic is None :
0 commit comments