windows下wgribwgrib2和python读取grib2数据
windows下没有api可以直接读grib或者grib2的数据。所以下载wgrib或者wgrib2来读grib数据。wgrib可以读grib1格式(.grb)的数据,wgrib2可以读grib2格式(.grib)的数据,根据不同格式的数据选择下载wgrib或者wgrib2
1.wgrib和wgrib2下载
wgrib,下载地址:ftp://v/wd51we/wgrib
wgrib2,下载地址:ftp://v/wd51we/wgrib2(64位系统⽤
ftp://v/wd51we/wgrib2/Windows_64/)
到对应的版本,下载速度⽐较慢,请耐⼼等待。。。
下载完成后把所有⽂件放到同⼀个⽂件夹下,⽐如wgrib⽂件可以都放在wgrib⽂件夹下,wgrib2⽂件可以都放在wgrib2⽂件夹下2.wgrib和wgrib2设置
wgrib和wgrib2是不需要安装的,只需要在环境变量⾥进⾏设置。
右键此电脑,点击属性
点击⾼级系统设置
点击环境变量
在系统变量⾥到Path,点击编辑
点击新建,然后把wgrib和wgrib2的路径输⼊进去3.验证是否设置成功
同时按下windows和R键,输⼊cmd,点击确定
输⼊wgrib2
显⽰出wgrib2的使⽤说明,说明设置成功
4. 读取grib和grib2数据
4.1使⽤wgrib/wgrib2读取数据
-else else else
-elseif_fs elif X elseif X (fixed string) conditional execution
-elseif_n elif X elseif (inv numbers in range), X=(start:end:step)
-elseif_rec elif X elseif (record numbers in range), X=(start:end:step)
-elseif_reg elif X elseif rpn registers defined, X = A, A:B, A:B:C, etc A = register number
-elseif elif X elseif X (POSIX regular expression) conditional on match
-endif endif endif
-if if X if X (POSIX regular expression), conditional execution on match
-
if_fs if X if X (fixed string), conditional execution on match
-if_n if X if (inv numbers in range), X=(start:end:step)
python怎么读文件夹下的文件夹-if_rec if X if (record numbers in range), X=(start:end:step)
-if_reg if X if rpn registers defined, X = A, A:B, A:B:C, etc A = register number
-not_if if X not_if X (regular expression), conditional execution on not match
-not_if_fs if X if X (fixed string) does not match, conditional execution up to next output/fi -0xSec inv X Hex dump of section X (0..8)
-aerosol_size inv optical properties of an aerosol
-aerosol_wavelength inv optical properties of an aerosol
-aerosol_wavelength inv optical properties of an aerosol
-bitmap inv bitmap mode
-center inv center
-checksum inv X CRC checksum of section X (0..8), whole message (X = -1/message) or (X=data)
-disc inv discipline (code table 0.0)
-domain inv find rectangular domain for g2ctl/GrADS plots
-end_ft inv verf time = reference_time + forecast_time + stat. proc time (YYYYMMDDHH) (same as -vt)
-end_FT inv verf time = reference_time + forecast_time + stat. proc time (YYYYMMDDHHMMSS) (same as -VT) -ens inv ensemble information
-ext_name inv extended name, var+qualifiers
-ftime inv either ftime1 or ftime2 dep on version_ftime
-ftime1 inv forecast time
-ftime2 inv timestamp -- will replace -ftime in the future TESTING
-
ftn_api_fn0 inv n npnts nx ny msg_no submsg i11,5(1x,i11)
-full_name inv extended name, var+qualifiers
-gdt inv contents of Grid Definition Template (g2c)
-get_byte inv X Y Z get bytes in Section X, Octet Y, number of bytes Z (decimal format)
-get_hex inv X Y Z get bytes in Section X, Octet Y, number of bytes Z (bytes in hexadecimal format)
-get_ieee inv X Y Z get ieee float in Section X, Octet Y, number of floats Z
-get_int inv X Y Z get 4-byte ints in Section X, Octet Y, number of ints Z
-get_int2 inv X Y Z get 2-byte ints in Section X, Octet Y, number of ints Z
-grib_max_bits inv maximum bits used in grib encoding
-grid inv grid definition
-grid_id inv show values from grid_id
-hybrid inv shows vertical coordinate parameters from Sec4
-ij inv X Y value of field at grid(X,Y) X=1,..,nx Y=1,..,ny (WxText enabled)
-ijlat inv X Y lat,lon and grid value at grid(X,Y) X=1,..,nx Y=1,..,ny (WxText enabled)
-ilat inv X lat,lon and grid value at Xth grid point, X=1,..,npnts (WxText enabled)
-JMA inv inventory for JMA locally defined PDT
-lev inv level (code table 4.5)
-ll2i inv X Y x=lon y=lat, converts to (i), 1..ndata
-ll2ij inv X Y x=lon y=lat, converts lon-lat to (i,j) using gctpc
-lon inv X Y value at grid point nearest lon=X lat=Y (WxText enabled)
-match_inv inv inventory used by -match, -not, -if and -not_if
-Match_inv inv same as -match_inv except d=YYYYMMDDHH <-> D=YYYYMMDDHHmmss
-max inv print maximum value
-min inv print minimum value
-misc inv variable name qualifiers like chemical, ensemble, probability, etc
-MM inv reference time MM
-model_version_date inv prints model date code
-n inv prints out inventory number
-N_ens inv number of ensemble members
-nl inv inserts new line into inventory
-nlons inv number of longitudes for each latitude
-npts inv number of grid points
-nxny inv nx and ny of grid
-
packing inv shows the packing mode (use -v for more details)
-pdt inv Product Definition Table (Code Table 4.0)
-precision inv precision of packing
-print inv X inserts string (X) into inventory
-prob inv probability information
-process inv Process (code table 4.3)
-processid inv process id (locally defined)
-proj4_ij2ll inv X Y X=x Y=y, converts to (i,j) to lon-lat using proj.4 (experimental) we:sn
-proj4_ll2i inv X Y x=lon y=lat, converts to (i) using proj.4 (experimental) 1..ndata
-proj4_ll2ij inv X Y x=lon y=lat, converts lon-lat (i,j) using proj.4 (experimental)
-radius inv radius of Earth
-
range inv print out location of record in bytes, 0 = first byte
-RT inv type of reference Time
-s inv simple inventory
-S inv simple inventory with minutes and seconds (subject to change)
-s2 inv simple inventory .. for testing ftime2
-scale inv scale for packing
-scaling inv scaling for packing (old format)
-scan inv scan order of grid
-Sec_len inv length of various grib sections
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论