Hi Mark-
With the way the script is set up now, you end up for an average for all polygons. Which was okay for what I was using it for. I'd love to see the MATLAB script if you don't mind sharing!
-Dan
Hi Dan, thanks for confirming -- I thought that might be the case. Here's a link to the Matlab script:
https://github.com/m-edwards/EPMA_scriptsI am very new to Matlab, so I am sure this code could be shortened and made more elegant/simple. For now, though, it works! There are three files in the above Github folder. In brief, Circle_appxoximator takes a list of spot centers and diameters, and outputs a .csv file containing points that define a polygon approximating a circle around the center. The test.txt file can be used to test the code. To implement this, I open a map in Surfer, click digitize, and click on all of the centers of spots (which I locate using a photomicrograph imported into Surfer). I then use the X-Y coordinates to build the text file to put into the Circle_approximator script. This is useful for LA-ICP-MS users, but if you are more concerned with compositional zones or regions you won't have a use for this script.
The polygon extractor script then takes a folder containing all of the polygon files, and will extract the composition for each polygon from the quantified .DAT file. All of the results are compiled in a table, and exported to a text file. I did not combine these two operations into one script (i.e., circle approximator + polygon extractor). The polygon input files don't need to be circles -- they could be polygons you build in Surfer, and then save as a .csv file.
If you (or anyone else) wind up using these scripts and streamlining them, I'd be curious to see any modifications. I suspect that given the slight 'clunkiness' of the code, this would take ~an hour to set up to work for your data.