Author Topic: Grapher/Surfer Tips and Tricks  (Read 6753 times)

Probeman

  • Emeritus
  • *****
  • Posts: 1955
  • Never sleeps...
    • John Donovan
Grapher/Surfer Tips and Tricks
« on: April 06, 2016, 07:23:00 am »
Golden Software's Grapher software is a cool application for plotting X-Y and X-Y-Z plots. We utilize their Grapher and Surfer products in Probe for EPMA and CalcImage for automated presentation quality output using their scripting methods.

They have their own user forum here:

http://www.goldensoftware.com/forum

But here is a cool tip I just learned for manually adjusting data point labels in one's graph:

Quote
There’s no way to prevent the labels from initially falling on top of one another. But, you can move the labels to a more desirable location. To do so:

1.       Click on the Line/Scatter Plot to select it.

2.       Click the Graph | Move Labels command.

3.       Click on the label that is overlapping. Hold down the left mouse button and drag the label to a new location.

4.       Repeat for any other overlapping labels.

5.       When all the labels are moved, press ESC on the keyboard to end label movement mode.
« Last Edit: July 02, 2016, 07:31:20 am by John Donovan »
The only stupid question is the one not asked!

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2485
  • Other duties as assigned...
    • Probe Software
Re: Grapher Tips and Tricks
« Reply #1 on: May 04, 2016, 07:11:41 pm »
As many of you know, the CalcImage app utilizes some script templates for presentation output using Golden Software's Surfer application. There are also script templates provided that the user can customize for their own purposes.  These scripts have the suffix _Custom1, _Custom2, etc.  These custom script templates are *not* updated when you update the PFE software, in case they have been customized by the user.

I recently found that if all the plot data is less than zero, then the slice script fails with a minimum is greater than maximum error. So I modified the default slice script and that is available with the latest update. However I cannot automatically update the custom templates in case the user has modified them.

So I have attached them below if any one wants to download them on their computers.  If you've never modified the custom slice templates you should download these and copy them to the C:\ProgramData\Probe Software\Probe for EPMA folder.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 1955
  • Never sleeps...
    • John Donovan
Re: Grapher/Surfer Tips and Tricks
« Reply #2 on: June 30, 2016, 01:10:37 pm »
When you update your Grapher and/or Surfer applications (from Golden Software), you will need to modify the application paths as defined in the [software] section of the Probewin.ini file, for example:

[software]
GrapherAppDirectory="C:\Program Files\Golden Software\Grapher 9"
SurferAppDirectory="C:\Program Files\Golden Software\Surfer 11"

Note that the Probewin.ini file is in the C:\ProgramData\Probe Software\Probe for EPMA folder for Win 7 or under Documents and Settings\ApplicationData for XP.

Note that these are hidden folders as specified by Microsoft, but they can be unhidden using the Folder Options properties in Explorer.

Or you can just set the keyword to empty "" and Probe for EPMA will try and figure out the new application paths for you, though if you didn't uninstall the previous versions of Grapher and Surfer it might still find those.
« Last Edit: July 02, 2016, 07:31:35 am by John Donovan »
The only stupid question is the one not asked!

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2485
  • Other duties as assigned...
    • Probe Software
Re: Grapher/Surfer Tips and Tricks
« Reply #3 on: July 02, 2016, 07:35:08 am »
Dave Adams (USGS) reports that after they upgraded to v. 13 of Golden Software's Surfer app, they got this "ActiveX Automation: server could not be found" error when attempting to output quantitative map scripts in CalcImage:



Sabrina Pearson at Golden Software responded with the following suggestions:

Hi Dave and John,

Thanks for contacting me. It sounds like the program is not correctly registered on the computer. Please try the suggestions on this knowledge base article to register Surfer on the system. If the issue happens when running a script that calls Grapher, use the same suggestions, but select Grapher instead of Surfer.

http://www.goldensoftware.com/knowledge-base/surfer-scripter/1806-error-when-run-script-activex-automation-server-cannot-create-object

If you have any further questions, please contact me.

Sincerely,
Sabrina
« Last Edit: July 02, 2016, 08:10:39 am by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 1955
  • Never sleeps...
    • John Donovan
Re: Grapher/Surfer Tips and Tricks
« Reply #4 on: July 02, 2016, 10:04:25 am »
I also found this thread on that specific error number (10095):

http://www.goldensoftware.com/forum/viewtopic.php?t=3827

The problem was fixed by "turning it off and on again" (rebooting the computer!).
« Last Edit: July 02, 2016, 12:32:06 pm by Probeman »
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 1955
  • Never sleeps...
    • John Donovan
Re: Grapher/Surfer Tips and Tricks
« Reply #5 on: July 06, 2016, 10:25:49 am »
Dave Adams got the Surfer scripting working again by setting the "Run As Administrator" checkbox under the Properties tab for the Surfer.exe app.

