EXAM Answer #5
Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

#!/bin/csh -f

if(x${1} != x) then
   gpmap << SELECT1
      garea = $1
      e
SELECT1
else
  gpmap << SELECT2
     garea = usnps
     proj = nps
     map = 6
     title = 5/-1/Select Map Area
     dev = xw|SELECT_AREA
     clear = y
     \$mapfil = hipowo.gsf
     r

     cursor garea
     e
SELECT2
  gpend
endif

if(x${2} != x) then
   set DEVICE=$2
else
   echo -n "Select an output device (xw,nc,gf) : "
   set DEVICE=$<
endif

set EXT=""
if($DEVICE == nc) then
   set EXT=".nc"
endif
if($DEVICE == gf) then
   set EXT=".gif"
endif

# This is the directory of our lightning data
set NLDN=$GEMDATA/nldn

# set the current year, month day
set YMD=`date -u '+%Y%m%d'`

# get the day of week, month abbrev., day and 4 digit year for title
set TITLE = `date -u '+%A %B %d, %Y'`

# we'll start at hour 0 and loop through hour 23
@ HOUR = 0
@ STOP_HOUR = 23

@ COLOR=30


while($HOUR <= $STOP_HOUR)

   if($HOUR < 10) then
      set SFHOUR=0${HOUR}
   else
      set SFHOUR=${HOUR}
   endif 

   set FILES=`ls $NLDN/${YMD}${SFHOUR}*_nldn.gem`
   if($#FILES > 0) then

   foreach FILE ($FILES)
      set CLEAR = yes
      echo "plotting $FILE"
      set TIMES=`sfctime $FILE`

      foreach TIME ($TIMES)
      sfmap << EOF
      map = 1
      dev = ${DEVICE}|lightning_${YMD}${EXT}
      proj = nps
      area = dset
      filter = no
      clear = $CLEAR
      text = 1.2/23/1/hw
      title = 5/-1/Lightning Strikes  $TITLE ${HOUR}Z
      panel = .02;.02;.97;.97/1/1/4
      sffile = $FILE
      sfparm = sgnl;mark:15:4:1
      color = 0;${COLOR}
      dattim = $TIME
      r
   
      e
EOF
      set CLEAR = no
      end # foreach TIME
   end # foreach file
   endif

   @ HOUR = $HOUR + 1
   @ COLOR = $COLOR - 1
   if($DEVICE == "gf") gpend
end



exit(0)
      

previous page

    
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690