Method 1: Manually remove the points from the data file
This method is good if there are just a few points outside the boundary. After tiling the plot document and the worksheet window, you would enable Track Cursor and click on points in the post map or base map from a data file. Those points are then highlighted in the worksheet, so you can then delete them. When you're all done, save the file and reload the data. Those points will then be removed from the map.
The steps are:
- Create the post map or base map in the plot window (Home | New Map | Post | Post or Home | New Map | Base | Base from Data, select the data file, and click Open).
- Select the post/base map and click Home | Add to Map| Layer | Base, select your BLN file and click Open. Now your polygon is on top of the posted points.
- Click to File | Open, select the data file again, click Open, and the data file opens in the worksheet window.
- In the worksheet window, if your X and Y data columns are not columns A and B, click Data | Data | Assign XYZ Columns to assign the correct columns to your X and Y data.
- Click View | Windows | Tile Vertical to arrange the windows next to each other.
- Enable cursor tracking by clicking Map Tools | Layer Tools | Track Cursor.
- Click in the plot window near one of the points outside the boundary, and that point is highlighted in the worksheet window.
- Click in the worksheet window and edit or delete the point from the worksheet.
- Repeat steps 7 and 8 until you're done removing points.
- Click File | Save As from the worksheet window to save the changes to a new data file.
- Select the Post layer or the Base(vector) layer in the Contents window.
- On the General page in the Properties window, click the Open File button.
- Select the new data file and click Open.
Method 2: Assign NoData to the grid outside the boundary, and identify the points that fall in the blanked areas with Grid Residuals
This method is good if there are a large number of data points outside the boundary, or if you are using Surfer 8 or previous. You will need to grid your data and add a map layer from the grid to your map to do this. It involves using Residuals on a grid with NoData values to create a new data file. The data points that lie in the NoData regions (i.e. outside the polygon) are easy to identify in the new data file.
The steps are:
- Click Home | Grid Data | Grid Data.
- In the Grid Data - Select Data dialog,
- Click Browse, choose your data file, and click Open.
- Set the X, Y, and Z columns.
- Choose your desired Gridding Method from the list on the left.
- Click Skip to End.
- In the Grid Data - <Gridding Method> - Output dialog,
- Click Browse in the NoData Polygon Boundary section, select the grid file, and click Open.
- Give the grid a name.
- Click Save.
- Click Grids | Calculate | Residuals.
- In the Grid Residuals dialog,
- Click Browse in the Input Grid section, select the NoData grid file, and click Open.
- In the XYZ Data section, select the post/base layer from the list, or click Browse, select the data file, and click Open.
- Assign the correct XYZ data columns for the data file.
- Specify a residual column.
- Click OK.
- A worksheet window is opened containing the modified data file. Highlight all the data columns and click Data | Data | Sort.
- Select Residuals from the Sort First By list, toggle Ascending, and click OK.
- Now all the data points that are within the boundary are listed at the top of the worksheet with actual data in the Residuals column.
- Select the first row that does not have data in the Residuals column, scroll down to the last row, press SHIFT and select it.
- Press DELETE to delete all selected rows (which do not have data in the Residuals column).
- Click File | Save As and save this to a new data file. This new data file only has the data points within the boundary.
- Create the post/base map (step 1 above) from this new data file, or load the new data into an existing post/base map (steps 11-13 above).
Method 3: Manually remove the points from the map (base layer only)
This method is good for any number of points, as long as the edges of the boundary are mostly straight in the horizontal and vertical directions. It is only applicable for base maps though. You'll enter the base layer, mass-select the points to remove, and then delete them.
The steps are:
- Create the base map in the plot window (Home | New Map | Base | Base from Data, select the data file, and click Open).
- Select the base map and click Home | Add to Map| Layer | Base, select your BLN file and click Open. Now your polygon is on top of the points.
- Select the base layer.
- Click and drag your mouse around groups of points in the base layer, and press DELETE to delete them.
- If desired, uncheck your axes and use the File | Export command to export your updated map to a new DAT file.
- Extract all Surfer post map points within a polygon
- Interactively edit/remove points from a data set or post map in Surfer
Updated November 10, 2021