You can fill in holes of missing data in your grid or DEM file a few different ways in Surfer, depending on what you want to fill the data with.
Option 1. If you want Surfer to interpolate the data
If the data is missing or assigned a NoData value, and you want Surfer to interpolate the data in those areas:
- Click the Grids | Edit | Convert command, select the grid or DEM file and click Open.
- Select to save the grid as a DAT XYZ grid and click Save.
- In the Export Options dialog, if the original grid file had NoData or NULL values, then check the box Don't export nodata nodes (blank nodes). If the original grid did not have any NoData nodes, then it doesn't matter the status of this checkbox. Click OK.
- Click Grids | New Grid | Grid Data to regrid the data using the Kriging gridding method, using the same grid spacing as the original grid or DEM file. Regridding the data will fill in the holes.
Option 2. If you want to fill the areas with a constant value
If the empty areas are filled with NoData values, or any other constant value, and you want to replace that value with a different constant value:
- Click Grids | Calculate | Math.
- In the Grid Math dialog, click Add Grids, select the DEM file and click Open.
- Enter the function IF (A=-9999, 50, A), where:
- -9999 is the current NoData or constant value
- 50 is the value you wish to replace it with
- If you wish to create a map or layer directly from the new grid file, check the box next to Add grid as layer to, and select the map and the new layer type.
- Click OK and the new grid is created, and the map/layer is created if those options were selected.
Option 3. If you want to fill the areas with data from another grid
If those areas are filled with NoData values, and you want to replace the NoData value with data from another grid:
- Click Grids | Calculate | Math.
- In the Grid Math dialog, click Add Grids, select both the DEM file and the other grid file containing the data you want, and click Open.
- Enter the function IF (A=-9999, B, A), where:
- -9999 is the current NoData value in the DEM file (this could also be -32767 or any other value)
- A is the variable for the DEM grid with NULL data
- B is the variable for the grid with the information you want.
- If you wish to create a map or layer directly from the new grid file, check the box next to Add grid as layer to, and select the map and the new layer type.
- Click OK and the new grid is created, and the map/layer is created if those options were selected.
Tips:
- To see the current grid spacing of the DEM, or to find out the NoData value for the DEM, click Grids | Info | Grid Info. Select the DEM as the Input Grid and click OK. The NoData value is displayed on the last line in the header, and the X and Y grid spacing is reported under the Grid Geometry section.
Updated October, 2021
Comments
0 comments
Please sign in to leave a comment.