Wasmer Consulting Scientific and Engineering Software

Previous  Home  Site Map  Contact  Next

Wasmer Consulting - NMPlot - User's Guide - Command-Line Options


NMPlot User's Guide, Appendix E: Command-Line Options

The name of one or more grid or plot files may be specified on the NMPlot command line. These files will be opened when NMPlot runs. This allows you to associate the extensions .nmp and .grd with the NMPlot application, and invoke NMPlot by double-clicking on a plot or grid file from Microsoft Windows Explorer.

Enclose file names containing spaces with double-quotes, as in...

C:\>nmplot "Sample Grid - Airport Noise.grd"

NMPlot recognizes the following command-line options.

Display Help

Synopsis

-Help

Description

Displays the NMPlot User's Guide.

Example

C:\>nmplot -help

Display a Plot of a Specific Grid

Synopsis

-LoadPlotSetGrid plotfilename gridfilename

Description

Loads the plot file plotfilename, sets the plot's primary grid to gridfilename, saves the modified plot, and then displays the plot. Note that this operation modifies the existing plot file plotfilename.

Example

C:\>nmplot -loadplotsetgrid myplot.nmp mygrid.grd

Comments

This command-line option is for third-party applications that use NMPlot to display graphical output. As an example, consider how a hypothetical numerical model called X might use NMPlot.

X's developers create a plot file named X.nmp that is distributed with X. This plot's options are set appropriately for displaying grid files created by X.

When a user running X requests a contour plot, X performs the following actions.

  1. X creates a grid file named UserCase.grd, where UserCase is the name of the user's current scenario in X.

  2. X copies X.nmp to UserCase.nmp.

  3. X runs NMPlot using the command line:

    nmplot -loadplotsetgrid "UserCase.nmp" "UserCase.grd"

  4. NMPlot displays the plot. The user can use the full power of NMPlot to explore X's predictions.

  5. The user can access the plot later by simply double-clicking on UserCase.nmp. X no longer needs to be running.

Export a Plot in ARC/INFO Shapefile (SHP) Format

Synopsis

-se gridfilename [coordsys plotfilename shapefilename]

Description

Exports a plot in ARC/INFO Shapefile (SHP) format. NMPlot reads the plot from file plotfilename, temporarily sets the plot's primary grid to gridfilename, and exports the plot to a Geographic Information System (GIS) in ARC/INFO Shapefile (SHP) format.

coordsys controls the coordinate system of the Shapefile(s) that are created. If it equals "default", then the primary grid's default coordinate system will be used. Otherwise, coordsys must be the name of an NMPlot coordinate system file. To create a coordinate system file, 1) start NMPlot, 2) choose Export to GIS from the File menu, 3) press the Properties button, 4) choose Export in the Following Coordinate System, 5) press the Browse button to display the Select Coordinate System dialog box, 6) select the desired coordinate system, including the datum, and 7) press the Save To File button, then type the desired file name.

plotfilename is used to specify the plot options: the contour levels, whether geographic annotations are exported, etc. This file is not modified.

shapefilename is a model file name that controls the name(s) of the Shapefile(s) created. This model file name works exactly like the Output Filenames section of NMPlot's Export to GIS dialog box. See Export to GIS Dialog Box for more information.

The last three parameters - coordsys, plotfilename, and shapefilename - are optional. If they do not appear, then their values are constructed by taking gridfilename and changing the file extension to .coordsys, .nmp, and .shp, respectively.

Examples

C:\>nmplot -se mygrid.grd mycoordsys.coordsys myplot.nmp myoutput.shp

C:\>nmplot -se mygrid.grd default myplot.nmp myoutput.shp

C:\>nmplot -se mygrid.grd

Comments

This command line is intended to be used as part of a batch operation. NMPlot will exit after creating the Shapefile(s). See Batch Mode Error Handling for a discussion of how errors are handled while processing this option.

Export a Plot in DXF Format

Synopsis

-ExportToDXF gridfilename plotfilename dxffilename coordsys

Description

Exports a plot in AutoCAD Data Exchange Format (DXF) format. NMPlot reads the plot from file plotfilename, temporarily sets the plot's primary grid to gridfilename, and exports the plot to a Geographic Information System (GIS) in DXF format.

plotfilename is used to specify the plot options: the contour levels, whether geographic annotations are exported, etc. This file is not modified.

dxffilename is the name of the DXF file that will be created.

