Restrict grid results to a specific area in Surfer
You can constrain the gridded area (or contours) to the area inside the data points in Surfer. This article covers all the methods to constrain the data to the data limits while using Grid Data in Surfer via the user interface and automation. If you are interested in the options available to create an irregularly shaped grid after the grid has been created, see Create a irregular-shaped map in Surfer.
The following topics are covered in this article:
- Assign NoData outside the convex hull of data
- Assign NoData outside an alpha shape
- Assign NoData to the grid outside the data limits
- Assign NoData outside several polygons in Surfer
- Use a fault file to define your data limits
- Use a breakline to define a boundary
- Grid the data and specify a reduced search radius
1. Assign NoData outside the convex hull of data
- Click Home | Grid Data | Grid Data.
- In the Grid Data - Select Data dialog, click Browse in the Dataset 1 field, select the data file and click Open.
- Assign the X, Y, and Z data columns.
- Click Skip to End.
- On the Output page of the Grid Data dialog, check the box Assign NoData outside convex hull of data. This automatically assigns the NoData value to the area outside the convex hull of the data points.
Surfer Grid Data dialog with Assign NoData outside convex hull of data option enabled
Use the BlankOutsideHull parameter of the GridData6 method:
SurferApp.GridData6(DataFile:=SurferApp.Path + "\samples\Demogrid.dat", BlankOutsideHull:=True, InflateHull:=-1, OutGrid:="c:\temp\Demo3.grd")
If you wish to constrain the gridding inside an even tighter boundary around your data than the convex hull, you can use one of these methods:
2. Assign NoData outside an alpha shape
Assign NoData to grid nodes outside of an alpha shape directly in the Assign NoData, Grid Data, and Grid from Contours dialogs! The Alpha Shape allows you to create a tight polygon boundary around your data points, much like the existing Convex hull option. The Alpha shape can create a concave or convex hull around data points, you control on how tight the polygon clings around the data limits.
Create an alpha shape and use it to assign NoData values when gridding your data.
Alpha shapes can be applied to a surface in the following ways:
- Created directly in the Grid Data dialog.
- Created directly in the Grid from Contours dialog during grid creation.
- Created in a Base (vector) layer and loaded into the Assign NoData dialog and applied to an existing grid.
Instructions for each method can be found below:
Created directly in the Grid Data dialog:
- Click Home | Grid Data | Grid Data.
- Import the data file and fill out the Grid Data dialog as normal. Learn more in the knowledge base article Gridding Data in Surfer.
- Click Skip to End >> or click Next> until the Grid Data - Output page is showing.
- Change the Assign NoData outside of field to Alpha Shape.
- Change the Alpha value field if desired. The larger the value the more convex the polygon will be, and the smaller the number the move concave the polygon will be.
- Alternatively, if you created an alpha shape in a Base(vector) layer or vector file, import this file into the Assign NoData section.
Created directly in the Grid from Contours dialog:
- Click Grids | New Grid | Grid from Contours.
- Import the data file and fill out the dialog normally. Learn more about the Grid from Contours dialog here.
- In the Options section, change the Assign NoData outside of field to Alpha Shape.
- Update the Alpha value as needed. The larger the value the more convex the polygon will be, and the smaller the number the move concave the polygon will be.
Created in a Base(vector) layer and loaded into the Assign NoData dialog and applied to an existing grid:
- Create your Alpha Shape on existing XYZ data points in a text file. See Introducing the Alpha Shape for specific steps.
- Create your grid if you haven't already. Instructions can be found in the knowledge base article Gridding Data in Surfer or the Surfer Gridding Training Video.
- Click Grids | Edit | Assign NoData.
- Browse to or select your grid in the Input Grid section.
- Browse to or select an Alpha shape contained in an open Base(vector) layer.
- Choose to Assign NoData Inside, Outside, or Mixed. Learn more about the other options in this dialog In Surfer's Help or the Surfer Converting Areas in a Grid File to NoData Training Video.
- Enter a name for the new Output grid and choose whether you'd like to open the new grid as a map or new layer and click OK.
A Video Tutorial detailing Assigning NoData with an Alpha Shape can be found here.
3. Assign NoData to the grid outside the data limits
First, create a vector boundary file (BLN, SHP, DXF, etc.) defining the outline of your data points. After the boundary file is created, grid your data as normal by clicking Home | Grid Data | Grid Data, select the data file and specify any gridding parameters you wish. On the Output page, select your polygon boundary, toggle NoData Outside, and click Finish. Create a BLN boundary file or other vector file defining the outline of your data points.
Assign a NoData polygon boundary to your grid file during gridding in Surfer
4. Assign NoData outside several polygons in Surfer
In Surfer, you can assign NoData values to grid nodes outside multiple polygons. You can do so either using the files directly (without first creating a map) or by creating a map first to view the data and then assigning NoData.
- Click Home | New Map | Contour, select your grid file and click Open.
- Select the map and click Home | Add to Map | Layer | Base.
- Select the file containing the polygons you want to use for assigning NoData and click Open. You can verify that the polygons are in the correct location on the map.
- Click Grids | Edit | Assign NoData.
- In the Assign NoData to Grid dialog:
- Select the grid file used to create the contour map from the Input Grid drop down.
- Select the base layer from the NoData Polygon Boundary drop down.
- Choose NoData Outside for the NoData direction
- Set the Output Grid name and format.
- Check to add the grid back as a layer to the Map, if desired.
- Click OK. The layer is added. You can turn off the original layer (or delete it) in the Contents window.
5. Use a fault file to define your data limits
Create a BLN boundary file that defines the outline of your data points and use it as a fault file during gridding. Click Home | Grid Data | Grid Data, select your data file and specify any gridding parameters you wish. On the Options page of the Grid Data dialog (Advanced Options in Surfer 16 and earlier versions), expand the Faults section, and specify the BLN as a fault file.
Apply a fault file in Surfer's Grid Data Options to limit interpolation to only the data area.
Only some gridding methods support faults. Kriging does not, but Minimum Curvature (very similar to Kriging) does. See the article Available advanced options for each gridding method in Surfer for additional information.
6. Use a breakline to define a boundary
This is most useful when trying to create bathymetry contours for a lake or other closed area. Create a BLN boundary file defining the outline of your data limits (i.e. the lake edge), including a third column values in the BLN file defining the Z values for the breakline itself (for a lake, this could be an elevation of 0 for the lake edge).
- Click Home | Grid Data | Grid Data.
- In the Grid Data - Select Data dialog,
- Choose your data file from the Dataset 1 list on the right, or click Browse, select the data file, and click Open.
- Choose Kriging from the Gridding Method list on the left.
- Verify your X, Y, and Z columns are set appropriately.
- Click Next.
- In the Grid Data - <Gridding Method> - Options dialog,
- Expand the Breaklines section on the right.
- Click the open file icon in the File containing breaklines field.
- Select the BLN file defining your breakline, and click Open.
- Click Skip to End.
- In the Grid Data - <Gridding Method> - Output dialog,
- Enter a name to save the new grid file as.
- Uncheck Add grid as layer to.
- Click Finish
- Click Grids | Edit | Assign NoData.
- In the Input Grid section, click Browse, select the grid file you just created, and click Open.
- In the NoData Polygon Boundary section, select your base map layer from the list, or click Browse, select the vector file, and click Open.
- Toggle NoData Outside.
- Enter a name to save the new grid file as.
- Choose what type of map layer to create from this grid, and what map to add it to.
- Click OK.
7. Grid the data and specify a reduced search radius
Click Home | Grid Data | Grid Data, select your data file and specify any gridding parameters you wish. On the Options page of the Grid Data dialog (Advanced Options in Surfer 16 and earlier versions), Expand the Search Neighborhood section. Remove the check mark from the None (use all data) box if necessary, and specify the Radius 1 and Radius 2 values.
Apply a limited search radius to your data interpolation in Surfer's Grid Data dialog
The default Kriging method offers the Search option. Other methods that offer it include Inverse Distance, Modified Shepard's Method, Nearest Neighbor, Radial Basis, Moving Average, Data Metrics, and Local Polynomial.
Some gridding methods do not have this option, including Minimum Curvature, Natural Neighbor, Polynomial Regression, and Triangulation with Linear Interpolation. See the article Available advanced options for each gridding method in Surfer for additional information.
Related articles: Create a irregular-shaped map in Surfer
Updated August 2023
Comments
0 comments
Please sign in to leave a comment.