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

20020702: Fwd: gpmap questions



Tom,

The GINI access routines are file based, not designed for piped input.
A routine could be written like I did for dcredbook....but it still
will require writing to disk for the calls in $GEMPAK/source/gemlib/im/imgi2gm.f
to work.

The GF driver does increment the file number which is especially useful when
generating a series of gifs from a list of times or forecast times.
The GIF driver will overwrite the previous file.

The best way to generate gifs automatically is to use 2 pqact.conf actions.
One to FILE -close the data. The second to EXEC a script which will create the 
gif,

The gpanot and gptext programs can both be used to place text more generally
than the gpmap program, so it may be easier to use them to overlay your desired 
text.

I use an EXEC line to generate a GIF of our local N0R image. The script employs 
a
locking mechanism so that only one instance of the script runs at a time
(prevents overloading the system when getting a backlog of data). The scripts 
looks like:

#!/bin/csh -f
#
# set a reasonable path
setenv PATH /bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/ucb:.:/usr/local/ldm/bin
#
# add runtime library paths if needed
setenv LD_LIBRARY_PATH /usr/openwin/lib:/usr/dt/lib:/opt/SUNWspro/lib
#
# add the GEMPAK environment
source /home/gempak/Gemenviron
#
# set the display if you are using the GF driver. Not needed for GIF driver.
setenv DISPLAY laraine:1   
#
#
# These argiments are passed in the exec line....The input fiole name and
# output gif file name
set FILENAME=$1
set GIFFILE=$2

#
# this iw the work directory
cd /usr/local/ldm/data/gempak/web
#
# set a lock and make sure we are the first...wait until free...or 10 minutes
set LOCK=.inuse.$$
touch $LOCK
sleep 5

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

if(-e $GIFFILE) then
   rm -f $GIFFILE
endif


#########
# insert appropriate product generation lines here
#########

# can remore original file if necessary
rm -f ${FILENAME}

# remove lock file to allow other invocations to run
rm -f $LOCK

exit 0



Steve Chiswell



>From: Tom Grzelak <address@hidden>
>Organization: UCAR/Unidata
>Keywords: 200207022216.g62MGWu05327

>
>Hi ya!
>
>We are particularly interested in the second question.  As especially, with 
>the new 1km mosaics.
>
>Thanks for any help you can provide on these.
>Tom
>
>
>>Organization: UCAR/Unidata
>>Keywords: 200207012006.g61K6Ru21353
>>X-Authentication-Warning: webmail.envsci.rutgers.edu: nobody set sender to 
>>address@hidden using -f
>>Date: Mon,  1 Jul 2002 16:06:26 -0400
>>From: address@hidden
>>To: address@hidden
>>Subject: gpmap questions
>>User-Agent: Internet Messaging Program (IMP) 3.1
>>X-Originating-IP: 165.230.171.84
>>Sender: address@hidden
>>
>>Hi,
>>
>>We are using gempak5.6.f and we are having a couple of problems with some of
>>the settings.
>>
>>First, when we save to a common file name (eg. latest.gif) we would like 
>>to be
>>able to rewrite over this file.  After running the program a few times we
>>notice that it comes up as latest.gif.001 then latest.gif.002 etc. we
>>understand that we can do a rm command beforehand but is there a way to do it
>>with the call to gpmap to have it overwrite the common file name
>>
>>Second, is there a way to pipe an input file into gpmap directly as 
>>STDIN.  For
>>example fnexrad_1km GINI images files can be acted on by our gpmap script and
>>automatically produce the gif images that we want.  However we dont want to
>>have to save the data first and then act on it using cron.  Is there a way 
>>that
>>the data comes in it, gets piped to our gpmap script and then our gif is
>>produced and the original full GINI image is never being saved.
>>
>>Third, we would like to be able to put the title of the image in the upper 
>>left
>>hand corner of the image.  We set our title with TITLE, but when we set our
>>text settings with TEXT we cannot control the justification.  In other words
>>the title is always centered.  We tried using 1/////L/ (among several other
>>variations) but we were unable to get the title to be justified to the left.
>>
>>any ideas?
>>
>>Thanks
>>Mohammed Ghani
>
>===============================================================
>Tom Grzelak                          address@hidden
>Senior Systems Administrator
>  ----> Center for Environmental Prediction
>  ----> Department of Environmental Sciences
>
>Rutgers University
>14 College Farm Road                    Voice: 732-932-4923
>New Brunswick, NJ 08901-8551            Fax: 732-932-8644
>                 http://www.envsci.rutgers.edu
>===============================================================
>