Skip to content

Commit 4419fcf

Browse files
committed
add test for tiny images to investigate correlate7f error
1 parent 30fb8aa commit 4419fcf

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

test/test_psfex.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,23 @@ def setUp(self):
2121
fn = os.path.join(os.path.dirname(__file__),
2222
'psfex-decam-00392360-S31.fits')
2323
self.psf = PixelizedPsfEx(fn)
24-
24+
25+
def test_tiny_image(self):
26+
from tractor.patch import ModelMask
27+
H,W = 1,1
28+
tim = Image(data=np.zeros((H,W)), invvar=np.ones((H,W)),
29+
psf=self.psf)
30+
src = PointSource(PixPos(2.3,2.4), Flux(100.))
31+
tr = Tractor([tim],[src])
32+
mod = tr.getModelImage(0)
33+
assert(mod.shape == (H,W))
34+
#
35+
mm = ModelMask(0,0,W,H)
36+
#patch = src.getModelPatch(tim, modelMask=mm)
37+
#upatch = src.getUnitFluxModelPatch(img, modelMask=mm)
38+
psfpatch = self.psf.getPointSourcePatch(-3.1, 2.4, modelMask=mm)
39+
# psf.getImage(px,py)
40+
2541
def test_shifted(self):
2642
# Test that the PsfEx model varies spatially
2743
# Test that the PixelizedPsfEx.getShifted() method works

tractor/psf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def getImage(self, px, py):
120120
return self.img
121121

122122
def getPointSourcePatch(self, px, py, minval=0., modelMask=None, **kwargs):
123-
from scipy.ndimage.filters import correlate1d
124123
from astrometry.util.miscutils import get_overlapping_region
125124

126125
img = self.getImage(px, py)

0 commit comments

Comments
 (0)