From 4419fcff040f7d9fcbf2ae8cdfedf9fb7bd781b2 Mon Sep 17 00:00:00 2001 From: Dustin Lang Date: Mon, 18 Dec 2017 11:29:59 -0500 Subject: [PATCH] add test for tiny images to investigate correlate7f error --- test/test_psfex.py | 18 +++++++++++++++++- tractor/psf.py | 1 - 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/test/test_psfex.py b/test/test_psfex.py index 6c9723a8..de337b15 100644 --- a/test/test_psfex.py +++ b/test/test_psfex.py @@ -21,7 +21,23 @@ def setUp(self): fn = os.path.join(os.path.dirname(__file__), 'psfex-decam-00392360-S31.fits') self.psf = PixelizedPsfEx(fn) - + + def test_tiny_image(self): + from tractor.patch import ModelMask + H,W = 1,1 + tim = Image(data=np.zeros((H,W)), invvar=np.ones((H,W)), + psf=self.psf) + src = PointSource(PixPos(2.3,2.4), Flux(100.)) + tr = Tractor([tim],[src]) + mod = tr.getModelImage(0) + assert(mod.shape == (H,W)) + # + mm = ModelMask(0,0,W,H) + #patch = src.getModelPatch(tim, modelMask=mm) + #upatch = src.getUnitFluxModelPatch(img, modelMask=mm) + psfpatch = self.psf.getPointSourcePatch(-3.1, 2.4, modelMask=mm) + # psf.getImage(px,py) + def test_shifted(self): # Test that the PsfEx model varies spatially # Test that the PixelizedPsfEx.getShifted() method works diff --git a/tractor/psf.py b/tractor/psf.py index 6e847d2e..08102d5b 100644 --- a/tractor/psf.py +++ b/tractor/psf.py @@ -120,7 +120,6 @@ def getImage(self, px, py): return self.img def getPointSourcePatch(self, px, py, minval=0., modelMask=None, **kwargs): - from scipy.ndimage.filters import correlate1d from astrometry.util.miscutils import get_overlapping_region img = self.getImage(px, py)