解决读取雷达数据时 Decode PUP data 报错问题

读取PUP雷达数据官网示例:

图一:Decode PUP data示例代码

运行示例代码

from cinrad.io import PUP
pup_file='Z_RADR_I_Z9591_20210901004700_P_DOR_SA_V_10_230_60.591.bin'
f = PUP(path+pup_file)
data = f.get_data()
  • 报错一

    连接超时:

    (‘Connection aborted.’, TimeoutError(10060, '由于连接方在一段时间后没有正确…

在这里插入图片描述

解决办法:

在路径的程序中添加代码,延长连接时间阈值 timeout=100,如图;
在这里插入图片描述

  • 报错二

    矩阵超出范围

HTTPSConnectionPool(host=‘github.com’, port=443): Max retries exceeded with url: /Unidata/MetPy/raw/v1.0.1/staticdata/airport-codes.csv (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x000001EA124FA370>, ‘Connection to github.com timed out. (connect timeout=3)’))报错

解决方法:

仍在刚才的程序中,添加代码

            s = requests.session()
            s.keep_alive = False
            #  忽略警告:InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised.
            # HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url
            requests.packages.urllib3.disable_warnings()
            
            response = requests.get(url, **kwargs,timeout=100,verify=False,)  ####

在这里插入图片描述

  • 报错三

    库包引入出错

在这里插入图片描述

解决办法:

将相对路径改为绝对路径

在这里插入图片描述
在这里插入图片描述

  • 成功运行

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/lc_lcrystal/article/details/120057747