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

Re: 20010503: New VGF product



Glenn,

You can do it in a script.A Or on the command line.

after the foreach line you type in a csh, the "?" prompt is just telling
you that you are within the loop until you type the "end". The actual character
that is used for the second level of nesting is a shell configuration, so it is
different on different machines. 

Steve Chiswell
Unidata User SUpport




On Wed, 16 May 2001, Glenn Rutledge wrote:

> Hi Steve,
> I've compiled the parse pgm.  Several questions.  In order to use it I see 
> you have
> a C shell commands below (%)  showing a way to cycle thru the individual 
> products
> and cat them to the redbook decoder.
> 
> Should I put these commands in a script?  WHen I enter the commands manually, 
> after
> the foreach command I get a ? mark.  I don't know what to do then....   
> Thanks,
> Glenn
> 
> Steve Chiswell wrote:
> 
> > >From: "Glenn Rutledge" <address@hidden>
> > >Organization: NCDC
> > >Keywords: 200105031513.f43FDwp17256
> > >
> > >
> > > Steve,
> > > Thanks much for the redbook soultions.  It's now finally working.  I've
> > > just been asked if I can plot the attached "redbook" graphic file NCDC
> > > receives form the NWS OSO servers (I think).  I can't make any sense of
> > > the data just looking at it (don't know how the create these files, or
> > > wheter they even have headers- I think they concatenate many products
> > > into single files).
> > >
> > > My questions is, how would you try and run the redbook "decoder" on this
> > > file?   Thx much  Glenn
> > >
> > >
> > >
> >
> > Glenn,
> >
> > The GEMPAK redbook graphics library routines are not set up to look
> > for more than 1 product in a file. Also, as you suspected, the file
> > you sent doesn't contain a transmission header like the products on
> > the NOAAPORT broadcast do, so my dcredbook program isn't going
> > to solve your problem.
> >
> > The best solution I can offer you is a short program to dump out the
> > individual redbook graphics products from what I found by looking through
> > the file you sent me. Its an example- you might have to tweak later
> > depending on your data files since I only had a small sample of data to
> > look at. After you dump out the individual redbook graphics
> > to separate files, you can either use dcredbook on each individually
> > to create a separate vgf file, or use GPMAP to draw each graphic to a 
> > common or
> > separate files.
> >
> >
> > The attatchment you sent me had 4 redbook products contained within it.
> > The products (not really a coherent set of products!) were:
> > 1) severe weather reports
> > 2) day2 convective outlook
> > 3) 96 hour 500mb heigh lables
> > 4) 72 hour 500mb heigh lables
> >
> > The separator between each product seemed to be:
> > #### some_numbers ####
> > So, I created the attatched parse.c program (compile with cc -o parse 
> > parse.c)
> > to take the pieces (keying on the 4 "#" characters) and wrap them with
> > a FOS header and trailer and dump out to separate files.
> >
> > Running "parse glenn.dat" (glenn.dat was your attatched file) gives me
> > 4 files:
> > 7408 May 15 12:43 redbook_0.dat
> > 1110 May 15 12:43 redbook_1.dat
> > 6652 May 15 12:43 redbook_2.dat
> > 6478 May 15 12:43 redbook_3.dat
> >
> > From here, I can run each through dcredbook to create vgf files:
> >
> >  % set FILES=`ls redbook_*.dat`
> >  % foreach FILE ($FILES)
> >  %    cat $FILE | dcredbook_vg -d - 'VG|%P-YYYYMMDDHH.vgf'
> >  % end
> >
> >
> > Or, here is an example script for running GPMAP (set the DEVICE to xw, vg 
> > etc
> > depending on your needs!)
> >
> > #!/bin/csh -f
> > #
> > # Sample script to plot all files named redbook_*.dat using gpmap.
> > # Each redbook graphic file will be plotted in a separate color.
> >
> > set FILES=`ls redbook_*.dat`
> >
> > @ CNT = 0
> > @ LINE_COLOR = 6
> >
> > foreach FILE ($FILES)
> >
> > if($CNT == 0) then
> >    set CLEAR=yes
> > else
> >    set CLEAR=no
> > endif
> >
> > gpmap << EOF
> >  MAP      = 1
> >  GAREA    = AFNA
> >  PROJ     = str/90;-105;0
> >  SATFIL   =
> >  RADFIL   =
> >  LATLON   = 0
> >  PANEL    = 0
> >  TITLE    = 1
> >  TEXT     = 1
> >  CLEAR    = $CLEAR
> >  DEVICE   = XW
> >  LUTFIL   =
> >  STNPLT   =
> >  VGFILE   =
> >  AFOSFL   =
> >  AWPSFL   = $FILE
> >  LINE     = $LINE_COLOR
> >  WATCH    =
> >  WARN     =
> >  HRCN     =
> >  ISIG     =
> >  LTNG     =
> >  ATCF     =
> >  AIRM     =
> >  NCON     =
> >  SVRL     =
> >  r
> >
> >  e
> > EOF
> >
> > @ CNT = $CNT + 1
> > @ LINE_COLOR = $LINE_COLOR - 1
> > if($LINE_COLOR == 1) @ LINE_COLOR = 30
> >
> > end
> >
> > ############### end of csh script ##################
> >
> > Hope this helps.
> > Steve Chiswell
> > Unidata User SUpport
> >
> >
> >   ------------------------------------------------------------------------
> >                  Name: parse.c
> >    parse.c       Type: Plain Text (TEXT/PLAIN)
> >              Encoding: BASE64
> >           Description: parse.c
> >
> >                        Name: glenn.dat
> >                        Type: unspecified type (APPLICATION/octet-stream)
> >    glenn.dat       Encoding: BASE64
> >                 Description: glenn.dat
> >             Download Status: Not downloaded with message
> 
>