Author Topic: Customizing Surfer Scripts  (Read 14201 times)

Probeman

  • Emeritus
  • *****
  • Posts: 2856
  • Never sleeps...
    • John Donovan
Re: Customizing Surfer Scripts (JEOL stage axes orientation)
« Reply #15 on: July 05, 2017, 02:06:29 PM »
As you may know, for display of JEOL x-ray maps and images in Surfer, I have to invert the x and y axes because Surfer GRD files always expect a Cartesian coordinate system. That is why the axes labels have the notation (* - 1).

However, I believe starting in version 13 of Surfer, Golden Software added a new flag in the scripting automation API that allows one to display (anti-Cartesian) images. The syntax for this axis property is :

axis.[itemname].reverse = true

I haven't implemented this yet in my Surfer output code, but I thought it might be useful to share.
john
The only stupid question is the one not asked!

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Customizing Surfer Scripts (JEOL stage axes orientation)
« Reply #16 on: December 01, 2018, 09:12:21 AM »
As you may know, for display of JEOL x-ray maps and images in Surfer, I have to invert the x and y axes because Surfer GRD files always expect a Cartesian coordinate system. That is why the axes labels have the notation (* - 1).

However, I believe starting in version 13 of Surfer, Golden Software added a new flag in the scripting automation API that allows one to display (anti-Cartesian) images. The syntax for this axis property is :

axis.[itemname].reverse = true

I haven't implemented this yet in my Surfer output code, but I thought it might be useful to share.
john

The Surfer reverse axis syntax for JEOL anti-cartesian stage axes display was implemented in the CalcImage Surfer generated scripts some time ago and works well.  Remember you will need to edit any customized scripts yourself to utilize this feature.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 3304
  • Other duties as assigned...
    • Probe Software
Re: Customizing Surfer Scripts
« Reply #17 on: December 01, 2018, 09:46:25 AM »
Karsten Goemann recently noticed that if one performs a slice script operation from CalcImage in the Surfer Scripter app, on a polygon (free shape) defined x-ray map acquisition, and the user digitizes slice points that lie outside the actual map acquisition region, the script will create Z values of -8888 or -9999 for those areas outside the map area. 

This was because Julie Chouinard's original Surfer slice scripts had this line of code:

SurferApp.GridSlice(InGrid:=FileGridMap$,BlankFile:=FileBoundaryLine$,OutDataFile:=FileDataOutput$, OutsideVal:=-8888, BlankVal:=-9999)

The -8888 value is returned if the position is outside the map extents, and it returns -9999 if the position is a blanked value. Which is basically the same thing for our purposes.

I think Julie was planning on utilizing these values as "special" values for some other operations, but in the meantime these negative values just caused problems if someone accidentally digitized slice points outside the actual map area.  So I edited the line like this:

SurferApp.GridSlice(InGrid:=FileGridMap$,BlankFile:=FileBoundaryLine$,OutDataFile:=FileDataOutput$, OutsideVal:=0, BlankVal:=0)

So now if one "slices" outside the actual mapped area, the script returns zero values rather than -9999 values, as seen here:



So if you update to the latest Probe for EPMA v. 12.5.3, you will be updated for this new script code. 

And finally, if you have customized slice scripts that you have edited for your own purposes, you will need to edit them yourself as I did above.  However, if you haven't customized your "custom" scripts, you can just grab them below where I have attached them for download. 

Remember, the installer will not overwrite custom scripts because it doesn't know if you edited them or not, so one needs to copy the attached scripts to the ProgramData folder manually if desired.  Of course if you never utilize the customized slice scripts in CalcImage, it's a "don't care".
« Last Edit: December 01, 2018, 01:07:48 PM by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"