simUtils.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:frequencyDependentAntennas 作者: reedessick 项目源码 文件源码
def lineOfSightGrid( theta, phi, Ntheta, Nphi, sigmaTheta, pole=None ):
    '''
    assumes theta, phi are in Earth fixed coordinates.
    generates a grid in line of sight coordinates around the corresponding theta_los, phi_los
    returns that grid in Earth fixed coords
    return thetaGRID, phiGRID
    '''
    theta_los, phi_los = ThetaPhi2LineOfSight(theta, phi, pole=pole)

    # phi is easy, just wrap it around the azimuth
    phiGRID = np.linspace(0, 2*np.pi, Nphi+1)[:-1]

    # theta is a bit ad hoc, but should be a gaussian centered on the injected location
    if Ntheta%2:
        Ntheta += 1
    thetaGRID = erfinv(np.linspace(0,1,Ntheta/2+1)[:-1])
    thetaGRID = theta_los + sigmaTheta*np.concatenate((-thetaGRID[::-1], thetaGRID[1:]))
    thetaGRID = thetaGRID[(thetaGRID>=0)*(thetaGRID<=np.pi)]

    ### rotate back to Earth-fixed
    thetaGRID, phiGRID = np.meshgrid(thetaGRID, phiGRID)
    thetaGRID, phiGRID = lineOfSight2ThetaPhi(thetaGRID.flatten(), phiGRID.flatten(), pole=pole)

    phiGRID[phiGRID<0] += 2*np.pi ### we want these to be positive

    return thetaGRID, phiGRID
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号