Wasmer Consulting Scientific and Engineering Software

Previous  Home  Site Map  Contact  Next

Wasmer Consulting - NMPlot - User's Guide - Working With Grids


NMPlot User's Guide, Chapter 6: Working With Grids

Using NMPlot, you can modify grids in a variety of ways. As an analogy, consider a word processor, which allows you to open, view, edit, save, and rename word processing documents. NMPlot allows you to work with grid files in a similar fashion.

Typically, you will open a grid, modify it by choosing commands from the Grid menu, and then save it by choosing either Save or Save As from the File menu.

Tip:

If you are modifying a grid, but want to preserve the original grid file unchanged, it is recommended that you follow these steps.

  1. Open the grid you want to modify.

  2. Choose Save As from the File menu, and save the grid using a new name.

  3. Make your modifications to the grid.

  4. Choose Save from the File menu to save your modifications.

This does introduce an extra step that is not strictly necessary: you could skip the second step and simply choose Save As after making your modifications. However, it is all too easy to forget and choose Save instead, overwriting the original grid file with the modified version.

When NMPlot modifies a grid, it updates the grid's bookkeeping information with a description of the modifications. The original bookkeeping information is preserved, resulting in an audit trail of changes made to the grid.

Adding a User-Supplied Value to a Grid

NMPlot allows you to add a user-supplied constant to the value of every data point in a grid. To do so, choose Add Value to Grid from the Grid menu. The Add Value to Grid dialog box appears.

Type the value to add, then press OK. The grid is immediately modified.

Invalid data points (i.e., data points with values outside the valid data limits) are not changed.

Multiplying a Grid by a User-Supplied Value

NMPlot allows you to multiply the value of every data point in a grid by a user-supplied constant. To do so, choose Multiply Grid by Value from the Grid menu. The Multiply Grid by Value dialog box appears.

Type the value to multiply by, then press OK. The grid is immediately modified.

Invalid data points (i.e., data points with values outside the valid data limits) are not changed.

Merging Two Grids

Merging refers to creating a new grid that contains the data points from two or more existing grids.

For example, assume that you are modeling the noise levels around an airport with a noise analyses program that can only generate regular rectangular grids. To model the noise adequately, you generate two grids.

The first grid captures the gross structure of the noise over a large area around the airport. It covers an area 20 miles across with a resolution (i.e., a distance between adjacent data points) of 1000 feet. The second grid captures the fine structure of the noise near the airport. It covers an area only two miles across with a finer resolution of 100 feet.

Using NMPlot, you merge these two grids into a single grid. You then plot noise level contours based upon this merged grid. This plot adequately displays the noise levels at all scales of interest.

Caution:

Do not confuse merging grids with combining grids. To insure that you choose the correct action, you should review Combining Two Grids.

Step-by-step Guide To Merging Grids

To merge two or more grids, follow these steps.

  1. Open the first grid.

  2. Choose Save As from the File menu, and give the grid a new name.

  3. Choose Merge Grids from the Grid menu. The Merge Grids dialog box appears.

  4. Type the name of the file containing the second grid. Press the Browse button , located to the right of the text box, to display the Open File dialog box, which allows you to browse for the file.

  5. Press OK. The data points from the second grid are merged into the first grid.

  6. Repeat steps 3 through 5 for any additional grids you want to merge.

  7. Choose Save from the File menu to save the merged grid.

Merging Grids With Different Metrics

If you merge two grids with different metrics or physical units (for example, trying to merge a data set of noise levels with a data set of air pollutant levels), a warning is added to the merged grid.

Caution:

NMPlot does not prevent the merging of grids with different metrics. The decision to allow this was a pragmatic one. It is not uncommon for the same metric to be referred to by different names. For example, one person might refer to the outside temperature as "Air Temperature", while another might use "Ambient Temp.". To facilitate the merging of grids from different sources, NMPlot allows you to merge grids with different metrics. You are responsible for determining whether the metrics are equivalent.

Merging Grids That Cover Different Geographic Areas

NMPlot can merge any two grids. The geographic area covered by the two grids can overlap totally, partially, or not at all. The grids can have different coordinate systems.

The Merged Grid's Defined Area Polygon

