从grib天气模型中提取数据 [英] Extract data from grib weather model

查看:314
本文介绍了从grib天气模型中提取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从 GFS 下载了grib1模型数据,我使用的是Mac OS X并且能够从 NOAA 构建wgrib2文件,但无法提取数据.我没有找到用于MAC的grib1实用程序.

I have downloaded grib1 model data from GFS, I am using a Mac OS X and was able to build the wgrib2 file from NOAA but was unable to extract the data. I have not found a grib1 utility for MAC.

然后我运行该程序 http://www.giss.nasa.gov/tools/panoply/能够读取文件并看到数据,但是我对此有一些疑问.

Then I run to this program http://www.giss.nasa.gov/tools/panoply/ that was able to read the file and can see the data but I have some issues with it.

  1. 这些值以其他单位表示(例如K代表温度,其他单位与mm的降雨量不同)
  2. 我能够导出CSV,但仅导出值而不是坐标
  1. the values comes in other units (like K for temp and other different from mm in rainfall)
  2. I am able to export CSV but only the values not the coordinates

我想做的是:

  1. 通过命令行通过纬度经度从 grib 文件中提取数据
  2. 将数据提取到MySQL数据库中,以便能够进行一些数据汇总(总和,最大,最小)等
  3. 能够绘制/地图数据(我可能会使用 CartoDB 服务)
  1. extract data from grib file via the command line via latitude longitude
  2. extract data an move to a MySQL database to be able to do some data aggregation (sum, max, min) etc
  3. be able to plot / map data (I would probably use CartoDB service)

我已经可以提取grib或可以从特定区域下载,我希望该数据能够在电子表格中看到,例如纬度,经度,温度,降雨,风等...然后从那里可以将其存入数据库,或对/avg等进行求和或处理数据.

I already can extract grib or can download from certain region, I would like that data to be able to see on a spreadsheet for example latitude, longitude, temperature, rainfall, wind etc... then from there I can take it to a database, or sum /avg etc or manipulate data.

样本grib数据文件: https://dl.dropboxusercontent.com/u/104462/neavilag_rain_wind_pressure.grb

根据我的情况,什么是处理我的需求的最佳方法?你能建议我怎么做吗?

Based on my scenario what is the best approach to handle my needs? Can you suggest me what to do?

推荐答案

我建议使用 cfgrib 是基于ECMWF的python项目xarrayeccodes软件的基于python的grib阅读器.

I recommend to use cfgrib which is a python based grib reader based on python project xarray and the eccodes software by the ECMWF.

它非常易于使用:

import cfgrib
cfgrib.open_datasets('your_grib_data.grib2')

xarray附带了许多有用的内置函数.玩得开心!

And xarray comes with a lot of helpful built-in functions. Have fun!

这篇关于从grib天气模型中提取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