| 1 | #!/bin/sh |
| 2 | #set -x |
| 3 | |
| 4 | usage() { |
| 5 | echo "Usage: gribview [OPTIONS] grib_path" |
| 6 | echo " -o name of the postscript file" |
| 7 | echo " -e european plot" |
| 8 | echo " -g global plot" |
| 9 | echo " -n use new magics++" |
| 10 | echo " -d turn on the debug messages" |
| 11 | exit 1 |
| 12 | } |
| 13 | |
| 14 | use magics++ > /dev/null |
| 15 | |
| 16 | # set default values |
| 17 | output='magics.ps' |
| 18 | dev='off' |
| 19 | debug='off' |
| 20 | area='globe' |
| 21 | |
| 22 | |
| 23 | while getopts :p:o:degnxh options |
| 24 | do |
| 25 | case $options in |
| 26 | p) |
| 27 | echo "Grib to visualise->" $OPTARG |
| 28 | grib=$OPTARG |
| 29 | ;; |
| 30 | o) |
| 31 | echo "Plot in file->" $OPTARG |
| 32 | output=$OPTARG |
| 33 | ;; |
| 34 | d) |
| 35 | echo "Turn on debug messages" |
| 36 | dev='on' |
| 37 | debug='on' |
| 38 | ;; |
| 39 | e) |
| 40 | echo "Europe Selected" |
| 41 | area="europe" |
| 42 | ;; |
| 43 | g) |
| 44 | echo "globe Selected" |
| 45 | area="globe" |
| 46 | ;; |
| 47 | n) |
| 48 | use newmagics++ > /dev/null |
| 49 | echo "use new magics" |
| 50 | ;; |
| 51 | x) |
| 52 | use magicsX++ > /dev/null |
| 53 | echo "use test magics" |
| 54 | ;; |
| 55 | h) |
| 56 | echo "help" |
| 57 | usage |
| 58 | ;; |
| 59 | '?') |
| 60 | echo "" |
| 61 | echo "ERROR: No grib file was defined!" |
| 62 | echo "" |
| 63 | usage |
| 64 | ;; |
| 65 | esac |
| 66 | done |
| 67 | |
| 68 | shift `expr $OPTIND - 1` |
| 69 | |
| 70 | MAGPLUS_DEV=$dev |
| 71 | MAGPLUS_DEBUG=$debug |
| 72 | |
| 73 | #tv7 $MAGPLUS_HOME/bin/magml -a grib.template -grib=$1 -area=$area -o $output |
| 74 | |
| 75 | magml $MAGPLUS_HOME/share/templates/grib.template -grib=$1 -area=$area -o $output |
| 76 | |
| 77 | gv $output |