Skip to content

Commit

Permalink
add test for tiny images to investigate correlate7f error
Browse files Browse the repository at this point in the history
  • Loading branch information
dstndstn committed Dec 18, 2017
1 parent 30fb8aa commit 4419fcf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
18 changes: 17 additions & 1 deletion test/test_psfex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tractor/psf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4419fcf

Please sign in to comment.