0

我有兴趣从过去的探测中计算 CAPE。我做了一些测试计算,由于某种原因,我的 CAPE 值与当前探测提供的值不一致。

例如,查看来自巴西 Boa Vista 的最新探测(随机选择 b/c 温暖到足以在 1 月份获得可观的 CAPE)。数据显示 CAPE 为 189 J/kg,而 metapy 给我的值要低得多。具体来说,如果我使用测深中所有压力水平的所有数据,我得到 72 J/kg。相反,如果我只使用标准压力水平(1000、925 等——如下面的代码所示),我得到 1 J/kg。

我在下面复制了我的代码。有人可以帮我弄清楚如何正确地做到这一点吗?

谢谢,纪尧姆

# IMPORT:
import metpy.calc as mpcalc
from metpy.units import units
import numpy as np

# SOUNDING:
p=np.array([1003,925,850,700,500,400,300,200,100])
t=np.array([24.4,20.6,16.4,10.4,-5.3,-15.5,-28.7,-52.3,-79.7])
d=np.array([21.1,20.2,16.3,6.5,-7.0,-25.5,-51.7,-73.3,-87.7])

# UNITS:
p = units.Quantity(p, "hPa")
t = units.Quantity(t, "degC")
d = units.Quantity(d, "degC")

# CALCULATE CAPE:
cape1,cin1 = mpcalc.surface_based_cape_cin(p,t,d)
prof = mpcalc.parcel_profile(p, t[0], d[0])

cape2,cin2 = mpcalc.cape_cin(p,t,d,prof)

print(cape1)
print(cape2)
4

1 回答 1

1

怀俄明州档案中的计算值使用最低 500m的平均值来表示地块进行计算。不幸的是,这不是微不足道的,但可以使用 MetPy 做到这一点:

from datetime import datetime

import metpy.calc as mpcalc
from metpy.units import pandas_dataframe_to_unit_arrays, units
import numpy as np
from siphon.simplewebservice.wyoming import WyomingUpperAir

df = WyomingUpperAir.request_data(datetime(2021, 1, 31, 12), '82022')
data = pandas_dataframe_to_unit_arrays(df)

# Calculate the mixed parcel--need to pass pressure as an additional variable to "mix" so that we get
# an appropriate "average pressure" to use as the mixed parcel
parcel_temp, parcel_dewp, mixed_press = mpcalc.mixed_layer(data['pressure'], data['temperature'],
                                                           data['dewpoint'], data['pressure'],
                                                           height=data['height'], depth=500 * units.m)

# Replace the lowest part of the sounding with the mixed value
press_mixed = np.concatenate([np.atleast_1d(mixed_press), data['pressure'][data['pressure'] < mixed_press]])
temp_mixed = np.concatenate([np.atleast_1d(parcel_temp), data['temperature'][data['pressure'] < mixed_press]])
dewpt_mixed = np.concatenate([np.atleast_1d(parcel_dewp), data['dewpoint'][data['pressure'] < mixed_press]])

# Calculate the parcel profile, including the LCL--this interpolates the sounding to the level of the LCL
# as well, so that the profile and all variables have the same points
p, t, d, prof = mpcalc.parcel_profile_with_lcl(press_mixed, temp_mixed, dewpt_mixed)

lcl_press, lcl_temp = mpcalc.lcl(mixed_press, parcel_temp, parcel_dewp)
cape, cin = mpcalc.cape_cin(p, t, d, prof)

混合到位后,我得到的 LCL 压力/温度值(943.84 hPa 和 20.52 摄氏度)与怀俄明州非常吻合。这给了我 208 J/kg 的 CAPE 和 -16 J/kg 的 CIN,这与怀俄明州报告的结果更加一致。任何差异,特别是对于这种略微不稳定的探测,都可能是由于计算细节的差异,就像最初的差异是由使用浅层混合包裹造成的一样。

这应该是可行的,但由于错误metpy.calc.mixed_layer_cape_cin,目前不适用于非基于压力的深度。

于 2021-02-17T23:01:36.293 回答