3 Types of Scripts That Can Automate Some of Your Map-Making Workflow
When it comes to mapping, automation can be a game-changer. But when you hear the word “scripting,” which is the method used to jumpstart automation, your first thought might be, “That’s not for me.” If you’re a geoscientist or engineer with little (or no) experience writing scripts, it’s easy to assume scripting is out of reach. It can sound too technical and intimidating—but the truth is, scripting doesn’t require you to be a programmer.
You Don’t Need to Be a Programmer to Use Scripts
You can be a geoscientist or engineer and have a good experience incorporating scripts into your workflow. That’s especially true if you’re using a data visualization software that provides easy-to-understand sample scripts. Just consider the sample scripts available in Surfer. They’re organized logically, making them easy to follow—even if you’ve never written a line of code. If you use one of them, you don’t need to write your own from scratch.
Sample scripts provide a rough draft to work with and customize. You can open them, change the file path, tweak the colors, and update anything else you need. Everything is laid out clearly, so you can simply modify what matters most to your project—and making those modifications can happen a few different ways. However, the easiest way is to use Scripter, a script writing program that’s included with Surfer. This tool equips you to open a sample script and make changes. It’s intuitive, straightforward, and beginner-friendly. And if you combine it with the guidance provided in the Help System (which we recommend doing), incorporating sample scripts into your workflow will be that much easier.
“I never had any scripting education or training at all before working at Golden Software,” said Surfer Product Manager Kari Dickenson. “I was a geologist; I didn’t know anything about automation, but I haven’t had problems picking it up. The sample scripts make it easy.”
Related Reading:
Sample Scripts for Your Visualization Process
If you’re interested in using sample scripts to automate parts of your workflow, you may find yourself wondering: which one should you use? While we can’t speak to the sample scripts that other companies may offer, we can give some insight into the ones available for Surfer.
Currently, there are more than 70 sample scripts to choose from, so the options are plentiful—but determining the best ones to use will ultimately depend on your workflow. That said, instead of giving you a “Top 10” list that may not apply to your needs, we’ll walk through the three biggest categories most sample scripts in Surfer fall into. That way, you can determine the types of scripts you want to use and make specific selections from that point.
When Should You Use Multiple Light Sources?
Now, how can this new tool enhance the work you’re doing in your specific field? To demonstrate how multiple light sources can improve 3D models in different scientific industries, here are real-world examples to illustrate how this new feature positively impacts any type of work you do.
Category 1: Workflow Efficiency Scripts
This first category includes sample scripts for common mapping situations. If you’re looking for quick wins and time-saving shortcuts, this is where you’ll want to start. Here are three standout examples:
Grid Data Comparison Script
This script is designed to help answer one of the most common questions: “Which gridding method is best for my data?” Instead of manually trying out eight different gridding methods one by one, you can run this script, select your file, and let it generate a small map for each method. From there, you can visually compare the results and decide which method gives you the most accurate representation. Once you identify the best fit, you can go in, fine-tune the resolution, and adjust any advanced options you want. It’s a fast, automated way to get a first-pass evaluation without the trial-and-error headache.
Change Font for All Objects Script
Need to update text styles across your entire project? This script makes it easy to change the font face, font size, or relative font size for every text object in your Surfer file. For example, if you want everything to increase by two points, a 20-point title becomes 22, and a 14-point label becomes 16. This script is especially useful when you’re working with multiple contour maps and want to maintain consistent formatting without clicking through every font setting manually.
Z Column Script
If you’re working with a dataset that has identical XY values but multiple Z columns (for example, time-series data or repeated measurements), this script will automatically grid each Z column one after the other. It’ll save you from manually selecting and gridding each column, streamlining the whole process.
Category 2: Scripts for Objects Showing Their Properties and Methods
This next category is great for learning the structure and behavior of different objects in Surfer—like contour maps, base layers, or axes. Each script focuses on a specific object type and outlines all the properties and methods you can use with it. Think of these as reference scripts: they show you what’s possible with a particular object and how to write it into your own scripts.
Let’s say you want to customize a contour map. You can open the contour map script (ContourMap.bas), see how the properties and methods are written, and copy over just the pieces you need—whether that’s changing the fill colors, setting the fault line style, or modifying the contour interval. It’s a great way to explore scripting without diving into a full tutorial.
Category 3: Scripts for Specific Properties and Methods
This third category includes scripts that focus on individual properties and methods—such as adding layers, setting coordinate systems, or using the query option. These scripts are especially helpful if you already have a working script and want to expand or fine-tune it.
For example, if you’ve already built a script to generate a contour map but want to apply a coordinate system, you can open the coordinate system script (CoordinateSystems.bas), copy the lines of code that set the coordinate system for the layer and changes the coordinate system for the map, and paste them into your existing script. You’ll just want to double-check that the object names align correctly.
These small, targeted scripts work great on their own—but they also combine well with the object-specific scripts from Category 2. By mixing and matching from both, you can create a powerful script that covers your full workflow from start to finish.
Tech Tip: Want to start using Surfer’s sample scripts in your workflow? Check out this short article explaining where to find all the scripts for your Surfer maps!
Start Small, Automate More, and Map Smarter
If scripting has ever felt out of reach, let this be your reminder: you don’t have to be a programmer to use automation in your workflow. With sample scripts that are logically organized and easy to modify—even more so when you use Scripter and the Help System—you can automate parts of your visualization process in no time. And with more than 70 sample scripts available in Surfer, you’ve already got the building blocks to get started. Just open a script, reference the Help, and tweak what you need to let automation do the heavy lifting. Not already a Surfer user? Download the 14-day free trial to use the sample scripts and unlock the benefits of automation!