logo

1 303 279 1021

Loading

Live Chat

All Issues

Golden Software Newsletter

Our newsletters are filled with interesting technical tips, news of how people are using Surfer, Grapher, Voxler, MapViewer, Didger and Strater, and (of course!) great illustrations.

Subscribe to Our Newsletter

Issue 59

Creating Voxler Vector Maps from Surfer Grid Files

Several customers have questioned how to make a vector plot in Voxler. A vector plot can be created from a lattice that contains 3 components or it can be created from a data file. The data file requires six data fields: X, Y, Z and 3 components. The component fields should be ordered with first the X component of the vector, then Y component, then Z component. Once the data file is created, you can use the File | Load Data command in Voxler. After the file is imported, you can right click on the data module and choose Graphics Output | VectorPlot to create the map. The data file can be created in any spreadsheet program.

If you have just XYZ data, it can be rather tricky to calculate the vector component columns. The component columns tell the vector the slope, magnitude, and direction of the vectors. This article discusses a way to create this information using our Surfer program. This article assumes that you have Surfer and Voxler and that you are gridding the data in Surfer. If you do not currently own Surfer, you may want to download a copy of the demo version.

Voxler vector and contour maps
Sample Voxler vector map shows vectors pointing in a “downhill” direction.
Map is shown in planar view with additional contour map.

Creating the Grid File and Exported Data File in Surfer
Your original data file should contain 3 columns of data: X, Y, and Z information. For this article, I am using the demogrid.dat data file located in the Samples directory of the Surfer program. This process should work with any data file. If you already have a grid file created, you can skip to step 2.

  1. In a blank Surfer plot window, choose Grid | Data. Select your data file and click Open. In the Grid Data dialog, change any options. Make sure that the GRD file extents, as shown in the Grid Line Geometry section, go beyond the extents that you want for your vector map. Click OK to create the GRD file.
    Grid Data dialog
    The Grid Data dialog allows you to set the Spacing in the
    Grid Line Geometry section to control the extents of the grid file.
  2. Choose Grid | Calculus. Select the GRD file created in step 1. In the Grid Calculus dialog:
    1. Open the Terrain Modeling section and select Terrain Slope.
    2. Click the open folder button next to the Output Grid File section. Type in a File name such as grid-slope. Change the Save as type to ASCII XYZ (*.dat). Click Save.
    3. Click OK in the Grid Calculus dialog.
      Grid Calculus dialog
      Select Terrain Slope on the left side of the dialog. Then, click the
      open folder button next to the
      Output Grid File name to change 
      the file name and format of the resulting file.
  3. Choose Grid | Calculus. Select the GRD file created in step 1. In the Grid Calculus dialog:
    1. Open the Terrain Modeling section and select Terrain Aspect.
    2. Click the open folder button next to the Output Grid File section. Type in a File name such as grid-aspect. Change the Save as type to ASCII XYZ (*.dat). Click Save.
    3. Click OK in the Grid Calculus dialog.
  4. Choose Grid | Convert.
    1. Select the GRD file created in step 1 and click Open.
    2. Change the File name to grid-XYZ. Change the Save as type to ASCII XYZ (*.dat). Click Save.

