You can substitute the data in an area of one grid with data from a second grid using Surfer's Grid Mosaic feature. For example, you can replace the data inside a lake boundary of a DEM file with bathymetric data.
Surfer 3D surface maps showing bathymetry and terrain grids that can be merged
using the Grids | Resize | Mosaic Command.
using the Grids | Resize | Mosaic Command.
To complete the merge, the easiest way is to use Grid Mosaic. Follow the steps below:
- Click Grids | Resize | Mosaic.
- In the Open Grid(s) dialog, select the first grid file and click Open. The first grid file should be the grid that contains data you want replaced.
- In the Grid Mosaic dialog, click the Add button.
- In the Open Grid(s) dialog, select the second grid file and click Open. The second grid file should be the grid that contains the replacement data.
- Click the current value in the Overlap Method field and select Last. This will use the data from the second grid (the last grid in the list) to create the output grid file where the two grids overlap.
- In the Output Grid File field, enter a name for the new grid file and then click OK.
Surfer 3D surface map of combined terrain and elevation grids.
Data in one grid can also be replaced by data in another grid by assigning a NoData value to the area of interest in the first grid and then using Grid Math to substitute the NoData value with the data from the second grid.
These are the steps:
- Assign a NoData value to the area you want to replace in the first file. The first step is to create a polygon of the boundary. This could be drawn on a map as a polygon in a base layer, or saved in a vector file format (e.g. DXF, SHP, or BLN). For tips on creating a BLN file, please see: How can I create a BLN file in Surfer? Once you have the area either as a polygon in a base layer in the map, or in vector format, go to Grids | Edit | Assign NoData, select the Input Grid and NoData Polygon Boundary, toggle the desired NoData option, specify a name for the new grid file and click Save. The new grid file will be created. You might want to create a map from this grid to verify that the area you want (and expect) to have NoData, actually has NoData.
- Use Grids | Calculate | Math to substitute the NoData value (or whatever unique value you used above) in the blanked grid file with the data from the second grid.
- Click Grids | Calculate | Math.
- In the Grid Math dialog, click the Add Grids button, hold the CTRL key on the keyboard, select both grids, and click Open. The following steps are assume grid A is the grid that contains the area you want to replace, and grid B is the grid that contains the data that you want to use.
- In the Input Grids table next to grid A, click in the NoData Handling field and select Remap to:
- Enter -999 (or any unique value) in the Remap Value field.
- If the second grid also has areas with NoData values also, then:
- Select grid A and click the Grid Info button.
- In the Grid Information report, scroll down and copy the Minimum for the Z value.
- Close the report window.
- In the Input Grids table next to grid B, click in the NoData Handling field and select Remap to:
- Enter the Z minimum value in the Remap Value field.
- Enter the function: IF(A=-999, B, A). Where A is the blanked grid, B is the grid with the data you want to use to replace, and -999 is the unique value assigned in step 4.
- Click OK and the new grid is created. This grid will have the data from the second grid file inside the boundary of the first grid file.
Updated November, 2021
Comments
Please sign in to leave a comment.