Python siphon 850hPa温度平流示例不工作

Python siphon 850hPa温度平流示例不工作,python-siphon,Python Siphon,我不熟悉使用python绘制和检查wx数据。我从这个例子开始,它在这个陈述中失败了 ncss = NCSS('{}{dt:%Y%m}/{dt:%Y%m%d}/gfsanl_4_{dt:%Y%m%d}_' '{dt:%H}00_000.grb2'.format(base_url, dt=dt)) 这给了我jupyter笔记本中的以下错误。似乎与XML有关。自创建此示例以来,可能正在使用的文件的数据结构已经更改。任何帮助都将不胜感激 Traceback (most rece

我不熟悉使用python绘制和检查wx数据。我从这个例子开始,它在这个陈述中失败了

ncss = NCSS('{}{dt:%Y%m}/{dt:%Y%m%d}/gfsanl_4_{dt:%Y%m%d}_'
            '{dt:%H}00_000.grb2'.format(base_url, dt=dt))
这给了我jupyter笔记本中的以下错误。似乎与XML有关。自创建此示例以来,可能正在使用的文件的数据结构已经更改。任何帮助都将不胜感激

Traceback (most recent call last):

  File "C:\users\martbar\anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)

  File "<ipython-input-18-1457913792bc>", line 7, in <module>
    '{dt:%H}00_000.grb2'.format(base_url, dt=dt))

  File "C:\users\martbar\anaconda3\lib\site-packages\siphon\http_util.py", line 379, in __init__
    self._get_metadata()

  File "C:\users\martbar\anaconda3\lib\site-packages\siphon\ncss.py", line 58, in _get_metadata
    root = ET.fromstring(meta_xml)

  File "C:\users\martbar\anaconda3\lib\xml\etree\ElementTree.py", line 1316, in XML
    return parser.close()

  File "<string>", line unknown
ParseError: no element found: line 1, column 0
回溯(最近一次呼叫最后一次):
文件“C:\users\martbar\anaconda3\lib\site packages\IPython\core\interactiveshell.py”,第3326行,运行代码
exec(代码对象、self.user\u全局、self.user\n)
文件“”,第7行,在
“{dt:%H}00_000.grb2”。格式(基本url,dt=dt))
文件“C:\users\martbar\anaconda3\lib\site packages\虹吸\http_util.py”,第379行,在\uu init中__
self.\u获取\u元数据()
文件“C:\users\martbar\anaconda3\lib\site packages\虹吸\ncss.py”,第58行,在\u get\u元数据中
root=ET.fromstring(元xml)
文件“C:\users\martbar\anaconda3\lib\xml\etree\ElementTree.py”,第1316行,xml格式
返回parser.close()
文件“”,行未知
ParseError:未找到元素:第1行第0列

发生这种情况是因为该URL已过期。NCEI已经更新了他们的TDS URL,用于
https://www.ncei.noaa.gov/thredds/ncss/grid//
../thredds/ncss/model-/
对于历史数据集,
../model--old/
。因此,在本例中,正确的
base\u url
应该是
https://www.ncei.noaa.gov/thredds/ncss/model-gfs-g4-anl-files-old/

重要的后续说明是,
pythonggallery
example集合已经失效,因此已经过时。更多最新的图库可在上获得,尽管该站点的NCEI TDS URL目前也已过时。希望不会太久