コード例 #1
0
ファイル: decomp.py プロジェクト: rth/shapelets
def genBasisMatrix(beta,nmax,rx,ry):
    """Generate the n x k matrix of basis functions(k) for each pixel(n)
    nmax: maximum decompisition order
    beta: characteristic size of the shapelet
    rx: range of x values to evaluate basis functions
    ry: range of y values to evaluate basis functions
    """
    bvals=[]
    for x in range(nmax[0]):
        for y in range(nmax[1]):
            bf=shapelet.dimBasis2d(x,y,beta=beta)
            bvals.append(shapelet.computeBasis2d(bf,rx,ry).flatten())
    bm=np.array(bvals)
    return bm.transpose()
コード例 #2
0
def genBasisMatrix(beta,nmax,phi,yy,xx,fourier=False):
    """Generate the n x k matrix of basis functions(k) for each pixel(n)
    nmax: maximum decompisition order
    beta: characteristic size of the shapelet
    phi: rotation angle
    yy: y values to evaluate basis functions
    xx: x values to evaluate basis functions
    fourier: return a FOurer transformed version of the basis functions
    """
    bvals=[]
    if type(nmax) is int: nmax=[nmax,nmax]
    for ny in range(nmax[0]):
        for nx in range(nmax[1]):
            bf=shapelet.dimBasis2d(ny,nx,beta=beta,phi=phi,fourier=fourier)
            bvals.append(shapelet.computeBasis2d(bf,yy,xx).flatten())
    bm=np.array(bvals)
    return bm.transpose()
コード例 #3
0
def genBasisMatrix(beta, nmax, phi, yy, xx, fourier=False):
    """Generate the n x k matrix of basis functions(k) for each pixel(n)
    nmax: maximum decompisition order
    beta: characteristic size of the shapelet
    phi: rotation angle
    yy: y values to evaluate basis functions
    xx: x values to evaluate basis functions
    fourier: return a FOurer transformed version of the basis functions
    """
    bvals = []
    if type(nmax) is int: nmax = [nmax, nmax]
    for ny in range(nmax[0]):
        for nx in range(nmax[1]):
            bf = shapelet.dimBasis2d(ny,
                                     nx,
                                     beta=beta,
                                     phi=phi,
                                     fourier=fourier)
            bvals.append(shapelet.computeBasis2d(bf, yy, xx).flatten())
    bm = np.array(bvals)
    return bm.transpose()