res=new_resrc" and that value can be specified as
"prog.new_resrc:
value" in the resource file or as "-new_resrc=value" on
the command
line. This also works in the name conventions with the
"%{new_resrc}" specification.*data_path:
/mnt/noaaport/nwstg/data:/home/wxp/nwstg/datadepict Weather_Depiction le=sfc :sfc:depict{\
fr [:cf:lab=0:cof=depict.cfl],\
map [co=red],\
cldcv [:cloud],\
cldcl [:data:lc],\
wx [:wx:cl]}
would be this in WXP 6:depict Weather_Depiction 1 :sfc:depict{\
fr [,cf,lab=0,cof=depict.cfl],\
map [co=red],\
cldcv [,cloud,co=white],\
cldcl [,data,lc,co=white],\
wx [,wx,cl,co=yellow]}
helv #-adobe-helvetica-bold-r-normal-*-{24}-*-*-*-*-*-*-*
grib_nam %M/%y%m%d%6h_nam.grb %M/%y%m%d%6h_nam.hdr grib min=420So the line goes: tag, name convention, header file convention, file type, parameter. By specifying the file type here, it eliminates the need to use the "-in" parameter since WXP 6 will know what type of file to use based on the name convention. The type can be prepended by a minimum size for latest file consideration (for backward compatibility with WXP 5). The parameter section adds other information to be used by WXP 6. The "min=420" tells WXP 6 that you have to go back at least 420 minutes (7 hours) to consider a file current. This is used by programs to match times in overlays (see below).
sat_ir_ec %S/%y%m%d%h%15n_geci11.sat - 850000,giniz min=45
nids %{nids_path}/%i/%y%m%d%h%n_%e.nid - nids min=12
nldn %{nldn_path}/%y%m%d%h%n.nldn - noaa
This means the user defined path can be listed in the resource file as
"*nldn_path" or on the command line as "-nldn_path". This
eliminates the need for weird paths such as "watch_path".*model_path: /mnt/noaaport/nwstg/model:/mnt/noaaport/nwstg2/model:/home/wxp/nwstg/modelThe paths will be searched in order to find an available file. The first path is always used for output files.
sat:e:0:-75::1:,0.5,-74.9,1024,1024,0.1266,0.147The ":e" specifies to use an ellipsoidal earth rather than spherical.
sfcplot -pd=ne -mf=-us_relief1.gif,wxp.mapThis tells WXP6 to plot a US relief map as a background. If the image is georeferenced, WXP 6 will automatically remap the image to the plot domain. This eliminates creating tons of background maps.
satplot -mm=ruc,init:2m_ag:temp:C,-10The first parameter is the model to use. The second parameter is the field to use as the mask grid. The last parameter is a fudge factor to be applied to the grid before masking. The satellite image MUST be valued for this to work. GINI images from NOAAPORT are valued by default. The satplot program will allow the user to apply a calibration to the image if one is not directly determined from the input image.
# Import WXP module
use WXP;
# Initialize WXP
WXP::Prog::readResrcFile( "script" );
# Create and initialize an object
$domain = new WXP::Domain;
$sat = new WXP::SatPlot( "nc=sat_ir_nc,ct=sat.clr,cof=0-50" );
$dplot = new WXP::DatumPlot;
$date = new WXP::Date;
$grid = new WXP::Grid;
# Use a static library
WXP::DomainTool::decode( $domain, "us" );
# Draw something
$plot = new WXP::Plot;
$plot->setDomain( $domain );
$sat->draw( $plot );
$plot->setLineColor( "red" );
$plot->drawLine( 10, 25, 15, 40 );
# Use WXP constants
$dplot->draw( $plot, 40, -75, WXP::Datum::MARK, "+", "co=lcyan" );
# Import WXP moduleThe advantage of the API is that you can create objects and work with them independent of a WXP program. This give you more flexibility than just using a program. For example, you can read in a grid from a forecast model and do a set of post processing on it. If this were done in a script using a WXP program, the grid would have to be read in each time. Also, the API gives you more access to graphical functions for annotating plots. It gives you the ability to conditionally generate plots based on the availability of data above and beyond the capabilities of a program.
import WXP
# Initialize WXP
WXP.Prog.readResrcFile( "script" )
# Create and initialize an object
domain = WXP.Domain()
sat = WXP.SatPlot( "nc=sat_ir_nc,ct=sat.clr,cof=0-50" )
dplot = WXP.DatumPlot()
date = WXP.Date()
grid = WXP.Grid()
# Use a static library
WXP.DomainTool.decode( domain, "us" )
# Draw something
plot = WXP.Plot()
plot.setDomain( domain )
sat.draw( plot )
plot.setLineColor( "red" )
plot.drawLine( 10, 25, 15, 40 )
# Use WXP constants
dplot.draw( plot, 40, -75, WXP.Datum.MARK, "+", "co=lcyan" )