Normally this isn't necessary, so I asked Dave a few more questions regarding the details and here are my questions and his responses:

1.)  Is this an IT distribution of Win 7 or retail?

I'm not sure, but I suspect it was a retail version as we try to keep IT's hands off of our lab computers as much as we possibly can.

2.)  Is it 32 or 64 bit Win7?  Also is this 32 or 64 bit Surfer?

Windows 7 64-bit and Surfer (and grapher) 64-bit.

3.) Did you try running Surfer.exe again one more time, but *without* the Run As Administrator flag set?  Sometimes this flag only needs set the first time it runs, then you can uncheck it after that.

I reinstalled Surfer and ran the first time with the Admin flag set then shut it off and tried the scripting again and I got the ActiveX message again every time I tried to run without the Admin flag set
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 1955
  • Never sleeps...
    • John Donovan
Re: Grapher/Surfer Tips and Tricks
« Reply #6 on: July 24, 2016, 10:34:56 am »
Philipp Poeml found this little trick to ensure that the Surfer output script works better for non-US page sizes.

I've already modified the default x-ray mapping script for CalcImage, so running an update should fix this issue for most users.  To be sure all your scripts are updated, you can delete your existing custom scripts listed here (assuming you have not previously modified or edited them yourself!), and the installer will automatically update them with the updated versions:

GRIDXY_Custom1.BAS
GRIDXY_Custom2.BAS
GRIDXY_Custom3.BAS
GRIDXY_Custom4.BAS

However, if you have modified any of the "custom" scripts yourself, they will not get updated automatically (unless they are deleted). In this case you should open your previously modified scripts and search for the following lines:

Const page_width! = 11.
Const page_height! = 8.5

Then just above these lines add the statement:

SurferApp.PageUnits = srfUnitsInch

This will ensure that your presentation plots will fit your local page size perfectly.
john
The only stupid question is the one not asked!

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2485
  • Other duties as assigned...
    • Probe Software
Re: Grapher/Surfer Tips and Tricks
« Reply #7 on: November 19, 2017, 06:03:25 pm »
The latest version Golden Software's Surfer app, now has the Scripter.exe app located in the main Surfer folder.  Because of this change I had to modify the Scripter path, based on the value of the SurferOutputVersionNumber keyword in the Probewin.ini file as seen here:

SurferOutputVersionNumber=15           ; 6 = old Surfer file format version, 7 = version 7 (or later) file format version

If you are using CalcImage to output presentation quality reports for quantitative x-ray mapping and you upgrade to version 15 of Surfer, you should edit your Probewin.ini file as above.
john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2485
  • Other duties as assigned...
    • Probe Software
Re: Grapher/Surfer Tips and Tricks
« Reply #8 on: November 22, 2017, 08:58:43 am »
The latest version Golden Software's Surfer app, now has the Scripter.exe app located in the main Surfer folder.  Because of this change I had to modify the Scripter path, based on the value of the SurferOutputVersionNumber keyword in the Probewin.ini file as seen here:

SurferOutputVersionNumber=15           ; 6 = old Surfer file format version, 7 = version 7 (or later) file format version

If you are using CalcImage to output presentation quality reports for quantitative x-ray mapping and you upgrade to version 15 of Surfer, you should edit your Probewin.ini file as above.
john

I was curious if and when Golden Software would similarly move the Scripter app location for their Grapher software and so I contacted them, and they said it would be starting with Grapher 13 which has not quite been released yet.  So I went ahead and made a similar change to the code to handle the new Scripter path for Grapher scripts as well.

So if you eventually purchase Grapher 13 or higher you will need to edit the following keyword in your Probewin.ini to reflect this new path location:

GrapherOutputVersionNumber=13

john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2485
  • Other duties as assigned...
    • Probe Software
Re: Grapher/Surfer Tips and Tricks
« Reply #9 on: November 25, 2017, 04:31:24 pm »
The latest version of Probe for EPMA, v. 12.0.8, will now automatically determine if the Grapher/Surfer version numbers and application folders are correct.

So when you start Probe for EPMA you may see these messages if they do not match:





And when starting CalcImage, the same check will be performed, but for the Surfer version and application folder.
john
« Last Edit: November 25, 2017, 04:51:53 pm by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 1955
  • Never sleeps...
    • John Donovan
Re: Grapher/Surfer Tips and Tricks
« Reply #10 on: December 07, 2017, 08:38:50 am »
I just found an explanation for how to run a specific version Scripter, when more than version of Surfer is installed on ones computer:

https://support.goldensoftware.com/hc/en-us/articles/226503947-I-have-different-versions-of-Surfer-installed-How-do-I-know-which-version-my-script-will-use-

john
The only stupid question is the one not asked!

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2485
  • Other duties as assigned...
    • Probe Software
