[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 20041207:perl decoder
- Subject: Re: 20041207:perl decoder
- Date: Tue, 7 Dec 2004 16:04:06 -0700 (MST)
On Tue, 7 Dec 2004, Unidata Support wrote:
> Hey Robb, this question has many parts..I am hoping you can answer the perl
> question..jw
> ------- Forwarded Message
>
> >To: Unidata Support <address@hidden>
> >From: "Patrick L. Francis" <address@hidden>
> >Subject: all at once
> >Organization: UCAR/Unidata
> >Keywords: 200412031744.iB3HitlI002009
>
>
> Greetings all :) I hope you are enjoying the snow... here we have
> the cold without the snow!
>
> I've been saving up a few problems/questions to ask all at once instead of
> writing several and bugging in multiple instances.. and as usual if you need
> to login, I have reset username ldm / passwd ldm for you and jweber has
> his account as well.
> -----------
> Problem one... upper air perl decoder.
> ------------
> based upon this email message:
> http://my.unidata.ucar.edu/cgi-bin/getfile?file=/content/support/help/MailArchives/ldm/msg00101.html
>
> I set pqact.gempak on unidata.bgsu.edu to:
> # upper air perl decoder
> DDS|IDS ^U[ABDEFGHIJKLMPQRSTXZ].... .... ([0-3][0-9])
> PIPE /home/ldm/decoders/bin/ua2nc
> etc/ua.cdl
patrick,
there's a new upper cdl called raob.cdl, use it instead of ua.cdl. this
will fix your problem.
robb...
> data/decoded
> (\1:yy)(\1:mm)
>
> the syntax was accepted and runs however i receive this error in the logs:
> Dec 03 17:18:18 unidata pqact[10595]: pipe_prodput: trying again
> Dec 03 17:18:18 unidata pqact[10595]: child 11700 exited with status 127
> Dec 03 17:18:19 unidata pqact[10595]: child 11702 exited with status 127
> Dec 03 17:18:19 unidata pqact[10595]: pbuf_flush (3) write: Broken pipe
> Dec 03 17:18:19 unidata pqact[10595]: pipe_put:
> /home/ldm/decoders/bin/ua2ncetc/ua.cdl/home/ldm/data/decoded0412 write error
> Dec 03 17:18:19 unidata pqact[10595]: pipe_prodput: trying again
> Dec 03 17:18:19 unidata pqact[10595]: pbuf_flush (3) write: Broken pipe
> Dec 03 17:18:19 unidata pqact[10595]: pipe_put:
> /home/ldm/decoders/bin/ua2ncetc/ua.cdl/home/l
>
> i can confirm that everything is located where it should be, and can not
> seem to find out why the error is occurring.
> --------------------------------------
> Problem #2 ... Old Chiz script.
> --------------------------------------
> In digging around the email archives, I found a wonderful old chiz script
> that runs flawlessly, with one exception, and some problems. The easy
> question is since gpwatch no longer exists.. .what do we use for watches?
> the other problem is the creation of an appropriate legend.. meaning..
> the results of the script are currently running and located here:
> http://weather.bgsu.edu/warnings.shtml
> now i attempted to create a legend by making gifs of the various colors
> and putting at the top of the image because i can't seem to make
> gpwarn create a legend by color by warning type. ..
>
> here is the adapted chiz:
> # script location /home/ldm/util/inuse/warn2.csh
> #!/bin/csh -f
> # Sample script to plot current tornado and severe thunderstorm
> ## This script plots the data in a GIF image. It can be easily
> # changed to create a metafile, XWindow, or postscript file.
> #
> # S.Chiswell/Unidata Original
> # P.Bruehl/NWS 7/97 SOO release
> #
>
> # Set the DISPLAY variable to the Xserver that will be used to
> # create the GIF image.
> setenv DISPLAY :1.0
> source /home/gempak/nawips/Gemenviron
> cd /home/ldm/data/gempak/web
> #
> # Define the directory that contains the watch box GEMPAK files
> # decoded by DCWATCH.
> set STORM=/home/ldm/data/gempak/storm/watches
>
> #
> # Define the directory that contains the text thunderstorm,
> # tornado, and windter weather warning files.
> set TORN_WARN=/home/ldm/data/gempak/nwx/watch_warn/torn_warn/
> set TSTRM_WARN=/home/ldm/data/gempak/nwx/watch_warn/tstrm_warn/
> set WNTR_WARN=/home/ldm/data/gempak/nwx/watch_warn/winter/
> set NO_PRECIP=/home/ldm/data/gempak/nwx/watch_warn/noprcp/
> set SEVERE=/home/ldm/data/gempak/nwx/watch_warn/severe/
> set SPECIAL=/home/ldm/data/gempak/nwx/watch_warn/special/
> set FLASHWATCH=/home/ldm/data/gempak/nwx/fflood/watch/
> set FLASHWARN=/home/ldm/data/gempak/nwx/fflood/warn/
> set HAZARDOUT=/home/ldm/data/gempak/nwx/pubprod/hzrd_otlk/
>
> # Get the current date
> set YMD=`date -u '+%y%m%d/%H%M'`
> set DATE=`date -u '+%y%m%d'`
>
> # Don't run gpwarn if NOWARN, Don't run gpwatch if NOWATCH
> set NOWATCH=0
> set NOWARN=0
>
> #
> # Check if any new watches have been decoded today
> # ASSUMES watches are stored in files named watches*.gem, where
> # "*" can be any string (such as watches970716.gem).
> #
> set LATEST=`find $STORM/* -mtime -1 -print`
> if($#LATEST == 0) then
> set NOWATCH=1
> else
> echo $LATEST latest file $YMD
> endif
>
> #
> # Check if any new tornado, thunderstorm, or winter weather warnings
> # have been issued today.
> # ASSUMES warnings are stored in files named *.torn, *.tstrm, *.winter
> # where"*" can be any string (such as 970716.torn).
> #
> set TORNADO=`find $TORN_WARN/*.torn -mtime -1 -print`
> set TSTRM=`find $TSTRM_WARN/*.tstrm -mtime -1 -print`
> set WINTER=`find $WNTR_WARN/*.winter -mtime -1 -print`
> set NONPRECIP=`find $NO_PRECIP/*.noprcp -mtime -1 -print`
> set SEV=`find $SEVERE/*.severe -mtime -1 -print`
> set SPEC=`find $SPECIAL/*.special -mtime -1 -print`
> set FWATCH=`find $FLASHWATCH/*.wtch -mtime -1 -print`
> set FWARN=`find $FLASHWARN/*.warn -mtime -1 -print`
> set HAZARD=`find $HAZARDOUT/*.hzolk -mtime -1 -print`
>
> #
> # Concatentate all existing warning files into one big temporary file.
> set WARN=/tmp/warn.$$
> if(($#TORNADO != 0)||($#TSTRM != 0)||($#WINTER != 0)||($#NONPRECIP !=
> 0)||($#SEV != 0)||($#SPEC != 0)||($#FWATCH != 0)||($#FWARN != 0)||($#HAZARD
> != 0)) then
> cat $WINTER $TSTRM $TORNADO $NONPRECIP $SEV $SPEC $FWATCH $FWARN
> $HAZARD >! $WARN
> endif
>
> #
> # Check for current data. If none, exit
> if((! -e /tmp/warn.$$)||(-z /tmp/warn.$$)) then
> set NOWARN=1
> if(-e /tmp/warn.$$) then
> rm -f /tmp/warn.$$
> endif
> endif
> if(($NOWATCH == 1)&&($NOWARN == 1)) then
> exit
> endif
>
> #
> # Remove previous graphic
> if(-e watch_boxes.gif) then
> rm watch_boxes.gif
> endif
>
> #
> # If watch data exists, plot it
> #
> if($NOWATCH == 0) then
> gpwatch << EOF
> MAP = 0
> GAREA = uslcc
> PROJ = lcc
> SATFIL =
> RADFIL =
> LATLON = 0
> PANEL = 0
> CLEAR = yes
> DEVICE = gf|watch_boxes.gif|975;780
> WWFIL = $LATEST
> WWS = cur
> WWATT = y
> run
>
> exit
> EOF
> endif
>
> #
> # If warning data exists, plot it
> #
> gpwarn << EOF1
> GAREA = uslcc
> PROJ = lcc
> SATFIL =
> RADFIL =
> LATLON = 0
> PANEL = 0
> TITLE = 19/-3/All Current Advisories... Valid $YMD z weather.bgsu.edu
> TEXT = 1.2/1/1
> CLEAR = no
> DEVICE = gf|watch_boxes.gif|975;780
> WWFIL = $WARN
> WWS = current
> WWATT = 120/1400
> IMCBAR = 32/V/LC//.88;.05/1
> run
>
> exit
> EOF1
>
> #
> # Label the graphic
> gpmap << EOF2
> \$mapfil = hipowo.cia
> MAP = 8/1/1
> run
>
> exit
> EOF2
>
> gpend
>
> #
> # Clean up
> rm -r -f *.txt
>
> set webdir = /home/ldm/data/gempak/web/
>
>
> #cp $WARN /home/ldm/data/gempak/web/warnings.txt
> rm $WARN
> cd /home/ldm/data/gempak/web
> #perl -pi -e's/\r//g; s/\n\n+/\n\n/g' *.txt
>
> ncftpput -u XXXXXXX -p XXXXXX weather.bgsu.edu
> /var/www/html/data/warningmap *.gif
> #ncftpput -u XXXXXX -p XXXXXX weather.bgsu.edu
> /var/www/html/data/warningmap *.txt
>
> rm -r -f *.nts
>
> gpend
>
> ---------------
> problem 3 = question
> ----------------
> Since weather.bgsu.edu is feeding off of unidata.bgsu.edu i would
> like to play a little bit... is it possible to have ldm parse/file the data
> by state? sort of an..... well iwin format? currently i have adapted
> the pqact to save the data in text format by type.. for example..
> current tornado warnings sorted in descending order:
> http://weather.bgsu.edu/data/gempak/nwx/watch_warn/torn_warn/?C=M&O=D
>
> however, the ultimate goal is to create an imap for the gpwarn graphic
> where the user could then select his/her state and have associated
> special wx statements/watches/warnings etc..etc...
>
> Thanks for taking the time to read the message and lend assistance :)
>
> hoping for snow!
>
> --patrick
>
> -----------------------------------------------------------------------------------------------------
> Patrick L. Francis Department of Geography Bowling Green State University
> Office 301-F Hanna Hall Phone 419.372.4185 Fax: 419.372.0588
> Web: http://weather.bgsu.edu/
> -----------------------------------------------------------------------------------------------------
> Unidata... not just data, a community :)
> -----------------------------------------------------------------------------------------------------
>
> --
> NOTE: All email exchanges with Unidata User Support are recorded in the
> Unidata inquiry tracking system and then made publicly available
> through the web. If you do not want to have your interactions made
> available in this way, you must let us know in each email you send to us.
>
> ------- End of Forwarded Message
>
===============================================================================
Robb Kambic Unidata Program Center
Software Engineer III Univ. Corp for Atmospheric Research
address@hidden WWW: http://www.unidata.ucar.edu/
===============================================================================