爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 98|回复: 3

[求助] 利用metpy画t-lnp图报错

[复制链接]
发表于 昨天 11:49 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
基于metpy画探空图时出现以下问题,其中2023050408是08时的探空资料,0514是利用14时气温和露点订正的资料,我在利用14时数据画图时没有报错,但是利用08时数据时出了这个问题,有没有大神帮忙解答下,万分感谢!图是能显示的,就是在利用My_Class包计算时出现了问题

报错.png

58633_2023050408.csv

3.21 KB, 下载次数: 3, 下载积分: 金钱 -5

数据

58633_2023050414.csv

3.21 KB, 下载次数: 2, 下载积分: 金钱 -5

数据

My_Class.py

27.53 KB, 下载次数: 2, 下载积分: 金钱 -5

计算包

sounding.py

5.94 KB, 下载次数: 2, 下载积分: 金钱 -5

绘图程序

密码修改失败请联系微信:mofangbao
发表于 3 小时前 | 显示全部楼层
本帖最后由 edwardli 于 2025-9-11 20:04 编辑

08.png 14.png

【metpy版本:1.4.1】

全部用你的代码,未报任何错误。都能正常出图。


你的报错,可能是:气压层不单调递增or递减。

密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 3 小时前 来自手机 | 显示全部楼层
We've seen issues like this before with high-resolution data (alluded to in #1339). The problem is that a few levels decrease by ~0.1 hPa and break some assumptions in the code. A work-around is usually to pass the pressure levels through scipy.signal.medfilt to smooth it out ever so slightly.这是官方原文回答。
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

发表于 3 小时前 来自手机 | 显示全部楼层
So as we start to see 1Hz soundings in the wild, we start to see issues with our calculations and the fact that sometimes pressure, as directly reported, is not necessarily monotonically decreasing. For instance, see this sample sounding. There are a couple of spots where the pressure bounces up for a single point by 0.1 hPa. This is not significant, but it does cause things like scipy.integrate.odeint to get angry when integrating with pressure as the independent variable--thus causing cape_cin to bomb out on these soundings.  For these soundings, a med_filt is enough to solve the problem, but I'm not sure that works as a general solution. I'm not really sure what a good general solution is.
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表