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

20000406: radar gif images



>From: Anthony Rockwood - MSCD Meteorology <address@hidden>
>Organization: .
>Keywords: 200004061519.JAA10909

>Chiz,
>
>We've been working on our gif generator and I'm having problems figuring
>out how file names are defined in your program. My LDM puts the NIDS data
>into /export/data/ldm/nexrad/NIDS and we want our gif files to be written
>to /export/home/archive/public_html/radar.  Can you tell me how I relate
>these names to your code?
>
>Tony
>
> ****************************************************************************
>   Anthony A. Rockwood              Metropolitan State College of Denver    
>   Meteorology Program              Dept.of Earth and Atmospheric Sciences 
>   303.556.8399                     P.O. Box 173362, Campus Box 22
>   address@hidden                Denver, CO  80217-3362                  
>   http://www.mscd.edu/~eas         http://clem.mscd.edu/~rockwooa
> ****************************************************************************
>
>

Tony,
The FILE action I use is:
WSI     
^NEX/(FTG)/(BREF1|VEL1)/..([0-9][0-9])([0-1][0-9])([0-3][0-9])([0-2][0-9])([0-6][0-9])
        FILE    -close  data/gempak/tmp/nids/\2_\1_\3\4\5\6\7.nex

this writes the data file to files named like BREF1_FTG_YYMMDDHHNN.nex in
the /usr/local/ldm/data/gempak/tmp/nids directory. 

The EXEC line I sent, which looked like:
util/NIDS_gif.csh \2_\1_\3\4\5\6\7.nex \1_\2_\3\4\5\6\7.gif

then passes the file name as written above and the desired output name like:
BREF1_FTG_YYMMDDHHNN.nex BREF1_FTG_YYMMDDHHNN.gif

In NIDS_gif.csh, the input .nex string is "FILENAME" and the .gif string
above becomes "GIFFILE".  The script that generates the gif parses out the 
file name pieces to create a more "readable title" with:

# this is the YYMMDD part of $FILENAME
set YMD=`echo $FILENAME | cut -f3 -d_ | cut -c1-6`
#
# this is HHNN of the $FILENAME
set HHMM=`echo $FILENAME | cut -f3 -d_ | cut -c7-10`
#
# this is the product, eg BREF1, VEL1 etc
set TYPE=`echo $FILENAME | cut -f1 -d_`
# 
# this is the radar site, eg FTG
set SITE=`echo $FILENAME | cut -f2 -d_`


A Generic TITLE is created, (using a default first):
set TITLE="NIDS $SITE $TYPE  ${YMD}/${HHMM}"

and, then if the TYPE is known to be BREF, VEL or SRMV, then I create
a product specific title.

When gpmap is run, it uses the $NEX variable to specify the input data 
directory:
setenv NEX /usr/local/ldm/data/gempak/tmp/nids
for you this would be:
setenv NEX /export/data/ldm/nexrad/NIDS

The first argument you pass to NIDS_gif.csh (eg $1 is FILENAME, which
would be your file naming convention you use to store the data).
The second argument is the output GIFFILE name.

The script does a "cd /usr/local/ldm/data/gempak/web" to a working
directory where the gif is originally output. Change this as needed.

For my web access, I wanted to have the gif file always have the same name, eg
TYPE_SITE.gif (without the time in the file name), so that the html line
can just use TYPE_SITE.gif and not have to know what the time is.
This is what the following lines do:
set LAST=`echo $GIFFILE | cut -f1,2 -d_`
if(-e $LAST.gif) then
   rm -f $LAST.gif
endif
mv $GIFFILE $LAST.gif

Since GIFFILE is TYPE_SITE_YYMMDDHHNN.gif, LAST becomes TYPE_SITE.gif, eg
BREF1_FTG.gif, VEL1_FTG.gif (if you pass all the floater nids to this script,
then you would get products for each site) and the GIFFILE gets moved for web 
access. You may want to keep a certain number of GIFS around, like the last 20 
for looping, so you might not want to move
the gif, but rather update a link in your web directory line:
rm $LAST.gif
ln -e $GIFFILE $LAST.gif

The main part of the script allows you to pass the input and output file names,
so nothing is important about the file naming structure there. The creation
of $TITLE used in gpmap and the web name $LAST.gif assume that the parts of the 
file name are separatable using the "_" character in the "cut" command. You can
remove all of this or change as necessary.

The work directory will have to be writable by the LDM so that the .nts files 
and
the .gif file can be written.

Let me know if you need more clarification,

Steve Chiswell