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 Grid | Mosaic feature.
using the Grid | Mosaic feature.
To complete the merge, 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:
- Make sure the second grid has the exact same grid extents and resolution as the first grid. If it does not, I suggest clicking Home | Grid Data and re-gridding the data. In the Grid Data dialog, in the Grid Line Geometry section, set the X and Y Minimum and Maximum values and # of Nodes so that they are exactly the same as the first grid file. Click OK to create the new grid file. You could also use Grids | Resize | Mosaic to modify the grid resolution and extents.
- Then, assign a NoData value to the area you want to replace in the first file. The first step is to create a vector or BLN file of the boundary. For tips on creating a BLN file, please see: How can I create a BLN file in Surfer? Once you have the area 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.
- Lastly, 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.
- In the Input Grids table next to grid A, click in the NoData Handling field and select Remap to:
- Enter -999 or a unique value in the Remap Value field.
- Repeat steps 3 & 4 for grid B if the second grid also has area with NoData values.
- 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 June 6, 2018