wgrib2: -ncep_norm
Introduction
The GFS model, for example, produces precipitation with a
hard-to-use time step. If you gathered the precip forecasts
from the GFS, it would look like,
$ wgrib2 apcp.grb
1:0:d=2009042400:APCP:surface:0-3 hour acc fcst:
2:3340:d=2009042400:APCP:surface:0-6 hour acc fcst:
3:5534:d=2009042400:APCP:surface:6-9 hour acc fcst:
4:7239:d=2009042400:APCP:surface:6-12 hour acc fcst:
5:9304:d=2009042400:APCP:surface:12-15 hour acc fcst:
6:12378:d=2009042400:APCP:surface:12-18 hour acc fcst:
If you obtained the 6 hourly forecasts, everthing would be
quite useful. But if you obtained the 3 hourly forecasts, you
would notice the averaging period is either 3 or 6 hours. To
create 3-hour accumulations, you can use the
-ncep_norm option.
$ wgrib2 apcp.grb -ncep_norm new_apcp.grb
1:0:d=2009042400:APCP:surface:0-3 hour acc fcst:
2:3340:d=2009042400:APCP:surface:0-6 hour acc fcst:
3:5534:d=2009042400:APCP:surface:6-9 hour acc fcst:
4:7239:d=2009042400:APCP:surface:6-12 hour acc fcst:
5:9304:d=2009042400:APCP:surface:12-15 hour acc fcst:
6:12378:d=2009042400:APCP:surface:12-18 hour acc fcst:
7:14396:d=2009042400:APCP:surface:18-21 hour acc fcst:
$
$ wgrib2 new_apcp.grb
1:0:d=2009042400:APCP:surface:0-3 hour acc fcst:
2:7769:d=2009042400:APCP:surface:3-6 hour acc fcst:
3:13271:d=2009042400:APCP:surface:6-9 hour acc fcst:
4:18773:d=2009042400:APCP:surface:9-12 hour acc fcst:
5:24275:d=2009042400:APCP:surface:12-15 hour acc fcst:
6:32044:d=2009042400:APCP:surface:15-18 hour acc fcst:
7:38301:d=2009042400:APCP:surface:18-21 hour acc fcst:
Usage
-ncep_norm output_file
Conditions
The input grib file must have a very specific format.
Each field must be grouped together in time series format.
That is because the program scans the file in sequential order.
Of course, you can alter the order by the -i
option. For example,
$ wgrib2 -match ':APCP:' mixed_up -vt | sort -t: -k3,3 | \
wgrib2 -i mixed_up -ncep_norm new_apcp.grb
1:0:d=2009042400:APCP:surface:0-0 day acc fcst:
6:26940:d=2009042400:APCP:surface:0-3 hour acc fcst:
11:56805:d=2009042400:APCP:surface:0-6 hour acc fcst:
16:85235:d=2009042400:APCP:surface:6-9 hour acc fcst:
51:281962:d=2009042400:APCP:surface:6-12 hour acc fcst:
61:338477:d=2009042400:APCP:surface:12-15 hour acc fcst:
66:367933:d=2009042400:APCP:surface:12-18 hour acc fcst:
71:396448:d=2009042400:APCP:surface:18-21 hour acc fcst:
...
$ wgrib2 new_apcp.grb
1:0:d=2009042400:APCP:surface:0-3 hour acc fcst:
2:7769:d=2009042400:APCP:surface:3-6 hour acc fcst:
3:13271:d=2009042400:APCP:surface:6-9 hour acc fcst:
4:18773:d=2009042400:APCP:surface:9-12 hour acc fcst:
5:24275:d=2009042400:APCP:surface:12-15 hour acc fcst:
6:32044:d=2009042400:APCP:surface:15-18 hour acc fcst:
7:38301:d=2009042400:APCP:surface:18-21 hour acc fcst:
...
See also:
|