Convert cylindrical/spherical coordinates to cartesian coordinates via Surfer automation

If you are working with cylindrical (r, theta, z) or spherical/polar (r, theta, phi) coordinates and you would like to model your data in Surfer, it must first be converted into X, Y and Z data (cartesian coordinates).  This can be done using the attached script.

The script file (.BAS) is zipped together with Sphere.srf and CYLINDER.SRF for coordinate definitions.

To use the script:

  1. Download and unzip the contents of the attached: crv2xyz10.zip
  2. Open Scripter, which comes with Surfer. You can open Scripter by clicking the Windows Start button and clicking All Programs | Golden Software Surfer | Scripter.
  3. Click File | Open and open crv2xyz9.bas.
  4. Click Script | Run.
  5. Select the data file with the cylindrical, polar, or spherical coordinates and click Open
  6. Enter a name for the new data file of XYZ coordinates to be created and click Save.
  7. Select whether the coordinates in the raw data are cylindrical or spherical (polar) and click OK.
  8. Select whether you would like to see a drawing of the coordinate system the script uses (it opens one of the included SRF files). Click Yes or No.  If you click Yes, you will need to specify the full file location of the SRF files (e.g. c:\temp\).
  9. Enter the column letters of the data and click OK (use the column letters, e.g. abc, not numbers).
  10. Select if the data is in radians or degrees and click OK. The file is converted and saved.

Once you have XYZ data, you can create a post map or grid it to make other map types.

 

Updated October, 2021

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.