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

20001117: dcredbook for redbook graphics in the LDM



Mike,

This is a new program I put together for automatically generating
graphics from the redbook files, so its not a suprise that its
not completely clear how to use it yet.

Ok, so you want gif output. I'll start by suggesting that you use
dcredbook_gf (eg this version is linked directly to the gif driver so you 
don't have to worry about running gpend to close the GPLT process).

Second thing you need to generate gif displays is an X server to draw to
(dcredbook_gf uses the gf driver which requires an X server, alternatively,
it could be compiled to use the gif2 driver which doesn't use an X server
but my experience is that the hgardware fonts supplied by the X server look 
much 
better than the software fonts that gif2 will have to use).

Lastly, you will need the environmental variables GEMMAPS and GEMTBL for
the mapfiles and tables that define the redbook products respectively.

You'll see at:
http://www.unidata.ucar.edu/packages/gempak/tutorial/manual/chap6/chap6.shtml?dcredbook
that the filename for the output is a GEMPAK DEVICE definition, not just
a filename. The device, filename, geometry and color options are specified
just as you would in a GEMPAK program.

In order to specify the environmental variables and X server above, I'd suggest 
piping the output to a script, rather than directly to the decoder (unless you 
have these
variables set in the environment of the LDM running process).

So, here is an example of a pqact.conf line:

WMO     ^NOAAPORT\.NWSTG\.GRAPHIC\.P.*
        PIPE     -close /npfos/noaaport/nawips/bin/scripts/dcredbook_gf.csh


So, dcredbook_gf.csh will be a csh script that the graphics will be piped to.

Here is an example of the dcredbook_gf.csh script that works for me.
You can place it in your scripts directory (or wherever) and use
"chmod a+x dcredbook_gf.csh" to make it executable.


<<<<<<<<<<<<<<<---- script starts next line ---->>>>>>>>>>>>>>>>>>>>>>
#!/bin/csh -f

# the source line below will set the locations of your GEMMAPS and GEMTBL
# directories from your Gemviron file
source /npfos/noaaport/nawips/Gemenviron

# To generate gifs using the gf device, you need permission to draw to
# an X server. Otherwise, you could use the gif2 device or ps driver
# as shown below.
setenv DISPLAY unix:0

cd /npfos/noaaport/nawipsdata/redbook

set DATE=`date -u '+%Y%m%d'`
set LOGFILE=/npraid/noaaport/nawips/logs/${DATE}_dcredbook.log

cat | dcredbook_gf -v 1 -d $LOGFILE 'gf|%P_YYYYMMDDHHNN.gif|1280;1024'
exit 0

# The above uses dcredbook_gf. Alternatively, to produce postscript files
# without an X server, you could use:
cat | dcredbook_ps -v 1 -d $LOGFILE 'ps|%P_YYYYMMDDHHNN.ps|8.5;11|C'

#or, to use the gif2 driver, just use the generic dcredbook program
#and run gpend when finished:
cat | dcredbook -v 1 -d $LOGFILE 'gif2|%P_YYYYMMDDHHNN.gif|1280;1024'
gpend
<<<<<<<<<<<<<<<---- script ends previous line ---->>>>>>>>>>>>>>>>>>>>>>



In the above script, the %P in the output file name is replaced with the product
name for each product decoded as defined in $GEMTBL/nafos/redbook.tbl
since the WMO name really doesn't tell you much about what the product is.

all three of dcredbook, dcredbook_ps, and dcredbook_gf are built and installed
in your $GEMEXE directory when you built GEMPAK. When you use either of the
_ps or _gf versions that are directly linked to the driver, you don't have to
run gpend when finished.

When using just the standard dcredbook program, a gplt process is created which 
allows
you to specify any output device that you can normally use as DEVICE in gpmap 
for example.
Just as with gpmap, you will have to run gpend to close the gplt and end the 
output
file.

The DEVICE options for the gif drivers are file output name and gif size.
For the PS driver, you could specicy either 8.5;11 or 11;17 for 
8.5x11" or 11x17" paper respectively. The "C" for the postscript driver uses
COLOR for the lines drawn. Alternately you could use "G" for grayshades or
"M" for monochrome (always black for lines drawn).


I hope this gives you a starting point.

Steve Chiswell
Unidata User Support




>From: address@hidden
>Organization: UCAR/Unidata
>Keywords: 200011171456.eAHEu7o20132

>
>
>
>I am sorry to be so ignorant about decoders, but I am just getting
>into this, and trying to understand how they work.
>
>I want to pipe redbook files directly to dcredbook.
>
>This is my entry in pqact.conf:
>
>WMO     ^NOAAPORT\.NWSTG\.GRAPHIC\.P.*
>        PIPE    /npfos/noaaport/nawips/bin/sol/dcredbook -d
>/npraid/noaaport/nawips/logs/%Y%m%d_dcredbook.log
>                -e GEMTBL=/npfos/noaaport/nawips/gempak/tables
>                /npfos/noaaport/nawipsdata/redbook/YYYYMMDDHHNN.gif
>
>I am getting a log entry:
>
>npfos:/npraid/noaaport/nawips/logs->more 20001117_dcredbook.log
>[26272] 001117/0943 [DC 3]
>
>but do not get an output file.
>
>Can you tell me why?
>
>
>
>                         Thanks
>                              Mike Urzen
>
>
>
>
>
>
>
>
>
>
>
>>From: address@hidden
>>Organization: UCAR/Unidata
>>Keywords: 200011161727.eAGHR2o05005
>
>>
>>
>>Decoder Options.
>>
>>I am looking at the instructions for the dcredbook decoder.
>>
>>Decoder options say for the -p option, "set the parameter packing table."
>>
>>Set it to which table?
>>
>>Same for the -s option.
>>
>>Where can I find documentation on these options?
>>
>>
>>
>>                         Mike Urzen
>>                         NCDC
>>
>>
>>        ****** Signature Tag ******
>>
>>        National Climatic Data Center
>>
>>
>>
>>
>>
>>
>
>
>Mike,
>
>The "dc" model tries to use the same "flags" for all the decoders, so
>printing help "-h" for the decoders gives the same list for all programs
>after the initial description of the individual program.
>
>Some flags are not applicable for all decoders. In this case, dcredbook
>really
>doesn't decode anything, rather, it just creates a plot of the redbook
>graphic
>it receives, similar to the way GPMAP would, only it receives that data
>via standard input rather than a file.
>
>The only flags useful for dcredbook at this time are -e, -v and -d.
>I will update the dcredbook.hlp file to indicate this.
>
>The web page I posted at:
>http://www.unidata.ucar.edu/packages/gempak/examples/redbook/
>shows an example of a pqact.conf pattern action, and script which
>plots the redbook files. The script sources Gemenviron to set up
>the GEMPAK environment needed by the program. In particular, GEMTBL
>and GEMMAPS are used for reading the product name and locating the map
>files respectively. As long as these variables are set in the environment,
>the plotting should be able to produce its product.
>
>Steve Chiswell
>***************************************************************************
>Unidata User Support                                    UCAR Unidata
>(303)497-8644                                                  P.O. Box
>address@hidden                                   Boulder, CO
>---------------------------------------------------------------------------
>Unidata WWW Service                        http://www.unidata.ucar.edu/
><
>***************************************************************************
>
>
>