从grib天气模型中提取数据 [英] Extract data from grib weather model
问题描述
我已经从 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.
- 这些值以其他单位表示(例如K代表温度,其他单位与mm的降雨量不同)
- 我能够导出
CSV
,但仅导出值而不是坐标
- the values comes in other units (like K for temp and other different from mm in rainfall)
- I am able to export
CSV
but only the values not the coordinates
我想做的是:
- extract data from grib file via the command line via latitude longitude
- extract data an move to a
MySQL
database to be able to do some data aggregation (sum, max, min) etc - 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项目xarray
和eccodes
软件的基于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屋!