The defined area polygon of the merged grid is equal to the union of the two original grids' defined area polygons. That is, the new defined area polygon consists of the geographic area in the first grid's defined area polygon, the second data grid's defined area polygon, or both.

Geographic Annotations

NMPlot does not merge geographic annotations. This capability may be added in the future.

Combining Two Grids

Combining refers to creating a new grid by performing a mathematical operation, such as addition or subtraction, on the data points in two existing grids.

As an example, assume that you have two grids. The first represents the existing levels of an air pollutant across a city, while the second represents the predicted levels a few years in the future, after several proposed changes have been made at local factories. You use NMPlot to subtract the first grid from the second, and display the combined grid using contours on a background map of the city. This contour plot clearly indicates whether a particular neighborhood can expect its air quality to improve or deteriorate.

Caution:

Do not confuse combining grids with merging grids. To insure that you choose the correct action, you should review Merging Two Grids.

Step-by-step Guide To Combining Two Grids

To combine two grids, follow these steps.

  1. Open the first grid.

  2. Choose Save As from the File menu, and give the grid a new name.

  3. Choose Combine Grids from the Grid menu. The Combine Grids dialog box appears.

  4. Type the name of the file containing the second grid. Press the Browse button , located to the right of the text box, to display the Open File dialog box, which allows you to browse for the file.

  5. Select the method for combining the grids. You have five options. In the list of options, P1 and P2 represent grid data values from the first and second grids being combined, respectively.

    • Arithmetic addition   (P1 + P2)

    • Arithmetic subtraction   (P1 - P2)

    • Addition of noise decibels   (10 Log10 (10P1/10 + 10P2/10))

    • Subtraction of noise decibels   (10 Log10 (10P1/10 - 10P2/10))   If P1 <= P2, this function is undefined, and -9999 is returned.

    • Maximum   (max (P1, P2))

  6. Select the method for computing the combined grid's defined area polygon. You have two options.

    • Intersection - The combined grid's defined area polygon is the area covered by both of the two existing grids' defined area polygons. This is the recommended option for most situations.

    • Union - The combined grid's defined area polygon is the area covered by either or both of the two existing grids' defined area polygons.

  7. Select how to handle a grid's data points that are outside the defined area polygon of the other grid. You have two options.

    • Do Not Include The Points - The data points are discarded. This is the recommended option for most situations.

    • Include the Points Unchanged - The data points are included in the combined grid. Their values are not changed.

  8. Type the minimum tolerance distance that must separate two data points in order for them to be considered distinct. If a data point in one grid is located within the tolerance distance of a data point in the other grid, the data points are considered to be at the same location. In this case, only one will appear in the combined grid.

    Typically, the tolerance distance should be set to a small value: 1 meter is a reasonable default value. However, there are situations where you may want to use a larger tolerance. It is recommended that after combining grids, you create a plot of the combined grid and display its grid points. You may see spurious points.

    If this happens, use the Measurement tool to measure the distance between the pairs of points, and set the tolerance to a somewhat larger distance. Then recombine the grids. The spurious points should be gone.

  9. Press OK. The data points from the second grid are combined with those in the first grid.

  10. Choose Save from the File menu to save the combined grid.

Combining Grids That Cover Different Geographic Areas

NMPlot can combine grids that do not have identical data point locations. In this case, interpolation is used to combine the two grids. The geographic areas covered by the two grids do not have to be identical. However, there must be at least some overlap between them. The grids can have different coordinate systems.

Combining Multiple Grids

You may find that you need to combine a large number of grids. For example, in performing a noise analysis of an airport, you may run your noise model once for each type of aircraft, and then sum the individual aircraft grids to create a grid of the total airport noise.

NMPlot provides a tool that streamlines the process of combining a large number of grids. To access it, choose Multiple Grid Combining Tool from the Tools menu.

NMPlot will read each of the specified input grids, combine them using the selected method, and then write the combined grid to the specified output grid file.

Note:

The multiple grid combining tool assumes that each of the input grids covers approximately the same geographical area. The tool uses the intersection method of calculating the combined grid's defined area polygon.

Creating a Plot of a Grid

If you are viewing a grid, you can easily create a plot of it by choosing Create Plot Of This Grid from the Grid menu.


Previous  Home  Site Map  Contact  Next

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