[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GEMPAK #NZZ-240543]: Several questions



> Third question involves plotting lightning data.  I used the example scripts
> on the Gempak tutorial page to help me put together a script to plot the
> lightning data at hourly intervals.  I would like to see a script of how to
> plot the data at 1, 5, and 15 minute intervals.  I am not sure how to
> proceed an am a little confused here with how to set up the script to
> display this.  I'm getting the files at 30 minute intervals but within each
> file you can break down the intervals to at least 5 minutes (I'm hoping for
> 1 minute as well).  So if you could help me on this that would be great.
> 



If you are using SFMAP to plot nldn lightning strikes, you can specify the 
exact time down to 5-min intervals using DATTIM.

Using the GEMPAK tutorial example below ( 
http://www.unidata.ucar.edu/software/gempak/tutorial/answers/exam_5.html ), you 
can see that the variable HOUR is incremented by one for each "while($HOUR <= 
$STOP_HOUR)" loop (as is the variable COLOR).

--------------------------

@ 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

--------------------------

Using the above script as a template, different colors for intervals as small 
as five minute (checking file contents with SFLIST is always advisable) can be 
achieved by incrementing a variable "TIME" by 5-mins rather than the variable 
"HOUR" by 1, as long as SFFILE remains constant (i.e. plot the entire contents 
of one NLDN file in 5-min intervals with diffetent colors).

* please note that this is a simple example and assume that $YMD and $NLDN are 
accounted for prior to this point, and that NDLN file management is taken care 
of (NLDN files are avialable for every 00 and 30 past the hour) - see the first 
line below: defining the NDLN file time of 2000 UTC.

--------------------------

set HOUR = 20
set YMD = 20100614

@ MIN = 0
@ STOP_MIN = 30

@ COLOR=30


while($MIN <= $STOP_MIN)
   set FILE=201006142000_nldn.gem
   set TIMES=`sfctime $FILE`

   foreach TIME ($TIMES)
      sfmap << EOF
      map = 1
      dev = XW
      proj = nps
      area = dset
      filter = no
      clear = no
      text = 1.2/23/1/hw
      title = 5/-1/Lightning Strikes ${TIME}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
      @ MIN = $MIN + 5
      @ COLOR = $COLOR - 1
   end
end

--------------------------


Ticket Details
===================
Ticket ID: NZZ-240543
Department: Support GEMPAK
Priority: Critical
Status: Open