TypeError: unsupported operand type(s) for *: ‘float‘ and ‘geodesic

geodesic函数计算的结果是<class ‘geopy.distance.geodesic’>类型,

    for n in range(len(near_obs_x)):
        dlon = y - near_obs_y[n]
        dlat = x - near_obs_x[n]
        r = geodesic((near_obs_x[n],near_obs_y[n]),(x,y))   #  网格点附近观测点的距离
        print('r=',r)
        print(type(r))   #r 的类型是<class 'geopy.distance.geodesic'>
        a = 3.337/((2)**(1/2))
        F1= (1+a*r +(1/6)*(a*r)**2 - (1/6)*(a*r)**3)#*exp(-a*r)*exp(-1/100)  #时空相关函数
        V = 0.017
        Cx_ = V*F1
        h=0
        for p in range(len(near_obs_x)):
            ddlon = near_obs_y[n]-near_obs_y[p]
            ddlat = near_obs_x[n]-near_obs_x[p]
            aa = sin(ddlat / 2) ** 2 + cos(near_obs_x[n]) * cos(near_obs_x[p]) * sin(ddlon / 2) ** 2
            rr = 2 * asin(sqrt(aa)) * 6371 * 1000
            bb= 3.337 / ((2) ** (1 / 2))
            F2= (1+bb*rr +(1/6)*(bb*rr)**2 - (1/6)*(bb*rr)**3)*exp(-bb*rr)*exp(-1/100)  #时空相关函数

F1公式中需要将r转化为数字

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值