coordsys controls the coordinate system used for locations in the DXF file. It must be either "Default" for the primary grid's default coordinate system, or "LongLat" for decimal degrees of east longitude and north latitude.

Example

C:\>nmplot -ExportToDXF mygrid.grd myplot.nmp myoutput.dxf LongLat

Comments

This command line is intended to be used as part of a batch operation. NMPlot will exit after creating the DXF file. See Batch Mode Error Handling for a discussion of how errors are handled while processing this option.

Interpolate Grid Data Levels at a List of User-Supplied Points

Synopsis

-pi gridfilename [coordsys pointsfilename resultsfilename]

Description

NMPlot reads the grid from file gridfilename, reads the file pointsfilename (a text file containing a list of point coordinates specified using the coordinate system denoted by the coordsys parameter), determines the grid data level at each point by interpolating into the grid, and then writes the interpolated grid data levels to the text file resultsfilename.

coordsys controls the coordinate system used to specify locations in the points file. If it equals "default", then the primary grid's default coordinate system will be used. Otherwise, coordsys must be the name of an NMPlot coordinate system file. To create a coordinate system file, 1) start NMPlot, 2) choose Export to GIS from the File menu, 3) press the Properties button, 4) choose Export in the Following Coordinate System, 5) press the Browse button to display the Select Coordinate System dialog box, 6) select the desired coordinate system, including the datum, and 7) press the Save To File button, then type the desired file name.

pointsfilename is a simple text file. Its lines specify the points, one per line. Each line consists of three fields, separated by either commas or tab characters. The three fields contain:

  1. A descriptive alphanumeric name for each point

  2. The X coordinate of each point

  3. The Y coordinate of each point

The meaning of the X and Y coordinates will depend on the coordinate system of the points. For example, if the coordinate system is longitude and latitude, X is the longitude and Y is the latitude.

Here is an example points file.

    Baker High School,          -95.2343, 32.4857
    Jackson Junior High School, -95.2938, 32.4492
    St. Mary's Hospital,        -95.3037, 32.5088

resultsfilename is a simple text file. Its lines specify the interpolated grid data levels for each point, one per line, in the same order as the points appear in the points file. Each line consists of two fields, separated by either commas or tab characters (depending on the character used to separate columns in the points file). The two fields contain:

  1. The descriptive alphanumeric name of each point

  2. The interpolated grid data level for each point, or -9999 if the point is located outside of the grid's defined area polygon

Here is an example results file.

    Baker High School,          65.4
    Jackson Junior High School, 62.3
    St. Mary's Hospital,        53.8

The last three parameters - coordsys, pointsfilename, and resultsfilename - are optional. If they do not appear, then their values are constructed by taking gridfilename and changing the file extension to .coordsys, .pts, and .out, respectively.

Examples

C:\>nmplot -pi mygrid.grd mycoordsys.coordsys mypoints.pts results.out

C:\>nmplot -pi mygrid.grd default mypoints.pts results.out

C:\>nmplot -pi mygrid.grd

Comments

This command line is intended to be used as part of a batch operation. NMPlot will exit after creating the results file. See Batch Mode Error Handling for a discussion of how errors are handled while processing this option.

Batch Mode Error Handling

The following command-line options cause NMPlot to open, perform a task, and then shut down.

These options are typically used when NMPlot is being run from a script or as a child process of another application. In this situation, NMPlot enters batch mode, which causes errors to be handled differently. Instead of an error message dialog box appearing, NMPlot writes the error message to a text file and then exits.

If an error does not occur, NMPlot deletes the error message file if it exists. Therefore, after NMPlot exits, the calling script or application can determine if an error occurred by checking for the existence of this file. If the file exists, it will contains a description of the error that occurred.

By default, the error message file is located in the NMPlot home directory (i.e., the same directory as NMPlot.exe), and is named NMPlotBatchErrorFlagFile.txt. If desired, you can specify another name using the -BatchErrorModeFlagFile command-line option. This option should be followed by the desired error message file name.

Important:

If your script or application will be simultaneously running multiple instances of NMPlot, it is strongly suggested that you use -BatchErrorModeFlagFile to specify a different error file for each instance.

In addition to the error file, NMPlot also uses a non-zero return code to indicate that an error occurred.


Previous  Home  Site Map  Contact  Next

Copyright © 1996-2017, Wasmer Consulting
Page URL: http://wasmerconsulting.com/nmplot_usersguide_commandlineoptions.htm
Webmaster e-mail: wasmer@wasmerconsulting.com