| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | #set -x |
| 3 | |
| 4 | usagescip-shell shell shell-project 0.0.0 usage().() { |
| 5 | echoscip-shell system . . echo. "Usage: gribview [OPTIONS] grib_path" |
| 6 | echoscip-shell system . . echo. " -o name of the postscript file" |
| 7 | echoscip-shell system . . echo. " -e european plot" |
| 8 | echoscip-shell system . . echo. " -g global plot" |
| 9 | echoscip-shell system . . echo. " -n use new magics++" |
| 10 | echoscip-shell system . . echo. " -d turn on the debug messages" |
| 11 | exit 1 |
| 12 | } |
| 13 | |
| 14 | use magics++ > /dev/nullscip-shell filesystem . . `/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 | echoscip-shell system . . echo. "Grib to visualise->" $OPTARG |
| 28 | grib=$OPTARG |
| 29 | ;; |
| 30 | o) |
| 31 | echoscip-shell system . . echo. "Plot in file->" $OPTARG |
| 32 | output=$OPTARG |
| 33 | ;; |
| 34 | d) |
| 35 | echoscip-shell system . . echo. "Turn on debug messages" |
| 36 | dev='on' |
| 37 | debug='on' |
| 38 | ;; |
| 39 | e) |
| 40 | echoscip-shell system . . echo. "Europe Selected" |
| 41 | area="europe" |
| 42 | ;; |
| 43 | g) |
| 44 | echoscip-shell system . . echo. "globe Selected" |
| 45 | area="globe" |
| 46 | ;; |
| 47 | n) |
| 48 | use newmagics++ > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 49 | echoscip-shell system . . echo. "use new magics" |
| 50 | ;; |
| 51 | x) |
| 52 | use magicsX++ > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 53 | echoscip-shell system . . echo. "use test magics" |
| 54 | ;; |
| 55 | h) |
| 56 | echoscip-shell system . . echo. "help" |
| 57 | usagescip-shell shell shell-project 0.0.0 usage(). |
| 58 | ;; |
| 59 | '?') |
| 60 | echoscip-shell system . . echo. "" |
| 61 | echoscip-shell system . . echo. "ERROR: No grib file was defined!" |
| 62 | echoscip-shell system . . echo. "" |
| 63 | usagescip-shell shell shell-project 0.0.0 usage(). |
| 64 | ;; |
| 65 | esac |
| 66 | done |
| 67 | |
| 68 | shift `exprscip-shell system . . 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 |