Coverage for tests/test_approximate.py : 84%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
# # LSST Data Management System # Copyright 2008, 2009, 2010 LSST Corporation. # # This product includes software developed by the # LSST Project (http://www.lsst.org/). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the LSST License Statement and # the GNU General Public License along with this program. If not, # see <http://www.lsstcorp.org/LegalNotices/>. #
# Set to True to display things in ds9.
"""Make a linear ramp"""
0x0, var)
"""Fit a ramp"""
# Add a (labelled) bad value
ds9.mtv(ramp, title="Input", frame=0) # Here's the range that the approximation should be valid (and also the # bbox of the image returned by getImage) lsst.geom.PointI(binsize*ramp.getWidth() - 1, binsize*ramp.getHeight() - 1))
afwMath.ApproximateControl.CHEBYSHEV, order)
approx.getMaskedImage().getImage(), ]): ds9.mtv(aim, title="interpolated", frame=1) with ds9.Buffering(): for x in xVec: for y in yVec: ds9.dot('+', x, y, size=0.4, frame=1)
aim[x, y, afwImage.LOCAL], rampCoeffs[0] + rampCoeffs[1]*x + rampCoeffs[1]*y)
"""Check that we enforce the condition orderX == orderY"""
lambda: afwMath.ApproximateControl(afwMath.ApproximateControl.CHEBYSHEV, 1, 2))
"""Check that makeApproximate throws a RuntimeError if grid has no finite points and weights to fit """ binsize*ramp.getHeight() - 1)) afwMath.ApproximateControl.CHEBYSHEV, order) lambda: afwMath.makeApproximate(xVec, yVec, ramp, bbox, actrl))
"""Fit a ramp"""
ds9.mtv(ramp, title="Input", frame=0) # Here's the range that the approximation should be valid (and also the # bbox of the image returned by getImage)
afwMath.ApproximateControl.CHEBYSHEV, order)
# Get the Image, the MaskedImage, and the Image with a truncated # expansion approx.getMaskedImage().getImage(), approx.getImage( order - 1 if order > 1 else -1), ]): ds9.mtv(aim, title="Interpolated", frame=1)
rampCoeffs[0] + rampCoeffs[1]*x + rampCoeffs[1]*y
# Check that we can't "truncate" the expansion to a higher order than # we requested lambda: approx.getImage(orderMax + 1, orderMax + 1))
lsst.utils.tests.init() unittest.main() |