Пример #1
0
    def testMakeAlardLupton(self):
        nGauss = self.policyAL.get("alardNGauss")
        sigGauss = self.policyAL.getDoubleArray("alardSigGauss")
        degGauss = self.policyAL.getIntArray("alardDegGauss")
        self.assertEqual(len(sigGauss), nGauss)
        self.assertEqual(len(degGauss), nGauss)
        self.assertEqual(self.kSize % 2, 1)       # odd sized
        kHalfWidth = self.kSize // 2

        ks = ipDiffim.makeAlardLuptonBasisList(kHalfWidth, nGauss, sigGauss, degGauss)

        # right size
        nTot = 0
        for deg in degGauss:
            nTot += (deg + 1) * (deg + 2) / 2
        self.assertEqual(len(ks), nTot)

        # right orthogonality
        self.alardLuptonTest(ks)
Пример #2
0
    def testMakeAlardLupton(self):
        nGauss = self.policyAL.get("alardNGauss")
        sigGauss = self.policyAL.getDoubleArray("alardSigGauss")
        degGauss = self.policyAL.getIntArray("alardDegGauss")
        self.assertEqual(len(sigGauss), nGauss)
        self.assertEqual(len(degGauss), nGauss)
        self.assertEqual(self.kSize % 2, 1)       # odd sized
        kHalfWidth = self.kSize // 2

        ks = ipDiffim.makeAlardLuptonBasisList(kHalfWidth, nGauss, sigGauss, degGauss)

        # right size
        nTot = 0
        for deg in degGauss:
            nTot += (deg + 1) * (deg + 2) / 2
        self.assertEqual(len(ks), nTot)

        # right orthogonality
        self.alardLuptonTest(ks)
Пример #3
0
# 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/>.
#

import lsst.ip.diffim as ipDiffim
import lsst.afw.image as afwImage
import lsst.afw.display.ds9 as ds9
import numpy as num

klist = ipDiffim.makeAlardLuptonBasisList(15, 3, [2, 4, 8], [4, 3, 2])
frame = 1
for kernel in klist:
    kImageOut = afwImage.ImageD(kernel.getDimensions())
    kSum      = kernel.computeImage(kImageOut, False)
    ds9.mtv(kImageOut, frame=frame)
    frame += 1

kim1 = afwImage.ImageD(klist[0].getDimensions())
kim2 = afwImage.ImageD(klist[0].getDimensions())

for k1 in range(0, len(klist)):
    klist[k1].computeImage(kim1, False)
    # Only first term should have sum != 0.0
    print k1, num.sum(num.ravel(kim1.getArray()))
    
Пример #4
0
# 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/>.
#

import lsst.ip.diffim as ipDiffim
import lsst.afw.image as afwImage
import lsst.afw.display.ds9 as ds9
import numpy as num

klist = ipDiffim.makeAlardLuptonBasisList(15, 3, [2, 4, 8], [4, 3, 2])
frame = 1
for kernel in klist:
    kImageOut = afwImage.ImageD(kernel.getDimensions())
    kSum = kernel.computeImage(kImageOut, False)
    ds9.mtv(kImageOut, frame=frame)
    frame += 1

kim1 = afwImage.ImageD(klist[0].getDimensions())
kim2 = afwImage.ImageD(klist[0].getDimensions())

for k1 in range(0, len(klist)):
    klist[k1].computeImage(kim1, False)
    # Only first term should have sum != 0.0
    print(k1, num.sum(num.ravel(kim1.getArray())))