Пример #1
0
        te += 1

    #estimateNoise(im,mode='basic'):
    tc += 1
    try:
        mean, std = estimateNoise(im, mode='basic')
        nm = makeNoiseMap(im.shape, mean, std)
        print nm.shape
    except:
        print 'Test failed (%i):' % tc, sys.exc_info()[0]
        te += 1

    #constructModel(bvals,coeffs,size):
    tc += 1
    try:
        shapeDict = fileio.readLageurreCoeffs('../data/testHermite.pkl')
        rx = np.array(range(0, shapeDict['size'][0]),
                      dtype=float) - shapeDict['xc'][0]
        ry = np.array(range(0, shapeDict['size'][1]),
                      dtype=float) - shapeDict['xc'][1]
        xx, yy = shapelet.xy2Grid(rx, ry)
        bvals = decomp.genBasisMatrix(shapeDict['beta'], shapeDict['norder'],
                                      shapeDict['phi'], xx, yy)
        mdl = constructModel(bvals, shapeDict['coeffs'], shapeDict['size'])
        print mdl.shape
    except:
        print 'Test failed (%i):' % tc, sys.exc_info()[0]
        te += 1

    #polarCoeffImg(coeffs,nmax):
    tc += 1
Пример #2
0
        print 'Error: Unknown mode'
        return np.nan

if __name__ == "__main__":

    print '============================================'
    print 'Testing measure module:'
    print '============================================'
    import fileio
    import sys
    tc=0
    te=0
    
    #load precomputed shapelet coeffs (polar and cartesian)
    hermDict=fileio.readHermiteCoeffs('../data/testHermite.pkl')
    laDict=fileio.readLageurreCoeffs('../data/testLageurre.pkl')

    #polarIDs(nmax):
    tc+=1
    try:
        print polarIDs(5)
        print cartIDs(5)
    except:
        print 'Test failed (%i):'%tc, sys.exc_info()[0]
        te+=1

    #compute flux (cartesian)
    #compute flux (polar)
    tc+=1
    try:
        print flux(hermDict['coeffs'],hermDict['beta'],hermDict['norder'],mode=hermDict['mode'])
Пример #3
0
        return np.nan


if __name__ == "__main__":

    print '============================================'
    print 'Testing measure module:'
    print '============================================'
    import fileio
    import sys
    tc = 0
    te = 0

    #load precomputed shapelet coeffs (polar and cartesian)
    hermDict = fileio.readHermiteCoeffs('../data/testHermite.pkl')
    laDict = fileio.readLageurreCoeffs('../data/testLageurre.pkl')

    #polarIDs(nmax):
    tc += 1
    try:
        print polarIDs(5)
        print cartIDs(5)
    except:
        print 'Test failed (%i):' % tc, sys.exc_info()[0]
        te += 1

    #compute flux (cartesian)
    #compute flux (polar)
    tc += 1
    try:
        print flux(hermDict['coeffs'],