How can I use Surfer Scripter to determine the average of contours within each township/range polygon?

This article provides a full script that you can use to calculate the average z value from your grid file within areas in a boundary file.

You can run this script to calculate the average grid node value within each township/range boundary. There are three areas where you need to change the script for your needs. These areas are denoted with a comment.