From d9ac0d4f23e6448d7d629f539f95405d936c06f1 Mon Sep 17 00:00:00 2001 From: Dustin Lang Date: Mon, 18 Apr 2016 12:19:40 -0400 Subject: [PATCH] srcpix --- py/legacypipe/oneblob.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/py/legacypipe/oneblob.py b/py/legacypipe/oneblob.py index 689385555..0dd914ce1 100644 --- a/py/legacypipe/oneblob.py +++ b/py/legacypipe/oneblob.py @@ -80,7 +80,8 @@ def __init__(self, name, blobwcs, blobmask, timargs, srcs, bands, alphas = [0.1, 0.3, 1.0] self.optargs = dict(priors=True, shared_params=False, alphas=alphas, - print_progress=False) + print_progress=True) + #print_progress=False) self.blobh,self.blobw = blobmask.shape self.bigblob = (self.blobw * self.blobh) > 100*100 if self.bigblob: @@ -306,8 +307,8 @@ def run_model_selection(self, cat, Ibright, B): srcwcs = self.blobwcs.get_subimage(xl, yl, 1+xh-xl, 1+yh-yl) # A mask for which pixels in the 'srcwcs' square are occupied. srcpix = insrc[yl:yh+1, xl:xh+1] - from scipy.ndimage.morphology import binary_erosion - srcpix2 = binary_erosion(srcpix) + # from scipy.ndimage.morphology import binary_erosion + # srcpix2 = binary_erosion(srcpix) else: modelMasks = models.model_masks(i, src) srctims = self.tims @@ -372,8 +373,8 @@ def run_model_selection(self, cat, Ibright, B): # If lots of exposures, cut to a subset that reach the DECaLS # depth goals and use those in an initial round? if self.many_exposures: - dtims,insubset = self._get_todepth_subset(srctims, srcwcs) - + dtims,insubset = self._get_todepth_subset(srctims, srcwcs, + srcpix) allflags = {} for name,newsrc in trymodels: @@ -668,7 +669,7 @@ def run_model_selection(self, cat, Ibright, B): del models - def _get_todepth_subset(self, srctims, srcwcs): + def _get_todepth_subset(self, srctims, srcwcs, srcpix): timsubset = set() for band in self.bands: # Order to try them: first, DECaLS data (our propid), @@ -724,7 +725,7 @@ def _get_todepth_subset(self, srctims, srcwcs): if srcpix is None: p1,p2,p3 = np.percentile(detiv, pctiles) else: - p1,p2,p3 = np.percentile(detiv[srcpix2], pctiles) + p1,p2,p3 = np.percentile(detiv[srcpix], pctiles) m1 = NanoMaggies.nanomaggiesToMag(np.sqrt(1./p1) * Nsigma) m2 = NanoMaggies.nanomaggiesToMag(np.sqrt(1./p2) * Nsigma)