EXAM Answer #3
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

# 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'`

# set the current HOUR
set HOUR=`date -u '+%H'`

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

#
# There may be more than 1 NLDN file for each hour...we store ours
# at 30 minute intervals. Alternatively, if more that the maximum number
# of strikes that can be stored in a single file is exceeded, then
# an additional file is opened (see the dcnldn template @@).
# The file naming expected can be one of:
# YYYYMMDDHHNN_@@_nldn.gem
# YYYYMMDDHHNN_nldn.gem
# YYYYMMDDHH_@@_nldn.gem
# YYYYMMDDHH_nldn.gem
set FILES=`ls $NLDN/${YMD}${HOUR}*_nldn.gem`

set CLEAR = yes
if($#FILES > 0) then

   foreach FILE ($FILES)
      # Data may be binned hourly, or at other intervals. We assume 5 minute bins.
      # We could use dattim=all (but that will generate a loop using XW
      # instead, plot the data for each time in the file, setting clear=no
      # after the first time in the file.
      set TIMES=`sfctime $FILE`

      foreach TIME ($TIMES)
      sfmap << EOF
      map = 1
      dev = xw|"lightning strikes"
      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:3:1
      color = 0;30
      dattim = $TIME
      r

      e
EOF
      set CLEAR = no
      end
   end
endif





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