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

20010620: automatic generation of jpeg/gif images in GARP or McIDAS



David,

I answered you previous question in regards to the composite
grids in the FNEXRAD feed. For the rest of the NIDS format data
You can use either "gpmap" or "radmap" to plot the data.

In general, if you create a gif for every product you recieve,
that is going to be a big load. Much less if you only do it for
the floaters. I have a web based "cgi" script to generate images on demand 
for any radar using "radmap_sw" at:
http://motherlode.ucar.edu/unidata/images/nids/nids.html

I use the following LDM pqact.conf actions to store all the NEXRAD data, and 
generate a gif for every FTG radar site N0R and N0V product:

#
# Store Nexrad data in the GEMPAK data tree
NEXRAD  ^SDUS5. .... ([0-3][0-9])([0-2][0-9])([0-6][0-9]).*/p(...)(...)
        FILE    -close  data/gempak/nexrad/NIDS/\5/\4/\4_(\1:yyyy)(\1:mm)\1_\2\3
#
# make some nids gifs
NEXRAD  ^SDUS5. .... ([0-3][0-9])([0-2][0-9])([0-6][0-9]).*/p(N0[RV])(FTG)
        EXEC    util/NEXRAD_gif.csh \5 \4 (\1:yyyy)(\1:mm)\1_\2\3


The script that the LDM execs for creating the FTG gifs is:

#!/bin/csh -f

source /home/gempak/Gemenviron

# Use the following X display for the "gf" device diver.
# The gpmap_gf program can be compiled from $NAWIPS using "make programs_gf".
# gpmap_gf is a version of gpmap that has the gf driver linked in one piece
# so that a separate gplt process is not used. If no X display is available, 
use 
# the standard gpmap with "gif" driver instead. Remember to run gpend if not
# using the _gf version.

setenv DISPLAY laraine:1   # unix:0
setenv LD_LIBRARY_PATH /usr/openwin/lib:/usr/dt/lib:/opt/SUNWspro/lib

set SITE=$1
set TYPE=$2
set DATTIM=$3

set FILENAME=${TYPE}_${DATTIM}
set GIFFILE=${SITE}_${TYPE}_${DATTIM}.gif

# cd to the forking directory
cd /usr/local/ldm/data/gempak/web

#
# Here we create a lock so that only one gif is generated at a
# time, just in case the LDM is started up with a backlog of
# lots of products. We want to be nice to other processes.
#
set LOCK=.inuse.$$
touch $LOCK
sleep 2

@ COUNT = 0
set TEST=`ls -rt .inuse.* | head -1`
while(($TEST != $LOCK)&&($COUNT < 61))
   sleep 10
   set TEST=`ls -rt .inuse.* | head -1`
   if($COUNT == 60) then
      echo "Please check `hostname` on $TEST for nids generation $SITE $TYPE 
$DATTIM" | \
         /usr/bin/mailx -s NIDS ldm@localhost
      rm $LOCK
      exit 0
   endif
   @ COUNT = $COUNT + 1
end

if(-e ${GIFFILE}) rm -f $GIFFILE

set TITLE="NIDS $SITE $TYPE  ${DATTIM}"

if($TYPE == 'N0R') then
   set TITLE="NIDS $SITE Base Reflectivity  ${DATTIM}"
endif
if($TYPE == 'N0V') then
   set TITLE="NIDS $SITE Radial Velocity  ${DATTIM}"
endif
if($TYPE == 'N0S') then
   set TITLE="NIDS $SITE Storm Relative Velocity  ${DATTIM}"
endif

gpmap_gf << EOF
 \$mapfil = hicnus.uni+hipowo.cia+rdus.uni+rdis.uni
 MAP      = 8/1/1+1/1/2+15/1/1+2/1/2
 GAREA    = dset
 PROJ     = rad
 SATFIL   =
 RADFIL   = \$RAD/NIDS/${SITE}/${TYPE}/${FILENAME}
 LATLON   = 0
 PANEL    = 0
 TITLE    = 5/-1/$TITLE
 TEXT     = 1/22/1/hw
 CLEAR    = y
 DEVICE   = gf|${GIFFILE}
 LUTFIL   = default
 !STNPLT   = 5|0|disco_sites.tbl
 r

 e
EOF

#
# move the gif file to the Web tree
set LAST=${SITE}_${TYPE}
if(-e $GIFFILE) then
   if(-e $WEBDIR/$LAST.gif) rm -f $WEBDIR/$LAST.gif
   mv $GIFFILE $WEBDIR/$LAST.gif
endif

exit 0





>From: David Fitzgerald <address@hidden>
>Organization: UCAR/Unidata
>Keywords: 200106201818.f5KIIv109390

>Chiz,
>
>Now that we are getting FNEXRAD and NNEXRAD products, I'd like to create
>either jpeg or gif images and post them to our web site.  I know how to
>create a gif image in garp "by hand" as it were, but how do I automate the
>process in gempak?  Or is McIDAS a better choice for this, and if so how do
>I do it with that?
>
>Thanks!!
>
>
>Dave
>
>**************************************************************************
>David Fitzgerald                       Phone:  717-871-2394
>Distributed System Specialist  Fax:      717-871-4725
>Millersville University                          E-mail:
>address@hidden
>Millersville, PA 17551
>