Skip to content

Commit

Permalink
handle existing dq masks
Browse files Browse the repository at this point in the history
  • Loading branch information
imcgreer committed Jan 31, 2017
1 parent 249813d commit 8352a68
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion bokpipe/bokproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,20 @@ def __init__(self,**kwargs):
# but only write out the 4-ccd mask at the end
kwargs['read_only'] = True
super(BokGenerateDataQualityMasks,self).__init__(**kwargs)
def process_file(self,f):
# need to overload process_file in order to check for output before
# opening input image
outf = self.outputNameMap(f)
if os.path.exists(outf):
if self.clobber:
os.unlink(outf)
else:
self._proclog('data quality mask for %s already exists' % f)
return None
super(BokGenerateDataQualityMasks,self).process_file(f)
def _preprocess(self,fits,f):
self._proclog('data quality mask %s' % fits.outFileName)
self.hduData = []
self._proclog('data quality mask for %s' % f)
@staticmethod
def _grow_saturated_blobs(ccdIm,saturated,minNsat=1000):
yi,xi = np.indices(ccdIm.shape)
Expand Down

0 comments on commit 8352a68

Please sign in to comment.