Metpy 和 dewpoint_rh

Metpy and dewpoint_rh

我刚开始在 运行 使用 Metpy 的程序时遇到以下错误:

导入错误:无法从 'metpy.calc'

导入名称 'dewpoint_rh'

昨天我的程序运行良好。

这是代码片段:

from metpy.calc import (bunkers_storm_motion, bulk_shear, 露点, dewpoint_rh, dry_lapse, moist_lapse, vapor_pressure, saturation_vapor_pressure, wind_speed, wind_direction, pressure_to_height_std, mixing_ratio, cape_cin, wind_components, height_to_pressure_std, equivalent_potential_temperature, parcel_profile, precipitable_water, storm_relative_helicity, mean_pressure_weighted, most_unstable_cape_cin, most_unstable_parcel, supercell_composite, significant_tornado, get_layer, relative_humidity_from_dewpoint)

dewpoint_rh 是在 0.12 之前的 MetPy 版本中根据温度和相对湿度计算露点的函数名称。 This changed to dewpoint_from_relative_humidity in v0.12, and the old name was removed in v1.0.

有关 MetPy v1.0 中 API 更改(可能会影响您正在导入的函数的使用)的更多信息,请参阅 MetPy 文档中的 the MetPy 1.0 API Changes guide