[gembud] radar troubles

Hello all,

I'm trying to write a script to display radar over Iowa, and am having trouble getting the imagery to show up right. Attached is my script, what the image looks like right now, and the output when I run my script.
If you see anything I'm doing wrong, please let me know.

Thanks so much,
Chris



GIF image
























































Content-Type: text/plain;
 name="output.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="output.txt"

 GRDAREA   Area covered by grid               
 PROJ      Map projection/angles/margins|dr  MER
 KXKY      Number of grid points in x;y      10;10
 CPYFIL    Grid file whose navigation is to   
 GFUNC     Scalar grid                       TMPC
 RADTIM    Radar composite current/dattim     
 RADDUR    Radar time window (minutes prior   
 RADFRQ    Update Frequency                   
 STNFIL    Station information file          SFSTNS.TBL
 RADMODE   Radar operational mode             
 SATFIL    Satellite image filename(s)        
 COMPRESS  Write output in compressed forma   
 Parameters requested: GRDAREA,PROJ,KXKY,CPYFIL,GFUNC,RADTIM,RADDUR,RADFRQ,
 STNFIL,RADMODE,SATFIL,COMPRESS.
 GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> 
GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> 
GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> 
GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> [NEX2GINI 4]  Write image 
080501/1456
 Parameters requested: GRDAREA,PROJ,KXKY,CPYFIL,GFUNC,RADTIM,RADDUR,RADFRQ,
 STNFIL,RADMODE,SATFIL,COMPRESS.
 GEMPAK-NEX2GINI> GEMPAK-NEX2GINI> MAP       Map color/dash/width/filter flag  1
 MSCALE    fgc;bgc;mask/units/lat;hide/valu  0
 GAREA     Graphics area                     WV
 PROJ      Map projection/angles/margins|dr  lcc/40;-100;40
 SATFIL    Satellite image filename(s)       rad_20080501_1400
 RADFIL    Radar image filename(s)            
 IMCBAR    Color/ornt/anch/x;y/ln;wd/freq     
 LATLON    Line color/dash/width/freq/inc/l   
 PANEL     Panel loc/color/dash/width/regn   0
 TITLE     Title color/line/title            1
 TEXT      Size/fnt/wdth/brdr/N-rot/just/hw  1
 CLEAR     Clear screen flag                 YES
 DEVICE    Device|name|x size;y size|color   XW
 LUTFIL    Enhancement lookup table filenam   
 STNPLT    Txtc/txt attr|marker attr|stnfil   
 VGFILE    Vgfile | scale file | attribute    
 AFOSFL    AFOS Graphics File                 
 AWPSFL    AWIPS Graphics File                
 LINE      Color/type/width/label/smth/fltr  3
 WATCH     End time|Wtch clrs|Wtch Tm;Statu   
 WARN      End time|TS;TN;FF clrs|Tm|Lb|Out   
 HRCN      End time|colors|syms|Tm|Lb|Mt|Qw   
 ISIG      End time|colors|Sym|Tm|Id|Mv|Fl    
 LTNG      End time|time ints/colors|marker   
 ATCF      Time|colors|models|Tm|Id|Mv|Mkr|   
 AIRM      Airmet Plotting Attributes         
 NCON      NCON attributes                    
 CSIG      End time|0_Hr;1_Hr;2_Hr;OL clrs|   
 SVRL      End time|SVRL clrs|Tm|Lb|Outline   
 BND       Bnd name/color/fillsiz/fillpat/f   
 TCMG      End time|colors|center             
 QSCT      QuickScat Plotting Attributes      
 WSTM      End time|WN;WT;AD clrs|Tm|Lb|Out   
 WOU       End time|Mrkr and Otln clrs|Tm|L   
 WCN       End time|Mrkr and Otln clrs|Tm|L   
 WCP       End time|Wtch clrs|Tm|Lb|Clr       
 ENCY      Time|colors|models|Tm|Prs|Mkr|Cc   
 FFA       End time|FF;FA clrs|Tm|Lb|Ic|Out   
 WSAT      WindSAT Plotting Attributes        
 ASCT      AScat Plotting Attributes          
 Parameters requested: MAP,MSCALE,GAREA,PROJ,SATFIL,RADFIL,IMCBAR,LATLON,
 PANEL,TITLE,TEXT,CLEAR,DEVICE,LUTFIL,STNPLT,VGFILE,AFOSFL,AWPSFL,LINE,WATCH,
 WARN,HRCN,ISIG,LTNG,ATCF,AIRM,NCON,CSIG,SVRL,BND,TCMG,QSCT,WSTM,WOU,WCN,WCP,
 ENCY,FFA,WSAT,ASCT.
 GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> 
GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> 
GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> 
GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> 
GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> 
GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> 
GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> 
GEMPAK-GPMAP> GEMPAK-GPMAP> GEMPAK-GPMAP> GPMAP PARAMETERS:

 Device:              gif|vis_radar.gif                                         
                                                                      
 Projection:          sat/30.0;-92.9;60.0                                       
                                                                      
 Graphics area name:  40.0;-97.3;43.9;-89.4                                     
                                                                      
 Map:                 31/1/2 + 2/1/1                                            
                                                                      
 Title:                                                                         
                                                                      
 Panel:               0                                                         
                                                                      
 Latlon:              0                                                         
                                                                      
 Clear:               YES
Enter <cr> to accept parameters or type EXIT: Parameters requested: 
MAP,MSCALE,GAREA,PROJ,SATFIL,RADFIL,IMCBAR,LATLON,
 PANEL,TITLE,TEXT,CLEAR,DEVICE,LUTFIL,STNPLT,VGFILE,AFOSFL,AWPSFL,LINE,WATCH,
 WARN,HRCN,ISIG,LTNG,ATCF,AIRM,NCON,CSIG,SVRL,BND,TCMG,QSCT,WSTM,WOU,WCN,WCP,
 ENCY,FFA,WSAT,ASCT.
 GEMPAK-GPMAP> PANEL     Panel loc/color/dash/width/regn   0
 COLORS    Color list                        1
 TEXT      Size/fnt/wdth/brdr/N-rot/just/hw  1.5/22/hw
 CLEAR     Clear screen flag                 y
 DEVICE    Device|name|x size;y size|color   gif|vis_radar.gif
 TXTFIL    Text filename or LOGO|size|mode    
 TXTLOC    Text location                      
 COLUMN    Number of columns                 1
 Parameters requested: PANEL,COLORS,TEXT,CLEAR,DEVICE,TXTFIL,TXTLOC,COLUMN.
 GEMPAK-GPTEXT> GEMPAK-GPTEXT> GEMPAK-GPTEXT> GEMPAK-GPTEXT> GEMPAK-GPTEXT> 
GEMPAK-GPTEXT> GEMPAK-GPTEXT> GEMPAK-GPTEXT> GPTEXT PARAMETERS:

 Device:        gif|vis_radar.gif                                               
                                                                
 Text file:     /home/gempak/scripts/storm.txt                                  
                                                                
 Text location: .01;.03                                                         
                                                                
 Panel:         0                                                               
                                                                
 Num Columns    1                                                               
                                                                
 Clear:         NO 
Enter <cr> to accept parameters or type EXIT: Parameters requested: 
PANEL,COLORS,TEXT,CLEAR,DEVICE,TXTFIL,TXTLOC,COLUMN.
 GEMPAK-GPTEXT>
# This script will plot radar
# over Iowa for the visitors center pages
# for the most recent available data.
#
#
#----------------------------------------------------------------------
#
# Make a working directory for this script and move there
#
cd /home/gempak/scripts

mkdir radarwork

cd radarwork

source /home/gempak/NAWIPS/Gemenviron

#
#----------------------------------------------------------------------
#
setenv DISPLAY anemos.storm.uni.edu:1.0

#-----------------------------------------------------------------------
# Set time information. This stuff should be parsed automatically
# and should not require any mods. Look down below for changing
# this script to fit additional applications.

#   get all the date/time information for real-time
#
#       first get the "real" time for the image titles

        set HR=`date "+%H"`
        set day=`date "+%a"`
        set mon=`date "+%b"`
        set year=`date "+%Y"`
        set date=`date "+%e"`


if ( $HR == 00 || $HR > 12 ) then
        if ( $HR == 00 ) set hour=12
        if ( $HR == 13 ) set hour=1
        if ( $HR == 14 ) set hour=2
        if ( $HR == 15 ) set hour=3
        if ( $HR == 16 ) set hour=4
        if ( $HR == 17 ) set hour=5
        if ( $HR == 18 ) set hour=6
        if ( $HR == 19 ) set hour=7
        if ( $HR == 20 ) set hour=8
        if ( $HR == 21 ) set hour=9
        if ( $HR == 22 ) set hour=10
        if ( $HR == 23 ) set hour=11
else
        set hour=$HR
endif

#---------------------------------------
#       next, get the UTC times set

    setenv TZ UTC
    set cc=`date "+%Y" | cut -c 1-2`
    set yy=`date "+%y"`
    set mm=`date "+%m"`
    set dd=`date "+%d"`
    set hh=`date "+%H"`

    set realtime_flag=T

#----------------------------------------------------------------------
#
# Set the AM/PM variable ***CHANGE THIS SAVINGS TIME****

if ( $hh == 05 || $hh == 06 || $hh == 07 || $hh == 08 || $hh == 09 || $hh == 10 
|| $hh == 11 || $hh == 12 || $hh == 13 || $hh == 14 || $hh == 15 || $hh == 16 ) 
then
        set xm=am
else
        set xm=pm
endif

#--------------------------------------------
#Get month name

if ( $mm == "01" ) set mon=JAN
if ( $mm == "02" ) set mon=FEB
if ( $mm == "03" ) set mon=MAR
if ( $mm == "04" ) set mon=APR
if ( $mm == "05" ) set mon=MAY
if ( $mm == "06" ) set mon=JUN
if ( $mm == "07" ) set mon=JUL
if ( $mm == "08" ) set mon=AUG
if ( $mm == "09" ) set mon=SEP
if ( $mm == "10" ) set mon=OCT
if ( $mm == "11" ) set mon=NOV
if ( $mm == "12" ) set mon=DEC


#--------------------------------------------------------------------
#
#  Customize shell variables here...
#
#--------------------------------------------------------------------

#  Build all the variables that use times.

set dattim=${yy}${mm}${dd}/${hh}00

set sffile=/space/data/ldm/gempak/surface/${cc}${yy}${mm}${dd}_sao.gem

set datelabel="${hour}:00$xm $day  $date $mon $year"

#--------------------------------------------------------------------
#
#  Set the output plot file
#
#--------------------------------------------------------------------

# Set the GIF file names.

    set tmpgif=vis_radar.gif
    set finalgif=/home/gempak/scripts/transfer/vis_radar.gif

# Do minimal error checking - verify the gempak file is there.

if ( ! -e $sffile ) then
   echo "GEMPAK file $sffile does not exist. "

endif

#-------------------------------------------------------
#
# Run the gempak program(s)
#
#       Make a Surface Temps Map
#-------------------------------------------------------

nex2gini<<NEX2GINI_FLAG

 GRDAREA  = 23;-120;47.2634;-63.5664
 PROJ     = lcc/40;-100;40
 KXKY     = 4736;3000
 CPYFIL   =
 GFUNC    = n0r
 RADTIM   = current
 RADDUR   = 30
 RADFRQ   =
 STNFIL   = nexrad.tbl
 RADMODE  = pc
 SATFIL   = rad_${cc}${yy}${mm}${dd}_${hh}00
 COMPRESS =

run

exit

NEX2GINI_FLAG

#------------------------------------------------------------
#
#  Now plot the gol dern thing

gpmap<<GPMAP_FLAG

 MAP      = 31/1/2 + 2/1/1
 GAREA    = 40.0;-97.3;43.9;-89.4
 PROJ     = sat/30.0;-92.9;60.0
 SATFIL   = rad_${cc}${yy}${mm}${dd}_${hh}00
 RADFIL   = 
 IMCBAR   = -1/v/cl/.01;.5
 LATLON   = 0
 PANEL    = 0
 TITLE    =
 TEXT     = 1.5/22/hw
 CLEAR    = y
 DEVICE   = gif|$tmpgif
 LUTFIL   =
 STNPLT   = 31/.65|0|/home/gempak/scripts/sfstns_sat.tbl#3
 VGFILE   =
 AFOSFL   =
 AWPSFL   =
 LINE     =
 WATCH    =
 WARN     =
 HRCN     =
 ISIG     =
 LTNG     =
 ATCF     =
 AIRM     =
 NCON     =
 CSIG     =
 SVRL     =
 BND      =
 TCMG     =
 QSCT     =
 WSTM     =
 WOU      =
 WCN      =
\$mapfil  = histus.nws + hiisus.nws

run

exit

GPMAP_FLAG

#---------------------------------------------------------
# put some STORM text on the thing

gptext<< GPTEXT_FLAG
clear=no
txtfil=/home/gempak/scripts/storm.txt
txtloc=.01;.03
text=1/22/HW
colors=25
column=1

run

GPTEXT_FLAG

gpend


#--------------------------------------------------------------------
# Move the temporary gif to its final resting place.

    mv $tmpgif $finalgif

#-----------------------------------------------------
#
# Back out of working directory and remove it
#
cd ..

#rm -rf radarwork

#---------------------------------------------------END