Re: Grapher/Surfer Tips and Tricks
« Reply #11 on: December 14, 2017, 11:15:13 pm »
The new CalcImage scripts when run with Surfer 13 or higher will automatically take care of the JEOL "anti-Cartesian" stage coordinate system as described here:

http://probesoftware.com/smf/index.php?topic=41.msg6488#msg6488

But just for general interest what happens if one manually loads a JEOL (anti-Cartesian) oriented GRD file directly into Surfer? Here we select a color relief map option, then select a GRD file as prompted, and we get this:



Not much to look at I know. But if we turn off the "hill shading" and click the View | Fit to Window icon, we get this:



Still looks strange right?  That's because the default in Surfer is "Terrain" color palette and Cartesian orientation. But if we select the Heat palette we get this:



It almost looks normal, but for reasons beyond my understanding, Golden Software has their Heat palette going from white to orange to black, while we microscopists prefer black to orange to white for our thermal palettes. This is not an issue for the CalcImage scripts because we generate our preferred palettes automatically, but when loading a GRD file in Surfer manually it might be better to go with one of the rainbow palettes like this:



In any event, the issue now is that this is still a Cartesian orientation, so we need to check the Reverse Axis checkboxes (from the Scaling tab), for both the X and Y axes like this:



Now it's starting to look like something.  Of course all this is only necessary because we didn't run the script automatically from Surfer! Makes me appreciate all the effort put into developing these scripts!
« Last Edit: December 15, 2017, 09:01:49 am by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 1955
  • Never sleeps...
    • John Donovan
Re: Grapher/Surfer Tips and Tricks
« Reply #12 on: November 26, 2018, 05:28:24 pm »
Just a quick note on the Golden Software Surfer and Grapher license agreement:

Strater, Surfer and Grapher offer two licensing options: single-user licenses and concurrent licenses.

Quote
A single-user standalone license is associated with one person and only that person can use the license.  Single-user licenses can be activated on up to two computers for use in the field and in the office, for example.

A concurrent-use license, also called a “network” or “floating” license, is tied to a network. A license server be setup on the network for license distribution.  The licenses are activated on the server computer and then the software on the user's computers connects to the server to see if a seat is available each time it is started. The product can be installed on as many client machines as desired.

To me this means you can install Surfer and Grapher on your probe computer and also on a computer for off-line processing in your office or laptop.
The only stupid question is the one not asked!

Probe321

  • Post Doc
  • ***
  • Posts: 21
Re: Grapher/Surfer Tips and Tricks
« Reply #13 on: January 07, 2019, 12:54:44 pm »
Updated to Surfer 16 and got "Unable to find color scale in the Surfer directory error." 

Contacted Golden Software and they have removed the color scales directory from Surfer 16.  You can down load the color scale directory at

https://support.goldensoftware.com/hc/en-us/articles/360009907393-Where-is-the-ColorScales-folder-

colorscale.zip

installed colorscale directory to Surfer 16 tested it on a quant X-ray map and it works.

Edit by John: Thanks Keith!

PS The ColorScales folder should be created in the C:\Program Files\Golden Software\Surfer 16 folder.
« Last Edit: January 07, 2019, 01:10:27 pm by Probe321 »

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2485
  • Other duties as assigned...
    • Probe Software
Re: Grapher/Surfer Tips and Tricks
« Reply #14 on: January 27, 2019, 05:13:31 pm »
Hi Keith,
We modified the Surfer scripts used by CalcImage to automatically handle version 16 of Surfer because Golden Software no longer installs a ColorScales folder, where the .clr "palette" files used to reside.

The new script code looks like this now:

Code: [Select]
' Load color spectrum depending on version number
If Val(Left$(SurferApp.Version, 2)) <= Val("8.") Then
SurferColorMap.LoadFile(SurferApp.Path & "\Samples\Rainbow2.clr")
ElseIf Val(Left$(SurferApp.Version, 2)) <= Val("15.") Then
    SurferColorMap.LoadFile(SurferApp.Path & "\ColorScales\Rainbow2.clr")
Else
SurferColorMap.LoadFile(SurferApp.Path & "\Samples\Rainbow.clr")
End If

Too bad Golden Software keeps changing their minds where (or even if) these files should be!   >:(

Anyway, the latest version of Probe for EPMA should now handle these issues automatically for the default scripts. We don't have Surfer v. 16 yet to try it out so please let us know if this works now without the ColorScales folder.

We also updated the custom script files *which as you may know are not updated by the .msi installer*, so if you have modified the custom scripts for your own use, you will need to edit the script code as shown above if you update to Surfer v. 16 or higher.

If you haven't modified the CalcImage custom script files or even if you have, you can grab a complete set of the updated custom scripts attached to this post (remember to login to see attachments):

https://probesoftware.com/smf/index.php?topic=41.msg6488#msg6488

Please let us know if you have any questions at all.
« Last Edit: January 27, 2019, 07:06:00 pm by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"