Worksheet Data Manipulation
Some background may be warranted about the slope and aspect calculations that were performed in steps 2 and 3 above and how they relate to the vector directions. The terrain slope and aspect calculations are given for the gradient direction. Surfer determines which direction has the steepest slope (gradient) and then performs the calculations on that direction. The slope is reported in degrees with zero being horizontal and 90 being vertical. The aspect is a bearing direction that is perpendicular to the contour lines on the surface, and is exactly opposite the gradient direction. The aspect is also reported in degrees with zero being north and 90 being east. It is necessary to convert the aspect bearing direction to a geometric direction where zero is along the positive X axis. This is done below in the transform steps by subtracting the Aspect from 90. Vectors are a combination of aspect and slope.

  1. Choose File | Open. Select the data file created in step 4.
  2. Place the cursor in column D, row 1. Choose File | Import. Select the grid-slope file created in step 2. Click Open. The data is imported into the current worksheet.
  3. Place the cursor in column G, row 1. Choose File | Import. Select the grid-aspect file created in step 3. ClickOpen. The data is imported into the current worksheet.
  4. Highlight columns D and E. These are duplicate columns of XY data. Choose Edit | Delete to remove them.
  5. Highlight columns E and F. Again, these are duplicate columns of XY data. Choose Edit | Delete to remove them.
  6. I like to label each column. This provides clarity if I need to stop the process and restart. It will also help decide which column to use when you import the data into Voxler. Highlight row 1 and choose Edit | Insert. The rows are all shifted down. Add the following labels in row 1.
    Worksheet labels
    This worksheet shows the imported data and the added labels for columns A, B, C, D, and E.
    The area circled in blue is the select all button.
  7. Click the select all button. Choose Data | Sort. In the Sort dialog, change the Sort First By to column D, Slope. Select Descending as the sort order and click OK.
  8. Highlight all of the rows that contain the Surfer blanking value (1.70141E+38). After all of these rows are highlighted, choose Edit | Delete to remove these values.
  9. If you wish, you can select all the rows and choose Data | Sort again. This time, Sort First By column A, X. Sort Next By column B, Y. Make sure that both sections are set to Ascending. Click OK.
  10. Click in Column F. In row 1, type in the label: X Component.
  11. Highlight the entire column F. Choose Data | Transform. In the Transform dialog, type in the Transform equation: F=SIN(D2R(D))*COS(D2R(90-E)). Change the First row to 2. Click OK to add the new data.
    Worksheet labels
    The Transform dialog allows you to add new data
    based on values in other data columns.
  12. Click in Column G. In row 1, type in the label: Y Component.
  13. Highlight the entire column G. Choose Data | Transform. In the Transform dialog, type in the Transform equation: G=SIN(D2R(D))*SIN(D2R(90-E)). Change the First row to 2. Click OK to add the new data.
  14. Click in Column H. In row 1, type in the label: Z Component.
  15. Highlight the entire column H. Choose Data | Transform. In the Transform dialog, type in the Transform equation: H=COS(D2R(D)). Change the First row to 2. Click OK to add the new data.
  16. Choose File | Save As to save the data to a new file. You can save the data to a Golden Software *.DAT format or to an Excel *XLS file format. Both can be read by Voxler.

At this point, you can close Surfer and open Voxler.

Creating and Editing the Vector Plot in Voxler
After the data is arranged, creating the vector plot is a straightforward process. Open the Voxler program. A new plot window is automatically created.

  1. Choose File | Load Data. Select the worksheet created in the previous section and click Open.
  2. Set the Data Import Options, if necessary, and click OK.
  3. In the Select Data Columns dialog, set the X CoordinateY Coordinate, and Z Coordinate to columns A, B, and C, respectively. Select Multiple Components and type in F, G, H in the box. Click OK and the data is imported.
  4. In the Network window, click once on the data file. Then, choose Create | Graphics Output | VectorPlot. The vector plot is created.

Multiple items can be changed for a vector plot. You can add other map types to enhance the display of the vectors. Your vectors can also indicate a different item than the other maps. For instance, you may have a map that shows vectors of water direction, contours of elevation, and an isosurface that shows chemical concentration. As long as the XYZ values are in the same range for all data, they will overlay to create an informative map. You can add axes, bounding boxes, etc. to create the final desired image.

Final vector map
This final image shows a vector map, contour map, and isosurface overlay.
 

Trusted by over 10,000 Companies and Schools


Snow Depth Map for Colorado Ski Resorts

Image Interested in creating a cool map of snow depth for Colorado Ski Resorts? Here's how to do it! First you'll need to get the snow depth information... Read More

Subscribe to Our Newsletter

Enter your email address below to receive email notifications of product updates and our newsletter, filled with helpful technical tips and case studies.