雷达回波的代码挺简单的,关键是运行环境的问题,之前用python3.8,根本画不出来图,尤其是地图类的,即使安装了cartopy也不行。
后来在一番折腾之后,尝试用了python3.9,一切都变得简单了起来,首先弄个虚拟环境python3.9,然后按装一系列的包:cartopy,cinrad等包
具体详情参考:PyCINRAD保姆级教程 - Heywhale.com
中间还包括一系列的github注册等,github注册和git配置环境变量参考:
具体详情参考:Git的安装和环境变量的配置_git环境变量-CSDN博客
#!usr/bin/env python # -*- coding:utf-8 -*- """ @author: Suyue @file: leida.py @time: 2024/07/30 @desc: """ import warnings import cinrad import matplotlib matplotlib.use('TkAgg') from cinrad.visualize import PPI warnings.filterwarnings("ignore") import numpy as np basePath = "F:/" cinrad.__version__ nFiles = basePath + "/Z_RADR_I_Z9471_20230804000007_O_DOR_CD_CAP_FMT.bin.bz2" f = cinrad.io.read_auto(nFiles) data = f.get_data(0,230,"REF") print(data) f.available_product(0) #第0个仰角有哪些产品可以读取 f.available_tilt('REF') f.available_tilt('VEL') vel0 = f.get_data(1,230,"VEL") print(vel0) f = cinrad.io.read_auto(nFiles) print(type(f).__name__) data = f.get_data(0, 230, "REF") f.available_product(0) data["REF"].values = np.ma.masked_less(data["REF"].values, 0) fig = cinrad.visualize.PPI(data, style="black") print(123) fig('F:/abc.png')
标签:available,python,REF,PPI,import,print,cinrad,回波,data From: https://www.cnblogs.com/shirleysu90/p/18358543