首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >wrf-python 1.4.0更新内容以及浅谈xwrf

wrf-python 1.4.0更新内容以及浅谈xwrf

作者头像
用户11172986
发布2026-04-24 18:37:41
发布2026-04-24 18:37:41
670
举报
文章被收录于专栏:气python风雨气python风雨

wrf-python是NCAR投入python怀抱的重要节点,但是已经很久不更新了,上次更新约莫是2019年。

当然对于处理wrf文件完全是足够的,多样的诊断量,丰富的插值与绘图函数,简易的接口都是优点。

更新内容属于是比较实用,比如支持更高版本的python以及支持mac等等

我个人当然是希望支持更多的诊断量减少我们的工作量

近期会更新一些关于xwrf(批量处理wrf工具)的小文章,敬请期待。

xWRF 提供了一个轻量级接口,用于在 Xarray 中使用天气研究和预报 (WRF) 模型输出。xwrf 的主要目标是以更方便用户的方式从 wrf-python 包中复制关键功能,并提供与 Pangeo 软件堆栈其余部分的无缝集成。

项目地址是https://xwrf.readthedocs.io/en/latest/index.html

个人实际体验下来还是wrfpython更加顺手,一句getvar()走天下,毕竟xwrf主打轻量化,基本上就提供一个读取接口,剩下的诊断量计算,插值等等只能求助于其他python库了。

如果你有超大量级的文件需要读取与处理,xwrf可以更方便与dask集成,这可能是一个xwrf的就业方向。

下面是github上大佬总结的wrf-python与xwrf的差异

诊断量方面

wrf-python key

Description

Status Relative to MetPy

avo

Absolute Vorticity

Implemented: mpcalc.absolute_vorticity

eth/theta_e

Equivalent Potential Temperature

Implemented: mpcalc.equivalent_potential_temperature

cape_2d

2D CAPE (MCAPE/MCIN/LCL/LFC)

Implemented for single-profile only: mpcalc.cape_cin

cape_3d

3D CAPE and CIN

Implemented for single-profile only: mpcalc.cape_cin

ctt

Cloud Top Temperature

No equivalent (though, unclear how to make a useful generalized formulation)

cloudfrac

Cloud Fraction

No equivalent (though, unclear how to make a useful generalized formulation)

dbz

Reflectivity

Use directly from output

mdbz

Maximum Reflectivity

Use .max('bottom_top') on reflectivity DataArray

geopt/geopotential

Geopotential for the Mass Grid

Field needing WRF-specific processing

geopt_stag

Geopotential for the Vertically Staggered Grid

Field needing WRF-specific processing

helicity

Storm Relative Helicity

Implemented for single-profile only: mpcalc.storm_relative_helicity

lat

Latitude

Use directly from output

lon

Longitude

Use directly from output

omg/omega

Omega

Implemented: mpcalc.vertical_velocity_pressure

p/pres

"Full Model Pressure (in specified units)"

Field needing WRF-specific processing

pressure

Full Model Pressure (hPa)

Field needing WRF-specific processing

pvo

Potential Vorticity

Implemented: mpcalc.potential_vorticity_baroclinic

pw

Precipitable Water

Implemented for single-profile only: mpcalc.precipitable_water

rh

Relative Humidity

Implemented: mpcalc.relative_humidity_from_mixing_ratio

rh2

2m Relative Humidity

Implemented: mpcalc.relative_humidity_from_mixing_ratio

slp

Sea Level Pressure

Open PR Pending: Unidata/MetPy#1700

T2

2m Temperature

Field needing WRF-specific processing

ter

Model Terrain Height

Field needing WRF-specific processing

td2

2m Dew Point Temperature

Implemented, but multiple functions possibly needed depending on exact source fields (hopefully will be made easier with Unidata/MetPy#2070)

td

Dew Point Temperature

Implemented, but multiple functions possibly needed depending on exact source fields (hopefully will be made easier with Unidata/MetPy#2070)

tc

Temperature in Celsius

Use .metpy.convert_units('degC') or .pint.to('degC') on temperature DataArray

th/theta

Potential Temperature

Implemented: mpcalc.potential_temperature

temp

Temperature (in specified units)

Field needing WRF-specific processing

tk

Temperature in Kelvin

Field needing WRF-specific processing

times

Times in the File or Sequence

Field needing WRF-specific processing

xtimes

"XTIME Coordinate (if applicable)"

Field needing WRF-specific processing

tv

Virtual Temperature

Implemented: mpcalc.virtual_temperature

twb

Wet Bulb Temperature

Implemented for single-profile only: mpcalc.wet_bulb_temperature

updraft_helicity

Updraft Helicity

Open Issue: Unidata/MetPy#2213

ua

U-component of Wind on Mass Points

Field needing WRF-specific processing

va

V-component of Wind on Mass Points

Field needing WRF-specific processing

wa

W-component of Wind on Mass Points

Field needing WRF-specific processing

uvmet10

"10 m U and V Components of Wind Rotated to Earth Coordinates"

Field needing WRF-specific processing (also, PyProj/cartopy vector transforms could use some helpers with xarray)

uvmet

"U and V Components of Wind Rotated to Earth Coordinates"

Field needing WRF-specific processing (also, PyProj/cartopy vector transforms could use some helpers with xarray)

wspd_wdir

"Wind Speed and Direction (wind_from_direction) in Grid Coordinates"

Implemented: mpcalc.wind_speed and mpcalc.wind_direction

wspd_wdir10

"10m Wind Speed and Direction (wind_from_direction) in Grid Coordinates"

Implemented: mpcalc.wind_speed and mpcalc.wind_direction

uvmet_wspd_wdir

"Wind Speed and Direction (wind_from_direction) Rotated to Earth Coordinates"

Partially implemented: mpcalc.wind_speed and mpcalc.wind_direction (PyProj/cartopy vector transforms could use some helpers with xarray)

uvmet10_wspd_wdir

"10m Wind Speed and Direction (wind_from_direction) Rotated to Earth Coordinates"

Partially implemented: mpcalc.wind_speed and mpcalc.wind_direction (PyProj/cartopy vector transforms could use some helpers with xarray)

z/height

Model Height for Mass Grid

Field needing WRF-specific processing

height_agl

Model Height for Mass Grid (AGL)

Field needing WRF-specific processing

zstag

Model Height for Vertically Staggered Grid

Field needing WRF-specific processing

插值方面

代码语言:javascript
复制
Doable, but too complecated...should be a job for xgcm

还是坐等有结合两者优点的新的wrf处理库出现吧,或者NCAR的大手发力一下把xwrf兼容进去。

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2025-07-03,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 气python风雨 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档