Created
July 22, 2017 12:49
-
-
Save TakashiUNUMA/c21abcd9ffb875ca0fd6d265696737e6 to your computer and use it in GitHub Desktop.
A sample handling script in order to extract point data from a grib2 format data.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# extract_grib2_pointdata.sh | |
# | |
# original script was coded by Takashi Unuma, Tsu local meteorological office, Japan Meteorological Agency | |
# last modified: 22nd July 2017 | |
# | |
# requirements: | |
# wgrib2, sed, awk (gawk is also available) | |
# | |
# specify grid point (x,y) of input file, which is able to obtain by typing as follows; | |
# $ wgrib2 -llij [longitude] [latitude] grib2file | |
longrid=583 | |
latgrid=561 | |
# specify input grib2 file (for example, radar echo top data of JMA-RADAR) | |
infile=Z__C_RJTD_20140813150000_RDR_JMAGPV_Gll2p5km_Phhlv_ANAL_grib2.bin | |
# execute | |
# output data will be displayed in your terminal with the format of "YYYYMMDDHH (UTC) Echo top data [km]". | |
wgrib2 -ij ${longrid} ${latgrid} -s ${infile} 2> /dev/null | sed -e "s/\=/ /g" -e "s/:/ /g" | awk '{print $6,$4}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment