ADVANCED SURFER TRICKS for beginners - by Dr.D.
February 8, 2005
READ ALL INSTRUCTIONS BEFORE STARTING!

Last week's exercise revealed a closed basin in which interior elevations appear to be lower than surrounding topography - in other words, the sort of place where a lake should exist in a humid climate.  But there is no lake because a river drains the valley.  Why don't we see this river?  Few (if any) of the data points sampled this narrow, twisting stream.  Surfer permits the use of breaklines and faults - lines that define discontinuities, lows or highs.  This blanking file can be used to prevent points from one side of this river from being used to calculate elevations at grid nodes on the other side.  Download and save this file as text - but with the extension bln.

Surfer now handles discontinuities in contours through the use of blanking files.  A blanking file is an ASCII (text) file you can write in Word, "Save As" text - type in the name of the file including the extension .BLN - put quote marks ("space1.BLN", for example) so Word does not tack an extra .txt extension to your file name.

To Do (1): One more time, you are going to generate the map of the Comayagua graben, but this time with a blanking file that shows the location of the river draining this valley.  Data - Grid - open the graben.txt file as last week.  In addition to the other operations at this point, click the Advanced Options button and select Breaklines.  Click the little folder to browse for your blanking file.  Select it, set your grid at 0.5 km or less, generate a new grid and then plot the surface map. 

Change the name of your grid output file or you will overwrite the most recent grid file generated using graben.txt as data.

Note that the valley now has a narrow gorge exiting to the north.

 Format of blanking files for breaklines:

Npoints,flag (Npoints is number of x,y pairs to define boundary or profile, followed by a comma and the number 1.  No space after ,    !!)
X1,Y1,Z1 first coordinate pair and elevation at that point
X2,Y2,Z2 second " " " " " "
(and so on - )
Xn,Yn, Zn last coordinate pair of breakline
Np,Flag begin to define another breakline or fault (skip no lines in .BLN file)

Blanking files can also be used to erase contours from those areas of a map where data have not been collected but where Surfer nevertheless calculates values and plots the results.  Not all maps include rectangular coverage with respect to data. Surfer draws contours even where no observations were made, observations necessary to constrain contours.  Large parts of the rectangular area defined by minimum and maximum X and Y values were not covered as part of this field survey. It is usually a good idea to "erase" those sections of maps where there are no data. This can be done by "blanking" out part of the grid.

In order to link data points and contour maps, plot the post map and the contour map.  Select both maps (click one map, then hold down the shift key and click the other map).  Then, in the Map menu, Overlay Maps.  This will superimpose the data points on the contour map, even if the maps have different limits.

There are also times when cross-sectional views - or profiles - are useful.  The Slice command works like a knife through the grid, returning the value at each point where the slice cuts a row or a column. 

NOTE: both blanking and cross-section (slice) commands operate on the grid file. Commands are part of the GRID menu. Your grid file - the file generated by the DATA - GRID command - must be accessible. BLANK generates a new grid file, and SLICE generates a profile (X,Y,Z) file that can be used as input to Excel.

 For both blanking and slicing, you need to generate first a .BLN file. This is an ASCII (text) file you can write in Word, "Save As" text - type in the name of the file including the extension .BLN - put quote marks ("space1.BLN", for example) so Word does not tack an extra .txt extension to your file name.

 Format of blanking files:

Npoints,flag (Npoints is number of x,y pairs to define boundary or profile, flag 0 means blank outside boundary, 1 means inside boundary. No space after ,    !! - Use 1 for a 'slicing' .BLN file.)
X1,Y1 first coordinate pair of boundary
X2,Y2 second " " " " " "
(and so on - )
Xn,Yn last coordinate pair of boundary - for a polygon, this should be identical to first coordinate pair.
Np,Flag begin to define another boundary (skip no lines in .BLN file) - repeat sequence as needed.

 BLANKing: create a series of polygons by defining corners in grid (x,y) coordinates (do not forget Npoints and flag to start each polygon), run the BLANK command and write a new .GRD file. Use this new file to plot both a contour map and surface map.

A single .bln file can blank several parts of the map.  A single .bln file can slice along several legs - your profile can have jogs in it (not recommended until you are an experienced scientist, or at least until you are doing some serious thesis work and have an advisor to suggest when results look too silly to show to the public.)

CROSS SECTIONS: although it takes only 2 points to define opposite ends of a cross section, you can "dog-leg" cross sections by using 3 or more points (I recommend against that for now - stick to simple cross-sections). A point is generated each time your profile cuts a grid line and an ASCII output file containing all of these points is generated.  

The format for this output file (5 columns) is: X-coordinate, Y-coordinate, Z value, horizontal distance from beginning of cross section, number of "leg". For magnetic field or gradient as a function of distance along a profile, plot column 3 and a function of column 4. Open this output file in Excel, rearrange columns, and plot the profile.

NOTE: if you allow Surfer to use defaults for X and Y min and max and intervals, guessing at values for nodes of the grid can be a real challenge.  If, on the other hand, you have selected integer values for min and max, as an integer or single-digit (0.5 or 0.1) interval value, identifying corners of your blanking polygon or ends of your slice will be easy.

Example: to draw a cross-section from map coordinates (310,4226) to (312, 4221) the .BLN file needed looks like this:

2,1
310,4226
312,4221

Remember, this has to be "saved as" a text file with extension .BLN!!!!  You must save as text file but use quotation marks when typing the file name  -  "profile1.bln" for example.

Note: having nice even values for (x,y) coordinates of grid nodes makes blanking files easier to write and results more predictable.

TO DO (2): Download and save the ASCII file AlMagdat.txt. There are 5 columns: the first 2 represent locations where data were collected, and the second three represent the data: total magnetic field measured 80 cm from the ground, total magnetic field measured 160 cm from the ground, and the magnetic field gradient. 

These data were collected using a magnetometer to investigate an archaeological site

Generate a grid for bottom sensor data, plot a contour map and overlay a post map. Examine your maps - should you set limits on the grid? Can you see the advantage in setting grid (X,Y) limits and grid spacing as nice round numbers when trying to write a .BLN file? Redo the grid and contour map as you see fit. Print a copy. Which parts of the map should be "blanked" out? Write a .BLN file outlining a polygon to do this. Be certain to write the "blanked" grid file with a name different from the grid file upon which you operate! Plot the result - a map with selected parts blanked out! Include your name as part of title to hand in by noon on Monday, February 14. 

Return to Data - Grid and generate grids for the top sensor (column 4) and magnetic field gradient. NOTE: change the grid file (output) names or you will overwrite your earlier .grd files! Note that you can use the same .bln file used above to eliminate contours from those sections of these maps that lack data points. Plot contour maps for top and gradient. Plot also "Surface" maps of all three (bottom, top and gradient). Rotate so that all three are seen from the same perspective.

 SLICE & DICE: Select a nice location for a cross-sectional profile - a profile that runs are almost right angles to the contour lines across an interesting part of the map. Set up a .bln file to "SLICE" the grid for you - and plot the result (gravity as a function of distance along profile) using Excel (or Grapher, if you wish). Include your name in title to hand in.  You must output your slice as a .dat file!  Browse that button when the dialog box appears, select an appropriate location for saving the new file that will be generated.  A data point is generated each time your "cut" crosses a grid line.  The output .dat file is a text (ASCII) file that can be opened in Excel.  The format is: x, y, Z, d, L where x and y are the coordinates of each data point, Z is the value at that point, d is the distance from the beginning of the profile, and L the identification of the line segment (it is possible to slice multiple cross sections with a single .bln file.

Use the text tool to print "Insufficient data" in the blanked part of your map. Use the line tool to show the location of your cross section. Label the ends of the cross section line: A and A' are traditional for the first cross section. A cross section should always be viewed "from the south", with west on the left. A cross section that runs due north should be plotted with south to the left.

Notes: Edit Grid can be used to change "Z" values of individual points on the grid. It is sometimes useful for removing spikes you know are due to noise or errors but where you can not locate the bad data point and remove it from the input to Data-Grid. 

F.Y.I. (not an assignment): A "Classed Post" map plots different symbols for different "Z" values. You can also use the "Post" map to plot "Z" values and contour them yourself! "Center" those labels (POST dialog window)!

F.Y.I. (2): A Post map can also plot labels if those labels are stored in a column associated with their (x,y) coordinates.

--------------------------------------------------------

I have a copy of "Surfer for Windows User's Guide" that gives a lot of other things Surfer can do - like overlay maps generated in other programs with the data. You can check this book out from me for use in Room 3051. Watch what advanced users are doing with various software and ask them to show you how they are doing what they do - students discover tricks I have not yet learned!

Return to Syllabus

Hit Counter