Probe Software Users Forum

Software => Probe for EPMA => Topic started by: Karsten Goemann on July 04, 2013, 07:19:02 PM

Title: Multiple background "sharing"
Post by: Karsten Goemann on July 04, 2013, 07:19:02 PM
I was wondering if it would somehow be possible to "share" off-peak measurements between elements when doing multi-point background type work. I find when doing REEs with multi-point backgrounds I end up using the same absolute off-peak positions for some neighbouring elements and it seems a waste to use those counts only for one element at a time. That way time could be saved during acquisition and/or background measurement statistics could be improved.

Almost like a calibration curve sort of approach.

As far as can see so far this would have limitations similar to multi-point backgrounds in general (absorption edges, point selection for fitting...), but I expect the main issue would be how to handle this software-wise?

Cheers,

Karsten
Title: Re: Multiple background "sharing"
Post by: John Donovan on July 07, 2013, 09:50:56 AM
Hi Karsten,
Yes, exactly, a software implementation issue.

Since the dominant paradigm in the software is that each element is treated separately, there would have to be a sort of global table that these off-peak intensities would get stored in, and the user would have to view, select and assign them on a global basis.  Kind of like the MAN dialog, but for off-peaks.  A lot of work!

Essentially it would be a 4th (!) bgd method (in addition to the already existing off-peak, MAN and multi-point bgd methods).

I will have to ruminate on this for a while and see if I can think of some clever method to implement this.
john
Title: Multipoint background funtionality
Post by: Mike Jercinovic on May 22, 2014, 01:46:21 PM
OK, maybe we can start to think about increasing the efficiency and power of minor and trace element EPMA by expanding the capability of the multipoint background. 
Here is an example we deal with a lot in geochronology applications - The measurement of U in the presence of Th in monazite, xenotime, etc. is tricky business (lets assume we are not going to use Uranium La at high voltage).  U Ma is severely overlapped by Th Mb, and is further compromised by the Ar K edge if P10 is used.  U Mb is generally preferred due to less spectral interference and actually greater intensity than UMa in most circumstances (see attached figure).
 
Without getting into absorption edge issues in very high Th compositions, the remaining problem is the boundary fluorescence of potassium near interfaces with K-feldspar or micas.  The first-order interference of K with UMb is minor, but in the trace element realm, it's a problem, causing "too many" apparent U counts and therefore a slightly younger age at the rim (hooray, we just discovered a new event!).  So this is dealt with nicely as a mutual interference problem between UMb and KKa.  So now it is interesting because the best way to characterize this complex background region is via the multipoint acquisition.  Works fantastically well (see second attachment), but here is the problem, we measure all these background points for the U measurement, and characterize the background in this spectral region very accurately.  If we want to do a K measurement the same way on the same spectrometer, we would have to re-collect this multipoint acquisition.  So why not use that regressed background data (from the U measurement) for the K measurement on the same spectrometer also - just move the peak position from U to K?  Why do an independent background acquisition for K - we already have the data!  In fact, if I wanted too, I could use the ThMg line with this same background measurement, just at a different wavelength for the analytical line?  This could be very powerfully applied in other minor element situations where measured lines are in the same spectral region (REEs?).

It seems odd to me when we measure the full suite of rare earths to measure 15 analytical lines that we have to do 30 background acquisitions in the classical two-point interpolation method (two backgrounds per element), when we could probably characterize broad ranges of background very accurately with less than half that actual number of background measurements with a multipoint approach.
Title: Re: Multiple background "sharing"
Post by: John Donovan on May 22, 2014, 10:07:29 PM
Hi Mike,
You guys are killing me!   :'(

I do agree though, the ideas you and Karsten present above are totally valid. These concepts would save x% time, if implemented...

But implementation is the problem. Consider that this proposed shift from a "single" element model to a "sparse spectrum" model is a paradigm shift similar in magnitude to the "instrument centric" to "sample centric" approach I take in our software as described here:

http://probesoftware.com/download/Instru-vs-sample-centric.ppsx.

For example, each element would have to be measured under the same PHA conditions to "share" backgrounds. Then there's the question of peak integrals...

Also I estimate the amount of work necessary for this "sparse spectrum" implementation would be larger than the MPB implementation was (~6 months of work).  But rather than open up new vistas for further investigation, I suspect it will only save some time. Could I be convinced otherwise? Of course. But I would sure like to see a more tangible rationale than merely saving time.

I've got several current projects that will improve accuracy and precision (while also reducing acquisition time) and they seem more attractive to me at the moment (see attachment below).

I'm willing to discuss it.   :)
Title: Re: Multiple background "sharing"
Post by: Philipp Poeml on July 03, 2014, 06:46:13 AM
I just programmed 48 lines into PfE all with multipont background. I really would like to have this feature. Now the software will measure 48 x 4 background positions. In my case it could measure 4 x 4 and that would be it. Saves a HUGE amount of time.

If one day you find the time John...

Cheers
Ph
Title: Re: Multiple background "sharing"
Post by: Mike Jercinovic on July 03, 2014, 08:06:43 AM
Yes, I realize there may be a lot of work in implementation, but we should be talking about this seriously.  I mention the U-Mb K-Ka measurement, which in monazite becomes more than an efficiency argument, but is also an accuracy question because of beam exposure time on a beam sensitive material.  This is an important justification for the on peak time fraction too.  Efficiency, however, is a very good reason when you are talking about doubling (or more) the analysis time for trace element analysis.  Those of us who deal a lot with commercial customers are always working this aspect to maintain an attractive cost structure.  To them, they don't want to hear so much about being sample-centric as much as being customer-centric...not that our academic or government customers are that much less cost/efficiency conscious.  Believe me, I think about this every time I write another proposal support letter where they want to know how much it is going to cost to do a full monazite work-up per thin section for their budget.  As such, we simply just don't do as good a job with U and K measurements as we think we could do if this background sharing was possible.
Title: Re: Multiple background "sharing"
Post by: Anette von der Handt on July 03, 2014, 10:24:15 AM
Hi,
Wouldn't it be possible to have an offline processing work-around solution for the time being? Like only program the 4X4 backgrounds, run the other elements only on the peak, export the data, copy background counts to the other elements and import the data again. Not elegant, and definitely would need a script to make it truly efficient.
Title: Re: Multiple background "sharing"
Post by: John Donovan on July 03, 2014, 11:22:17 AM
Hi,
Wouldn't it be possible to have an offline processing work-around solution for the time being? Like only program the 4X4 backgrounds, run the other elements only on the peak, export the data, copy background counts to the other elements and import the data again. Not elegant, and definitely would need a script to make it truly efficient.

Well, of course almost everything is possible... but practical?  That is tougher. However, has anyone ever noticed that the bathroom is a great place to get new ideas?   ;)    Here's mine:

The problem as I see it is in creating an entire new infrastructure to handle this multi-element off-peak implementation. But what if we could use a software infrastructure that already exists?  Hmmm...

For example, we already have a multi-point background array. So what if the user acquires normal off-peak backgrounds on a number of elements on the same spectrometer, using the same crystal, using the same PHA settings? And then what if there was a flag that the user could flip that would force the data routines to automatically search for other elements on the same spectro/crystal/PHA combination and load their off-peak intensities into the multi-point arrays, along with the off-peak intensities from the element in question?

So, it would be a sort of "dynamic" multi-point background correction which utilizes multiple elements off-peaks.  Let's chat about this at IUMAS...

Edit by John: Another idea somewhat along the lines that Anette suggested: write some code that, for the selected samples, searches for any additional off-peak backgrounds from other elements (same spectro/xtal/PHA) (within some range criteria?) which is then written to the sample multi-point background (MPB) arrays. The sample could then be treated just as any other normally acquired MPB sample.

Of course, this could not be used for samples already with MPB intensities, only those with off-peak intensities.... dang, someone owes me a beer!
Title: Re: Multiple background "sharing"
Post by: John Donovan on July 03, 2014, 03:56:32 PM
Ok, I took a look at the code and this shouldn't be all that hard, maybe a few days work.

Let's discuss some of these ideas at IUMAS and decide what kind of parameters (such as the spectrometer range) need to be specified.
Title: Re: Multiple background "sharing"
Post by: Karsten Goemann on July 03, 2014, 04:20:40 PM
John, I think that is a great idea. Spectro range is probably the main parameter. It would be important that the same options are available for processing, e.g. forcing specific backgrounds in/out, but if it is treated as a "normal" multi-bg measurement after the background data has been copied from the off-peak to the multi-peak database that should be the case, right?

Edit by John: Yes, I think that should all follow.
Title: Re: Multiple background "sharing"
Post by: Mike Jercinovic on July 04, 2014, 09:13:20 AM
This is all starting to sound very interesting!
Title: Re: Multiple background "sharing"
Post by: John Donovan on August 15, 2014, 03:43:10 PM
OK, I have a beta version of the "shared" background method implemented in v. 10.4.4 of Probe for EPMA.

To test this you'll need several elements measured on the same spectrometer at the same keV, using the same crystal. Acquire normal off-peak bgds as you typically might for a number of elements that are positionally grouped somewhat together in the spectrometer range, though one could use the entire spectrometer range in principle.

Then go to the Analyze! window and click the Data button to see the normal on and off-peak intensities as seen here:

(https://probesoftware.com/smf/oldpics/i60.tinypic.com/21bobpl.jpg)

Now click the Search For "Shared" Bgds button and the program will search for other elements which might have off-peak intensities measured on the same spectrometer/crystal combination and if so, the program will save them to the multi-point background arrays as seen here:

(https://probesoftware.com/smf/oldpics/i60.tinypic.com/2s6sflw.jpg)

Now, go to the Run | Display MultiPoint Background Intensities menu and you will see the "shared" backgrounds for La La as seen here:

(https://probesoftware.com/smf/oldpics/i57.tinypic.com/2vlmr20.jpg)

and for Ce La as seen here:

(https://probesoftware.com/smf/oldpics/i57.tinypic.com/30909hv.jpg)

Note that all element peak intensities are now utilizing multiple off-peak bgds. To return your sample to its original state you can use the Remove "Shared" Bgds button as seen here:

(https://probesoftware.com/smf/oldpics/i58.tinypic.com/52cqit.jpg)
Title: Re: Multiple background "sharing"
Post by: Probeman on August 16, 2014, 10:51:39 AM
Here's a "quant" example of shared backgrounds on pyrite where both K and Cl share the same crystal, spectrometer, etc *and* were acquired at different beam currents (the code seems to handle it fine).

First, just the normal off-peak intensities:

On-Peak (off-peak corrected) or MAN On-Peak X-ray Counts (cps/1nA) (and Faraday Current):
ELEM:    na ka   si ka    k ka   al ka   mg ka   fe ka   ca ka    s ka   cl ka   ti ka    p ka    f ka
BGD:       MAN     MAN     OFF     MAN     MAN     MAN     MAN     OFF     OFF     OFF     OFF     OFF
SPEC:        1       2       3       4       1       5       2       2       3       5       4       1
CRYST:     TAP    LPET    LPET     TAP     TAP     LIF    LPET    LPET    LPET     LIF     TAP     TAP
ORDER:       1       1       1       1       2       1       2       3       2       2       2       3
  146G    1.20    4.27     .12    2.06    1.59  429.61    4.95  101.40    -.04     .15    -.06    -.02
  147G    1.07    4.16     .06    2.16    1.53  431.27    4.98  100.90     .04     .08    -.05     .02

AVER:     1.14    4.22     .09    2.11    1.56  430.44    4.97  101.15     .00     .12    -.05     .00
SDEV:      .09     .08     .04     .07     .04    1.17     .02     .35     .06     .05     .01     .03
1SIG:      .06     .12     .16     .07     .07    1.03     .16     .32     .03     .03     .02     .02
SIGR:     1.52     .67     .25     .90     .55    1.14     .14    1.11    1.99    1.72     .28    2.00
SERR:      .07     .06     .03     .05     .03     .83     .02     .25     .04     .03     .00     .02
%RSD:     8.24    1.87   46.03    3.09    2.53     .27     .43     .35 1486.39   41.26  -12.42    ----

Off-Peak (calculated) X-ray Counts (cps/1nA):
ELEM:    na ka   si ka    k ka   al ka   mg ka   fe ka   ca ka    s ka   cl ka   ti ka    p ka    f ka
TYPE:     NONE    NONE  LINEAR    NONE    NONE    NONE    NONE  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR
  146G    ----    ----    4.82    ----    ----    ----    ----    1.04     .89     .68     .57     .26
  147G    ----    ----    5.01    ----    ----    ----    ----     .95     .79     .71     .55     .26

AVER:     ----    ----    4.92    ----    ----    ----    ----    1.00     .84     .70     .56     .26
SDEV:     ----    ----     .13    ----    ----    ----    ----     .06     .07     .02     .01     .01


And again, but this time after clicking the Search For "Shared" Bgds button:

On-Peak (off-peak corrected) or MAN On-Peak X-ray Counts (cps/1nA) (and Faraday Current):
ELEM:    na ka   si ka    k ka   al ka   mg ka   fe ka   ca ka    s ka   cl ka   ti ka    p ka    f ka
BGD:       MAN     MAN     OFF     MAN     MAN     MAN     MAN     OFF     OFF     OFF     OFF     OFF
SPEC:        1       2       3       4       1       5       2       2       3       5       4       1
CRYST:     TAP    LPET    LPET     TAP     TAP     LIF    LPET    LPET    LPET     LIF     TAP     TAP
ORDER:       1       1       1       1       2       1       2       3       2       2       2       3
  146G    1.20    4.27     .11    2.06    1.59  429.61    4.95  101.40    -.04     .15    -.06    -.02
  147G    1.07    4.16     .07    2.16    1.53  431.27    4.98  100.90     .04     .08    -.05     .02

AVER:     1.14    4.22     .09    2.11    1.56  430.44    4.97  101.15     .00     .12    -.05     .00
SDEV:      .09     .08     .03     .07     .04    1.17     .02     .35     .06     .05     .01     .03
1SIG:      .06     .12     .16     .07     .07    1.03     .16     .32     .03     .03     .02     .02
SIGR:     1.52     .67     .19     .90     .55    1.14     .14    1.11    2.05    1.72     .28    2.00
SERR:      .07     .06     .02     .05     .03     .83     .02     .25     .04     .03     .00     .02
%RSD:     8.24    1.87   31.90    3.09    2.53     .27     .43     .35-5144.27   41.26  -12.42    ----

Off-Peak (calculated) X-ray Counts (cps/1nA):
ELEM:    na ka   si ka    k ka   al ka   mg ka   fe ka   ca ka    s ka   cl ka   ti ka    p ka    f ka
TYPE:     NONE    NONE   MULTI    NONE    NONE    NONE    NONE  LINEAR   MULTI  LINEAR  LINEAR  LINEAR
COEF1:    ----    ----  8.9270    ----    ----    ----    ----    ----  1.7870    ----    ----    ----
COEF2:    ----    ----  -.0001    ----    ----    ----    ----    ----   .0000    ----    ----    ----
COEF3:    ----    ----   .0000    ----    ----    ----    ----    ----   .0000    ----    ----    ----
  146G    ----    ----    4.83    ----    ----    ----    ----    1.04     .89     .68     .57     .26
  147G    ----    ----    4.99    ----    ----    ----    ----     .95     .79     .71     .55     .26

AVER:     ----    ----    4.91    ----    ----    ----    ----    1.00     .84     .70     .56     .26
SDEV:     ----    ----     .12    ----    ----    ----    ----     .06     .07     .02     .01     .01


In this particular (demo) example, the changes are slight, but consistent with what we would expect.  Let's try it on half a dozen REEs!
Title: Re: Multiple background "sharing"
Post by: Probeman on August 18, 2014, 05:16:43 PM
Ok, got some quick off-peak data to test this shared bgd feature.  I tuned up Ti, V, Cr and Mn in LLIF on spec 3 and Zr, Nb and Mo on LPET using normal off-peaks.

Note that the Ti-Mn PHAs are set to different gains but the Zr-Mo PHAs are all set the same.  I just wanted to see what difference that might make- I'll need to do additional tests however. This is just a first cut with some real data.

On and Off Peak Positions:
ELEM:    ti ka    v ka   cr ka   mn ka   zr la   nb la   mo la
ONPEAK 68218.0 62147.0 56844.0 52178.0 69413.0 65459.0 61831.0
OFFSET 73.3984 62.1328 54.5156 54.9023 -25.875 -29.016 -32.949
HIPEAK 69104.3 62971.8 57402.9 53019.4 71460.6 67408.4 63629.1
LOPEAK 67346.5 61415.9 56347.3 51041.6 67882.8 64334.6 60420.1
HI-OFF 886.297 824.801 558.898 841.398 2047.61 1949.38 1798.13
LO-OFF -871.50 -731.14 -496.70 -1136.4 -1530.2 -1124.4 -1410.9

PHA Parameters:
ELEM:    ti ka    v ka   cr ka   mn ka   zr la   nb la   mo la
DEAD:     3.80    3.80    3.80    3.80    3.25    3.25    3.25
BASE:      .56     .56     .56     .56     .56     .56     .56
WINDOW    4.00    4.00    4.00    4.00    4.00    4.00    4.00
MODE:       -1      -1      -1      -1      -1      -1      -1
GAIN:     700.    650.    600.    550.    800.    800.    800.
BIAS:    1850.   1850.   1850.   1850.   1300.   1300.   1300.

Last (Current) On and Off Peak Count Times:
ELEM:    ti ka    v ka   cr ka   mn ka   zr la   nb la   mo la
BGD:       OFF     OFF     OFF     OFF     OFF     OFF     OFF
BGDS:      LIN     LIN     LIN     AVG     LIN     LIN     LIN
SPEC:        3       3       3       3       2       2       2
CRYST:    LLIF    LLIF    LLIF    LLIF    LPET    LPET    LPET
ORDER:       1       2       3       4       1       2       3
ONTIM:   30.00   20.00   15.00   25.00   60.00   25.00   25.00
HITIM:   10.00    5.00    3.00    3.00   20.00    3.00    3.00
LOTIM:   10.00    5.00    3.00    3.00   20.00    3.00    3.00
UNFAC:       2       4       2       1       2       1       1
ONTIME   60.00   80.00   30.00   25.00  120.00   25.00   25.00
HITIME   20.00   20.00    6.00    3.00   40.00    3.00    3.00
LOTIME   20.00   20.00    6.00    3.00   40.00    3.00    3.00


This is for Ti Ka where the Search for "Shared" Bgds have been found and display in the multi-point bgd dialog from the Run menu:

(https://probesoftware.com/smf/oldpics/i58.tinypic.com/2hs13dt.jpg)

and here is for V Ka:

(https://probesoftware.com/smf/oldpics/i60.tinypic.com/11ijurn.jpg)

What I find interesting is that the Ti background would have the wrong slope (due to the noise in the off-peak measurement), if we didn't have this "shared" bgd feature! 

Here are data for Zr La in Nb:

(https://probesoftware.com/smf/oldpics/i62.tinypic.com/bjx46.jpg)
Title: Re: Multiple background "sharing"
Post by: John Donovan on August 24, 2014, 08:17:40 PM
If anyone would like to play with the above dataset, it is attached below.
john
Title: Re: Multiple background "sharing"
Post by: John Donovan on September 05, 2014, 04:49:20 PM
OK, I had to tweak a few things for the "shared" background method, but it looks good to go now.

Here are some screen shots attached below and this is a listing of the data after the sample was searched for shared bgds; note the lines highlighted in red:

Un   33 Tin metal
(Magnification (analytical) =  20000),        Beam Mode = Analog  Spot
(Magnification (default) =      400, Magnification (imaging) =    400)
Image Shift (X,Y):                                          .00,   .00
Pre Acquire String :                                        mag 100000
Post Acquire String :                                          mag 400
Number of Data Lines:   3             Number of 'Good' Data Lines:   3
First/Last Date-Time: 09/03/2014 03:20:36 PM to 09/03/2014 03:27:39 PM

Stage (or Beam Deflection) Coordinate Positions:
          X          Y          Z                 X          Y          Z
  170G  -11896.00   2673.000  -18.00000   171G  -11884.00   2673.000  -19.00000
  172G  -11872.00   2673.000  -18.00000

Sample Coordinates Referenced to Fiducial Set  13 F:\Userdata\StandardPOSData\johnson-metal_pos3.pos
 1  -12502. 4057.00 .000000
 2  -6053.0 -4729.0 6.00000
 3  -20437. -4894.0 -10.000

On and Off Peak Positions:
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
ONPEAK 41034.0 47355.0 49789.0 61652.0 39303.9 27621.9 48115.4
OFFSET 114.098 131.043 134.418 146.051 .007813 118.668 -.01172
HIPEAK 42377.8 48062.6 50818.5 62497.5 43763.9 28953.7 48658.5
LOPEAK 39585.9 45607.2 49098.9 60640.7 34843.9 26290.1 47572.3
HI-OFF 1343.80 707.602 1029.47 845.535 4460.00 1331.80 543.102
LO-OFF -1448.1 -1747.8 -690.10 -1011.3 -4460.0 -1331.8 -543.10

Multi-Point Background Positions and Parameters:
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
MULHI: 42377.8 48062.6 50818.5 62497.5    ----    ----    ----
MULHI: 48062.6 50818.5 62497.5    ----    ----    ----    ----
MULHI: 45607.2 49098.9 60640.7    ----    ----    ----    ----
MULHI: 50818.5 62497.5    ----    ----    ----    ----    ----
MULHI: 49098.9 60640.7    ----    ----    ----    ----    ----
MULHI: 62497.5    ----    ----    ----    ----    ----    ----
MULHI: 60640.7    ----    ----    ----    ----    ----    ----

MHIOFF 1343.80 707.602 1029.47 845.535    ----    ----    ----
MHIOFF 7028.60 3463.47 12708.5    ----    ----    ----    ----
MHIOFF 4573.22 1743.90 10851.7    ----    ----    ----    ----
MHIOFF 9784.47 15142.5    ----    ----    ----    ----    ----
MHIOFF 8064.90 13285.7    ----    ----    ----    ----    ----
MHIOFF 21463.5    ----    ----    ----    ----    ----    ----
MHIOFF 19606.7    ----    ----    ----    ----    ----    ----

ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
MULLO: 39585.9 39585.9 39585.9 39585.9    ----    ----    ----
MULLO:    ---- 42377.8 42377.8 42377.8    ----    ----    ----
MULLO:    ---- 45607.2 45607.2 45607.2    ----    ----    ----
MULLO:    ----    ---- 48062.6 48062.6    ----    ----    ----
MULLO:    ----    ---- 49098.9 49098.9    ----    ----    ----
MULLO:    ----    ----    ---- 50818.5    ----    ----    ----
MULLO:    ----    ----    ---- 60640.7    ----    ----    ----

MLOOFF -1448.1 -7769.1 -10203. -22066.    ----    ----    ----
MLOOFF    ---- -4977.2 -7411.2 -19274.    ----    ----    ----
MLOOFF    ---- -1747.8 -4181.8 -16045.    ----    ----    ----
MLOOFF    ----    ---- -1726.4 -13589.    ----    ----    ----
MLOOFF    ----    ---- -690.10 -12553.    ----    ----    ----
MLOOFF    ----    ----    ---- -10834.    ----    ----    ----
MLOOFF    ----    ----    ---- -1011.3    ----    ----    ----

ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
MACQHI       7       5       3       1    ----    ----    ----
MACQLO       1       3       5       7    ----    ----    ----
MUITHI       7       5       3       1    ----    ----    ----
MUITLO       1       3       5       7    ----    ----    ----
MULFIT       2       2       2       2    ----    ----    ----

PHA Parameters:
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
DEAD:     5.13    5.13    5.13    5.13    5.83    5.49    4.78
BASE:      .32     .32     .32     .32     .40     .30     .50
WINDOW    4.00    4.00    4.00    4.00    4.00    4.00    4.00
MODE:       -1      -1      -1      -1      -1      -1      -1
GAIN:     255.    255.    255.    255.    240.    122.     95.
BIAS:    1995.   1995.   1995.   1995.   1470.   1450.   1930.

Last (Current) On and Off Peak Count Times:
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
BGD:       OFF     OFF     OFF     OFF     OFF     OFF     OFF
BGDS:     MULT    MULT    MULT    MULT     LIN     LIN     LIN
SPEC:        4       4       4       4       1       2       3
CRYST:     PET     PET     PET     PET     PC1     TAP     LIF
ORDER:       1       4       2       3       1       1       1
ONTIM:   10.00   10.00   10.00   10.00   10.00   10.00   10.00
HITIM:    5.00    5.00    5.00    5.00    5.00    5.00    5.00
LOTIM:    5.00    5.00    5.00    5.00    5.00    5.00    5.00

Miscellaneous Sample Acquisition/Calculation Parameters:
KILO:    15.00   15.00   15.00   15.00   15.00   15.00   15.00
ENERGY   3.444   2.984   2.839   2.293    .525   1.740   6.400
EDGE:    3.929   3.352   3.174   2.521    .532   1.839   7.112
Eo/Ec:    3.82    4.47    4.73    5.95   28.21    8.16    2.11
STDS:      550     547     546     542      12     162     162

Combined Analytical Condition Arrays:
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
TAKE:     40.0    40.0    40.0    40.0    40.0    40.0    40.0
KILO:     15.0    15.0    15.0    15.0    15.0    15.0    15.0
CURR:     30.0    60.0    30.0    60.0    30.0    30.0    30.0
SIZE:       .0      .0      .0      .0      .0      .0      .0

Faraday/Aperture Beam Currents:
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
  170G  30.097  60.048  30.097  60.048  30.097  30.097  30.097
  171G  30.095  60.195  30.095  60.195  30.095  30.095  30.095
  172G  30.103  60.246  30.103  60.246  30.103  30.103  30.103

AVER:   30.098  60.163  30.098  60.163  30.098  30.098  30.098
SDEV:     .004    .103    .004    .103    .004    .004    .004

On-Peak (off-peak corrected) or MAN On-Peak X-ray Counts (cps/1nA) (and Faraday Current):
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
BGD:       OFF     OFF     OFF     OFF     OFF     OFF     OFF
SPEC:        4       4       4       4       1       2       3
CRYST:     PET     PET     PET     PET     PC1     TAP     LIF
ORDER:       1       4       2       3       1       1       1
  170G  327.82    -.18    -.09     .04    -.20   -1.20    -.06
  171G  327.82    -.09    -.07     .03     .03   -1.40     .01
  172G  329.21    -.11    -.11     .00     .15   -1.46    -.02

AVER:   328.28    -.13    -.09     .02    -.01   -1.35    -.02
SDEV:      .80     .05     .02     .02     .18     .14     .04
1SIG:     1.02     .04     .05     .02     .08     .11     .06
SIGR:      .78    1.21     .35     .84    2.28    1.31     .64
SERR:      .46     .03     .01     .01     .10     .08     .02
%RSD:      .24  -38.01  -20.02   80.13-2260.58  -10.28 -158.99

Off-Peak (calculated) X-ray Counts (cps/1nA):
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
TYPE:    MULTI   MULTI   MULTI   MULTI  LINEAR  LINEAR  LINEAR
COEF1:  4.2314  4.2322  4.2314  4.2322    ----    ----    ----
COEF2:  -.0001  -.0001  -.0001  -.0001    ----    ----    ----
COEF3:   .0000   .0000   .0000   .0000    ----    ----    ----
  170G    1.95    1.10     .88     .30    1.95    4.71     .93
  171G    1.91    1.09     .88     .30    1.84    4.79     .97
  172G    1.92    1.10     .89     .32    1.72    4.70     .92

AVER:     1.93    1.10     .88     .31    1.84    4.73     .94
SDEV:      .02     .01     .01     .01     .12     .05     .03

Raw Hi-Peak X-ray Counts (cps/1nA):
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
  170G    1.86     .85     .70     .31    1.04    2.45     .98
  171G    1.83     .91     .71     .33    1.16    2.38     .96
  172G    2.02     .90     .74     .33     .93    2.33     .89

AVER:     1.90     .88     .72     .32    1.04    2.39     .94
SDEV:      .10     .03     .02     .01     .11     .06     .05
1SIG:      .11     .05     .07     .03     .08     .13     .08
SIGR:      .91     .62     .31     .39    1.36     .45     .61

Raw Lo-Peak X-ray Counts (cps/1nA):
ELEM:    sn la   ag la   pd la   mo la    o ka   si ka   fe ka
  170G    2.67    1.15     .97     .33    2.87    6.97     .87
  171G    2.72    1.09     .87     .33    2.52    7.19     .99
  172G    2.49    1.14     .86     .36    2.51    7.06     .96

AVER:     2.63    1.13     .90     .34    2.63    7.07     .94
SDEV:      .12     .03     .06     .01     .20     .11     .06
1SIG:      .13     .06     .08     .03     .13     .22     .08
SIGR:      .90     .50     .80     .44    1.53     .53     .78
Title: Re: Multiple background "sharing" demonstration run
Post by: John Donovan on April 19, 2015, 09:04:45 AM
If anyone would like to "play" with a demonstration file with multi-point "shared" backgrounds, attached below is a PFE MDB file containing a number of standards with K and Cl already scanned for "shared" bgds.

When you open the MDB file in PFE, the app will warn that some standards are different. Usually it will recognize that you are using a different standard composition database than mine and offer to create temporary standard database. CLick Yes for this, and you'll be able to open the run and play around in it.

If necessary I've also attached my standard database, but you shouldn't need it as the standard compositions are now stored in the PFE MDB file as well.

Check out the improved MPB dialog from the Run menu as seen here:

(https://probesoftware.com/smf/oldpics/i59.tinypic.com/5bxukh.jpg)

Remember, you have to login to see and download attachments!

Warning: it would be best to click "no" after opening this file in Probe for EPMA (when asked whether to connect to the instrument hardware), as the default PFE install is for JEOL instruments, and this amphibole-demo2.mdb file was acquired using a Cameca instrument configuration.
Title: Re: Multiple background "sharing"
Post by: Philipp Poeml on April 20, 2015, 07:17:56 AM
Dear John,

I use this feature and I like it a lot! Could I ask for some improvements?

* If I press "search for shared backgrounds" it finds almost all elements on the same spectro, but I do not want to share backgrounds for everything. Could it be possible to somehow select for wich elements it should detect the shared backgrounds?

* Let's say I have 5 actinides on one spectro. And I want to measure 3 hi and 3 low background points and iterate 3 points. However, for 5 elements I have 5 hi and 5 low backgrounds. Could it be possible to select before searching the shared backgrounds that I want to iterate 3 high and 3 low? That would save me some clicking later, when selecting all the parameters for each elements...

Cheers
Philipp
Title: Re: Multiple background "sharing"
Post by: Probeman on April 20, 2015, 10:52:17 AM
Dear John,

I use this feature and I like it a lot! Could I ask for some improvements?

* If I press "search for shared backgrounds" it finds almost all elements on the same spectro, but I do not want to share backgrounds for everything. Could it be possible to somehow select for wich elements it should detect the shared backgrounds?

* Let's say I have 5 actinides on one spectro. And I want to measure 3 hi and 3 low background points and iterate 3 points. However, for 5 elements I have 5 hi and 5 low backgrounds. Could it be possible to select before searching the shared backgrounds that I want to iterate 3 high and 3 low? That would save me some clicking later, when selecting all the parameters for each elements...

Cheers
Philipp

Hi Philipp,
This is a good idea and already requested by Karsten Goemann.   

You could, from the Run | Display Multi-Point background Intensities dialog, edit the "Never Use" and "Always use" check boxes to configure your multi-point backgrounds anyway you want, but you'll have to do it one sample at a time as seen here:

(https://probesoftware.com/smf/oldpics/i59.tinypic.com/2m2z2v9.jpg)

Therefore, I intend (as soon as I get a few days free), to add the "Never Use" and "Always use" checkboxes to the Elements/Cation dialog so one can set them for all selected samples.  This will be cool, I agree.
Title: Re: Multiple background "sharing"
Post by: Philipp Poeml on April 22, 2015, 11:15:47 PM
Yes, it would be something like allowing multi select here:

(https://probesoftware.com/smf/oldpics/i61.tinypic.com/2jcg5t4.jpg)

The other two points would be also helpful, like a short dialog about what elements it should consider before detecting. Also the how many points you would like to consider. As seen from the screen shot that would be valid for all the actinides and could be set easily before starting the multipoint detection.
Title: Re: Multiple background "sharing"
Post by: John Donovan on April 23, 2015, 05:13:11 PM
Ok, I added the MPB "NeverUse/AlwaysUse" manual flags to the Elements/Cations dialog in PFE as seen here:

(https://probesoftware.com/smf/oldpics/i59.tinypic.com/25jxvrc.jpg)

It seems to work great with my testing, but give it a try yourself. Ready to download now.

The advantage being of course that once you figure which MPB is problematic you can manually set them for selected samples from the Elements/Cations dialog.
john
Title: Re: Multiple background "sharing"
Post by: Karsten Goemann on April 23, 2015, 05:37:53 PM
Hi John,

Thanks for adding this, looks promising!

This might also make it easier to specify always include/exclude positions in sample setups with shared backgrounds, because it'll remember those settings in spite of the samples being acquired as off-peak? Or will it overwrite those settings when you hit the "Search for Shared Backgrounds" button? I'll have to try it out!

Cheers,
Karsten
Title: Re: Multiple background "sharing"
Post by: John Donovan on April 25, 2015, 10:00:46 AM
This modified dialog should allow one to edit "shared" bgds just as you do multi-point backgrounds (MPBs).  See here for the parameters that are now editable for selected samples from the new Elements/Cations dialog for this "normal" MPB acquired channel:

(https://probesoftware.com/smf/oldpics/i58.tinypic.com/167a6vq.jpg)

Here by the way, is how a "shared" bgd channel appears in the Elements/Cations dialog:

(https://probesoftware.com/smf/oldpics/i59.tinypic.com/o5x00o.jpg)

It was originally two separate off-peak channels that were "shared" using the Search/Remove "Shared" Bgds buttons in the Analyze! window as seen here:

(https://probesoftware.com/smf/oldpics/i60.tinypic.com/2952z4p.jpg)
Title: Re: Multiple background "sharing"
Post by: John Donovan on February 08, 2018, 12:16:45 PM
Karsten Goemann recently noticed something interesting regarding the use of "shared" backgrounds. In a run analyzing some rutile minerals, Karsten acquired Ti using EDS (a good idea since it's not a trace element), and the remaining minor and trace elements using WDS and normal off-peak backgrounds.  Without "shared" bgds feature turned on, we see the following example of (intensity data) output:

On-Peak (off-peak corrected) or EDS (bgd corrected) or MAN On-Peak X-ray Counts (cps/1nA) (and Faraday/Absorbed Currents):
ELEM:    Ti ka   Si ka   Ca ka    V kb   Cr ka   Mn ka   Fe ka   Zr la   Nb la   Sn la   Ta la    W ma   BEAM1   BEAM2
BGD:       EDS     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF
SPEC:        0       1       4       5       5       2       2       3       3       4       2       1
CRYST:     EDS     TAP    PETL    LIFL    LIFL    LiFL    LiFL    PETL    PETL    PETL    LiFL     TAP
ORDER:       1       2       1       1       2       3       2       1       2       2       1       1
  108G   71.48     .28     .77     .20     .81     .01    6.37     .33     .49     .05     .05    -.03 200.200 200.200

AVER:    71.48     .28     .77     .20     .81     .01    6.37     .33     .49     .05     .05    -.03 200.200 200.200
SDEV:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00    .000    .000

Note that a number of elements "share" the same spectrometer and crystal, therefore they are candidates for the "shared" background method which converts normal off-peak measurements into multi-point background (MPB) measurements using only software. This feature is activated in the Analyze! window using the following buttons as seen here:

(https://probesoftware.com/smf/gallery/1_08_02_18_12_01_02.png)

However, after clicking the "Search For "Shared" Bgds" button, Karsten noticed that the software did not seem to find any elements with off-peak bgds that were capable of being "shared".  The following output still shows normal (unshared) off-peak backgrounds as seen here:

On-Peak (off-peak corrected) or EDS (bgd corrected) or MAN On-Peak X-ray Counts (cps/1nA) (and Faraday/Absorbed Currents):
ELEM:    Ti ka   Si ka   Ca ka    V kb   Cr ka   Mn ka   Fe ka   Zr la   Nb la   Sn la   Ta la    W ma   BEAM1   BEAM2
BGD:       EDS     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF
SPEC:        0       1       4       5       5       2       2       3       3       4       2       1
CRYST:     EDS     TAP    PETL    LIFL    LIFL    LiFL    LiFL    PETL    PETL    PETL    LiFL     TAP
ORDER:       1       2       1       1       2       3       2       1       2       2       1       1
  108G   71.48     .28     .77     .20     .81     .01    6.37     .33     .49     .05     .05    -.03 200.200 200.200

AVER:    71.48     .28     .77     .20     .81     .01    6.37     .33     .49     .05     .05    -.03 200.200 200.200
SDEV:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00    .000    .000
1SIG:      .05     .02     .03     .01     .01     .02     .04     .01     .01     .01     .03     .01
SIGR:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00
SERR:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00
%RSD:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00

Off-Peak (calculated) or EDS (bgd) X-ray Counts (cps/1nA):
ELEM:    Ti ka   Si ka   Ca ka    V kb   Cr ka   Mn ka   Fe ka   Zr la   Nb la   Sn la   Ta la    W ma
TYPE:     ----  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR  LINEAR
  108G     .00    1.77    3.39     .72     .71     .96    1.41     .26     .33    2.60    3.41    1.84

When we looked further into it, we found the problem: the software had decided that the elements that would seemingly be candidates for "shared" bgds did not qualify because they had different PHA bias values!

Now we probably should discuss whether having different PHA bias values is a valid concern here, because we really don't know if sharing off-peak measurements for elements with the same spectrometer and crystal (and keV of course!) is all that needs to be checked for.  Karsten and I (and Julien Allaz and Mike Jercinovic) originally decided to err on the side of caution and make the default to also check for different PHA biases, but we could use some testing to investigate this question, and I imagine it would, at the very least, be a question of exactly how different the PHA bias values are... it would make a nice little research project if anyone is interested.

That said, there is a flag in the Analysis Option dialog to "turn off" checking for different PHA bias values for "shared" bgds as seen here:

(https://probesoftware.com/smf/gallery/1_08_02_18_12_01_38.png)

So now that we've unchecked the flag to check for elements with different PHA values, we again run the search for "shared" backgrounds and low and behold, we now obtain the "shared" backgrounds as we originally expected:

On-Peak (off-peak corrected) or EDS (bgd corrected) or MAN On-Peak X-ray Counts (cps/1nA) (and Faraday/Absorbed Currents):
ELEM:    Ti ka   Si ka   Ca ka    V kb   Cr ka   Mn ka   Fe ka   Zr la   Nb la   Sn la   Ta la    W ma   BEAM1   BEAM2
BGD:       EDS     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF
SPEC:        0       1       4       5       5       2       2       3       3       4       2       1
CRYST:     EDS     TAP    PETL    LIFL    LIFL    LiFL    LiFL    PETL    PETL    PETL    LiFL     TAP
ORDER:       1       2       1       1       2       3       2       1       2       2       1       1
  108G   71.48     .33     .81     .20     .82     .01    6.40     .34     .49     .05     .06     .00 200.200 200.200

AVER:    71.48     .33     .81     .20     .82     .01    6.40     .34     .49     .05     .06     .00 200.200 200.200
SDEV:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00    .000    .000
1SIG:      .05     .02     .03     .01     .01     .02     .04     .01     .01     .01     .03     .01
SIGR:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00
SERR:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00
%RSD:      .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00     .00

Off-Peak (calculated) or EDS (bgd) X-ray Counts (cps/1nA):
ELEM:    Ti ka   Si ka   Ca ka    V kb   Cr ka   Mn ka   Fe ka   Zr la   Nb la   Sn la   Ta la    W ma
TYPE:     ----   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI
COEF1:    ----  3.3610  4.7098  4.8158  4.8158  4.5182  4.5182  3.4195  3.4195  4.7098  4.5182  3.3610
COEF2:    ----  -.0365  -.0325  -.0324  -.0324  -.0312  -.0312  -.0247  -.0247  -.0325  -.0312  -.0365
COEF3:    ----   .0000   .0000   .0000   .0000   .0000   .0000   .0000   .0000   .0000   .0000   .0000
  108G     .00    1.71    3.35     .71     .71     .96   

So all is good now, but just because we were both fooled by this extra PHA bias check, we decided to add a warning to the "shared" bgd search code, to let the user know if the off-peak bgd elements could be "shared", but for the fact that the PHA bias values are different!  Here is an example of that warning output to the log window:

(https://probesoftware.com/smf/gallery/1_08_02_18_12_01_23.png)

Slightly cryptic maybe, but at least it's a reminder to jog our memory!  Anyway, now we can utilize these "shared" bgd intensities in the multi-point bgd (MPB) dialog for high accuracy trace element analysis as seen here:

(https://probesoftware.com/smf/gallery/1_08_02_18_12_01_53.png)

 These new "shared" bgd different PHA bias warnings are available in Probe for EPMA v. 12.1.6 and is ready to download now.
Title: Re: Multiple background "sharing"
Post by: John Donovan on October 28, 2018, 12:52:46 PM
Earlier this year I posted some measurements I did on two NIST SRM metal alloy standards looking at their micro homogeneity:

https://probesoftware.com/smf/index.php?topic=1067.msg7105#msg7105

Recently I realized that this run might be a nice candidate for showing off the "shared bgd" method (pioneered by Karsten Goemann), in which one takes normal off-peak measurements (when two or more elements use the same WDS crystal and spectrometer) and loads these off-peak background intensities from each element, into the multi-point-background (MPB) arrays for more accurate fitting of background models, particularly where the continuum is curved or interference by secondary peaks on the background positions may occur (a method pioneered by Jullien Allaz, Mike Jercinovic and Mike Williams). A full paper on both of these techniques is currently in review.

The elemental setup for this particular run is shown here:

(https://probesoftware.com/smf/gallery/1_28_10_18_11_54_56.png)

And it can be seen that except for oxygen all the other elements could benefit from this shared bgd treatment.  That is, these elements were all acquired using normal off-peak bgds as seen here:

On-Peak (off-peak corrected) or EDS (bgd corrected) or MAN On-Peak X-ray Counts (cps/30nA) (and Faraday/Absorbed Currents):
ELEM:    ni ka   mo la   cr ka   fe ka    w ma   co ka   si ka   mn ka    v ka   cu ka    o ka   BEAM1   BEAM2
BGD:       OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF     OFF
SPEC:        5       4       5       3       2       3       4       5       2       3       1
CRYST:     LIF     PET     LIF    LLIF    LPET    LLIF     PET     LIF    LPET    LLIF     PC1
ORDER:       1       1       2       1       1       2       2       3       2       3       1
  521G  2717.2      .5     3.4 10597.0     -.7    14.5    23.4    20.6     6.3    35.1    34.5  49.883  49.883
  522G  2725.7      .3     4.7 10602.9     -.5    16.7    23.9    19.5     9.5    41.7    37.5  49.898  49.913
  523G  2730.6     1.1     3.4 10586.4      .0    18.7    23.1    19.6     6.4    42.7    40.6  49.928  49.913
etc.


But after utilizing the Search For "Shared" Bgds button seen here:

(https://probesoftware.com/smf/gallery/1_28_10_18_11_55_11.png)

The MPB arrays are automatically loaded and assigned as MPB background fits as seen here:

Off-Peak (calculated) or EDS (bgd) X-ray Counts (cps/30nA):
ELEM:    ni ka   mo la   cr ka   fe ka    w ma   co ka   si ka   mn ka    v ka   cu ka    o ka
TYPE:    MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI   MULTI  LINEAR
COEF1:  7.8540  6.9217  7.8539-29.7384 -3.3149-29.7384  6.9218  7.8540 -3.3149-29.7384    ----
COEF2:  -.0002  -.0001  -.0002   .0006   .0000   .0006  -.0001  -.0002   .0000   .0006    ----
COEF3:   .0000   .0000   .0000   .0000   .0000   .0000   .0000   .0000   .0000   .0000    ----
  521G    25.6     4.6     8.3    61.3     7.5    75.1     3.3    11.6   143.9   105.8    77.4
  522G    27.7     4.7     8.0    60.3     7.0    73.7     3.2    11.5   142.2   103.3    76.0
  523G    27.5     3.9     8.6    59.3     6.7    73.0     3.1    12.1   143.4   103.6    76.9
etc.


So all well and good, but a problem then appeared.

This run had a lot of data points as these were long traverses in order to document the micro-homogeneity, and after loading the MPB arrays with these "shared" bgds , the program slowed way down when loading data from these samples.  Everything would work, but everything got slow as molasses!

We finally tracked the problem down to the fact that I (smack on forehead) had coded the saving of the MPB intensities inside the datarow and element loops, so the MPB intensities got written numerous times causing the database to rapidly grow in disk size.  This had not been noticeable in previous uses of the "shared" bgds feature but once you start getting hundreds of data points it starts to multiply.   :-[

Anyway, we think we've fixed it all, but Karsten Goemann, Owen Neill and Gareth Seward are testing the new code as we speak.  But in the meantime I can still "show off" the results. First here is a screenshot of the MPB display after the shared bgds are searched for and loaded:

(https://probesoftware.com/smf/gallery/1_28_10_18_11_55_26.png)

Note that depending on the element location, there will be various numbers of MPB backgrounds on either side of the peak (shown by the vertical red line). And for reference here are the quant results, first without the shared backgrounds (normal off-peaks):

(https://probesoftware.com/smf/gallery/1_28_10_18_12_40_11.png)

and here using the shared (MPB) bgds:

(https://probesoftware.com/smf/gallery/1_28_10_18_12_40_28.png)

None of these elements are really trace level so the application of shared MPB fitting in this situation is not really necessary (though it does validate the new and improved code!). But when one starts looking at concentrations below a few hundred PPM, this becomes a big deal because what really matters for trace element quantification is the accuracy of the background measurement!  And having more than two background measurements comes in really handy for determining that.

Because, after all, one can fit a line to any two points and call it an interpolation...  but the question is: it is the *correct* line?

Anyway, if anyone else is interested in beta testing this improved shared bgd code, drop us an email and we will invite you to the PFE Dropbox where you can grab this latest Probewin.exe version.  Once we hear back from our beta testers we will release the full 12.5.0 version of Probe for EPMA. The good news is that the new code seems to speed things up considerably, especially in large probe databases with lots of analyses.
Title: Re: Multiple background "sharing"
Post by: BenjaminWade on October 28, 2018, 04:30:54 PM
Hi John
Just wanted to say I am looking forward to the bug fix being uploaded. I recently did some shared background work recently on some glass standards of which I had a few hundred points under each sample heading...and I think my beard grew another inch when I had to process it.

Cheers
Title: Re: Multiple background "sharing"
Post by: John Donovan on October 28, 2018, 05:40:53 PM
Hi John
Just wanted to say I am looking forward to the bug fix being uploaded. I recently did some shared background work recently on some glass standards of which I had a few hundred points under each sample heading...and I think my beard grew another inch when I had to process it.

Cheers

Hi Ben,
I'll tell you a little secret: if you update using the third update method (download from probesoftware), you can get the update now.  You might need to start with the original file and run the "search for shared bgds" method for best results.  Or maybe just run the "remove shared bgds" first.  Both methods run faster now.

That's what we're testing.
john
Title: Re: Multiple background "sharing"
Post by: BenjaminWade on October 29, 2018, 04:22:10 PM
Hi John
Great thanks for that. I have updated it and it does seem to run a lot faster now analysing the data

cheers
Title: Re: Multiple background "sharing"
Post by: John Donovan on February 20, 2020, 11:06:29 AM
Mike Jercinovic and Mike Williams (U Mass Amherst) recently contacted us with a feature request for the "shared" background method. As many of you know, the "shared" background method, which is a variation of the multi-point background method, was originally suggested by Karsten Goemann (U Tasmania). Let's quickly review these various background methods.

When setting up a quantitative analysis in Probe for EPMA, one can select three different methods for background calibration: traditional off-peak, mean atomic number (MAN), and multiple-point background acquisition methods.

Everyone is familiar with the traditional off-peak method where one acquires a background measurement on each side of the emission peak, and then interpolates the background intensity under the peak (or alternatively one can acquire both background measurements on the same side of the peak and then extrapolate to the background intensity under the peak).

The MAN background method, described in various topics throughout the forum, e.g., here:

https://probesoftware.com/smf/index.php?topic=4.0

https://probesoftware.com/smf/index.php?topic=307.0

has advantages in saving time and improving precision, by constructing an MAN calibration curve that can be applied to both standards and unknowns of diverse compositions, by making measurements at the *on-peak* position, versus average atomic number (Kramer's Law),  in standard materials that *do not* contain the element of interest. A recent variation on the MAN method, originally suggested by Ben Hanson (Corning Glass) and further suggestions by Phil Orlandini (U Texas, Austin), utilizes interpolated *off-peak* measurements on standards to construct an MAN calibration curve for unknowns, where only the on-peak intensities are measured.  Thus avoiding on-peak contamination effects (from impure standards), on the on-peak measurements on the standards, and also off-peak interferences on the unknowns. More on this can be found here:

https://probesoftware.com/smf/index.php?topic=987.0

Please note that these topics go back a long way, so you might want to skip to the end of the topics, to start with the most recently posted material. A nice summary of the original MAN method can be found in Donovan et al., (2016), Amer. Min.

The multi-point background method (originally suggested by Mike Jercinovic, Julien Allaz (ETH Zurich) and Mike Williams) is similar to the off-peak method, but it utilizes more than one background measurement on each side of the peak. The idea being to characterize the background with greater rigor, particularly in cases where extreme accuracy is required and/or the shape of the background is significantly curved.  Here is an example of a typical MPB acquisition for U mb by Mike Jercinovic:

(https://probesoftware.com/smf/gallery/1_20_02_20_9_48_24.png)

The MPB method is especially useful for complex matrices (e.g., monazites) where the composition can change unexpectedly, thus causing unanticipated off-peak interferences. And because the MPB has multiple background measurements, it can quickly iterate to find the best background interpolation as seen here:

(https://probesoftware.com/smf/gallery/1_20_02_20_9_48_38.png)

One can also specify these MPB adjustments manually using the so called "manual" over-ride flags if necessary in post processing.

The "shared" background method is a variation of the MPB method, where one acquires traditional off-peak backgrounds on more than one element, which "share" the same spectrometer and Bragg crystal as seen here:

(https://probesoftware.com/smf/gallery/1_20_02_20_9_48_55.png)

and described in more detail here:

https://probesoftware.com/smf/index.php?topic=9.0

and then utilizes the MPB arrays to process these off-peak data *as though* they had been acquired using the MPB acquisition method. The curious aspect to the "shared" bgd method is that because the off-peak measurements are *shared* for all the elements using the same spectrometer and Bragg crystal, the background fits for all these shared elements are exactly the same!

What Mike Jercinovic and Mike Williams wanted us to do was to allow the user to assign the same background fit obtained for one shared element, to all the other shared elements on that same spectrometer and crystal.  Which is perfectly reasonable of course, but it turned out to be a bit of a hassle to code for a couple of reasons.

So when we first designed the MPB method we decided to limit the acquisition to 12 off-peak measurements on each side of the emission peak for a total of 24 off-peak measurements. No one would ever need to acquire more than 12 backgrounds on each side of an emission peak, right? 

Not a bad assumption when utilizing multi-point backgrounds of course. But when using the shared background method, the first and last element on that spectrometer/crystal can contain 2 * n -1 backgrounds on one side of the peak (where n is the number of elements). This means that one could have up to seven elements per spectrometer/crystal combination and all the background measurements would be available when the limit is 12 backgrounds. But Mike and Mike had a monazite run where they had *nine* elements on the same spectrometer and crystal, not seven!

https://www.youtube.com/watch?v=xwKaXcTPKjE

So that means the elements at the top and bottom of the spectrometer range could have up to 17 background on one side of the peak. Oh, god.  The problem wasn't so much just increasing the size of the MPB arrays, but finding enough space to fit all the additional manual over-ride flags in the GUI:

(https://probesoftware.com/smf/gallery/1_20_02_20_9_48_55.png)

So we settled on adding 6 more backgrounds to each side of the peak for a total of 36 off-peak backgrounds per elements. Yes, that's right, thirty-six off-peak measurements.   :o

So, in practical terms what does this mean? Well looking at the above plot, we can adjust our "iterate to" parameters to get the MPB background fit we want, as seen here:

(https://probesoftware.com/smf/gallery/1_20_02_20_9_49_11.png)

and then we utilize this handy new button seen here, to assign this fit to all the other "shared"background elements as seen here:

(https://probesoftware.com/smf/gallery/1_20_02_20_9_49_28.png)

The other less visible difficulty was figuring out how to keep track of which backgrounds corresponded to each of the elements on that spectrometer/crystal, as the load order will be different for each element depending on all kinds of details in the acquisition. In the end, we figured out a way to base the background selections on the actual off-peak spectrometer positions, because, after all, they are "shared" backgrounds!

 :)

Version 12.8.4 of Probe for EPMA is now available for downloading using the Help menu as usual.
Title: Re: Multiple background "sharing"
Post by: Philipp Poeml on February 26, 2020, 07:09:05 AM
But Mike and Mike had a monazite run where they had *nine* elements on the same spectrometer and crystal, not seven!


So we settled on adding 6 more backgrounds to each side of the peak for a total of 36 off-peak backgrounds per elements. Yes, that's right, thirty-six off-peak measurements.   :o


Great! Happens to us all the time. Was on my wishlist for long, but would not have dared to ask.
Title: Re: Multiple background "sharing"
Post by: Karsten Goemann on February 26, 2020, 03:49:30 PM
Awesome! I'm the same as Philipp.

This is particularly great for absorption edges (like Ar K on P10 counters, or major element K edges).
I did have up to 8 elements on a spectro before (when the additional backgrounds were just discarded when sharing).
Title: Re: Multiple background "sharing"
Post by: John Donovan on February 26, 2020, 03:56:41 PM
Awesome! I'm the same as Philipp.

This is particularly great for absorption edges (like Ar K on P10 counters, or major element K edges).
I did have up to 8 elements on a spectro before (when the additional backgrounds were just discarded when sharing).

We're pleased that several labs find this expansion of the multi-point background method useful.

This is really complicated code and not easy to modify (and maintain backward compatibility!).
Title: Re: Multiple background "sharing"
Post by: John Donovan on December 21, 2020, 02:11:15 PM
Sorry for this long post but we wanted to update you all on a new and somewhat subtle behavior for the "shared" background method. Our story most recently begins when Mike Williams at U Mass, who has been utilizing the "shared" MPB method in Probe for EPMA (see this this topic for more details), had a suggestion that we thought was quite interesting, but seemingly somewhat difficult to implement.

As most of you know, the multi-point background (MPB) method, originally proposed by Mike Jercinovic, Julien Allaz and Mike Williams,  allows the analyst to acquire *multiple* background measurements on each side (or just one side!) of the peak position. Up to 18 off-peak measurements on each side of the peak for a total of 36(!) off-peak measurements. Very useful when one is trying to characterize the background curvature with high accuracy for trace elements.

Actually the MPB method used to be limited to (only!) 12 off-peak measurements on each side for a total of 24 background measurements, but then Mike Jercinovic and Mike Williams actually found a need for larger MPB arrays (those guys are just crazy about trace elements!) when searching off-peak elements for use as "shared" backgrounds as described in reply #28 above. For those not familiar,  the "shared" background method was an idea from Karsten Goemann and Gareth Seward which utilizes multiple (two background) off-peak elements, acquired on the same spectrometer and Bragg crystal, to allow all the off-peak intensities to be fitted as MPB measurements for each element.  The idea was quite clever because it utilized the already implemented MPB method structures and arrays.

Anyway back to recent events, in very complex spectra Mike and Mike found that there sometimes isn't room for each element to have two off-peak backgrounds, so they asked if we could simply skip acquisition of one of the normal off-peak backgrounds for a particular element.  Well the long and short of that discussion is that it is just not practical, as there is simply too much code that depends on there being two off-peak backgrounds for each element. Also, allowing the analyst to acquire a single background measurement is (in our humble opinion) not very rigorous, since the continuum is generally sloped at a sufficient level of precision.

However there are several off-peak background *fitting* methods in Probe for EPMA that allows the analyst to specify that either only the high or only the low of-peak measurement be included in the background fit. These are respectively the "high only" and "low only" off-peak background fit options (and also the slope high and slope low options) as described here:

https://probesoftware.com/smf/index.php?topic=68.msg6255#msg6255

So we proposed that they acquire two point backgrounds as usual, but then just set the acquisition time for the background they don't need, to a very short time.  There's still the spectrometer motion, but that is pretty quick. Then, they just assign the off-peak background fit on those elements to either "high only" or "low only" depending on which off-peak measurement they want to ignore.

Finally (whew) from the Analyze! window when they do search for "shared" backgrounds, the modified code now also checks the off-peak background fit option and ignores the off-peak measurement that is not being utilized in the off-peak fit. Here is an example of 4 off-peak elements fit using the "shared" background option, but where V Ka was specified as "high only" and Cr Ka was specified as "low only", so only these off-peak measurements for those two elements were utilized in the MPB fit:

(https://probesoftware.com/smf/gallery/1_18_12_20_10_44_27.png)

And in case anyone is interested here is the source code for searching/removing "shared" backgrounds:

Code: [Select]
Sub AnalyzeSharedBgdSearchOrRemove(mode As Integer, tForm As Form, sample() As TypeSample)
' Search and load or search and remove shared backgrounds to or from multi-point bgd arrays for the selected samples
' 1 = search and load multi-point background arrays
' 2 = search and delete multi-point background arrays

ierror = False
On Error GoTo AnalyzeSharedBgdSearchOrRemoveError

Dim i As Integer, samplerow As Integer
Dim chan1 As Integer, chan2 As Integer
Dim j As Integer, sampleorder As Integer, nsams As Integer
Dim samplemultihi As Integer, samplemultilo As Integer
Dim sampleupdated As Boolean

Dim tVolatile As TypeVolatile

' Check for at least one selected sample
Call SampleCheckSampleList(tForm.ListAnalyze, nsams%, samplerow%)
If nsams% = 0 Or samplerow% = 0 Or ierror Then Exit Sub

' Loop through all selected samples and find "shared" bgds
For i% = 0 To tForm.ListAnalyze.ListCount - 1
If tForm.ListAnalyze.Selected(i%) = True Then
samplerow% = tForm.ListAnalyze.ItemData(i%)
If SampleTyps%(samplerow%) <> 3 And Not SampleDels%(samplerow%) Then

' Update status
Call IOStatusAuto("Loading sample " & SampleGetString$(samplerow%) & "...")
Call AnalyzeStatusAnal("Loading sample " & SampleGetString$(samplerow%) & "...")
DoEvents

' Get sample data (do not call DataCorrect so intensities are "raw" cps)
Call DataGetMDBSample(samplerow%, sample())
If ierror Then Exit Sub

' Loop on data points
For j% = 1 To sample(1).Datarows%
sampleupdated = False

' Check for acquired off-peak bgds (only off-peak channel multi-point data arrays can be overwritten)
For chan1% = 1 To sample(1).LastElm%
If sample(1).CrystalNames$(chan1%) <> EDS_CRYSTAL$ And sample(1).BackgroundTypes%(chan1%) = 0 Then   ' 0 = off-peak, 1 = MAN, 2 = MultiPoint

' Find other elements (with same keV, spectro and xtal, PHA?)
If mode% = 1 Then
samplemultihi% = 0
samplemultilo% = 0
sampleorder% = 1    ' in case alternating on/off arrays are not found
sample(1).MultiPointNumberofPointsAcquireHi%(chan1%) = 0
sample(1).MultiPointNumberofPointsIterateHi(chan1%) = 0
sample(1).MultiPointNumberofPointsAcquireLo%(chan1%) = 0
sample(1).MultiPointNumberofPointsIterateLo(chan1%) = 0
MPB_Flag(chan1%) = False
tOffPeakCorrectionTypes%(chan1%) = sample(1).OffPeakCorrectionTypes%(chan1%)    ' save original off-peak correction types (won't work if file is closed)

' Search all elements to see if shared MPBs are available to load
For chan2% = 1 To sample(1).LastElm%
If sample(1).DisableAcqFlag(chan2%) = 0 Then
If sample(1).DisableQuantFlag(chan2%) = 0 Then

' Check for off-peak acquisition (because MPB arrays are writable)
If sample(1).CrystalNames$(chan2%) <> EDS_CRYSTAL$ And sample(1).BackgroundTypes%(chan2%) = 0 Then   ' 0 = off-peak, 1 = MAN, 2 = MultiPoint

' Check for same keV, spectro and xtal, and PHA?)
If sample(1).KilovoltsArray!(chan1%) = sample(1).KilovoltsArray!(chan2%) Then
If sample(1).MotorNumbers%(chan1%) = sample(1).MotorNumbers%(chan2%) Then
If Trim$(UCase$(sample(1).CrystalNames$(chan1%))) = Trim$(UCase$(sample(1).CrystalNames$(chan2%))) Then

' Warn user if only PHA bias values are different (Goemann, 02/07/2018)
If AnalysisCheckForSamePHASettings And sample(1).Biases!(chan1%) <> sample(1).Biases!(chan2%) Then
msg$ = "AnalyzeSharedBgdSearchOrRemove: Only PHA bias values are different for " & sample(1).Elsyms$(chan1%) & " on channel " & Format$(chan1%) & " and " & sample(1).Elsyms$(chan2%) & " on channel " & Format$(chan2%)
Call IOWriteLogRichText(msg$, vbNullString, Int(LogWindowFontSize%), vbMagenta, Int(FONT_REGULAR%), Int(0))
End If

If Not AnalysisCheckForSamePHASettings Or (AnalysisCheckForSamePHASettings And sample(1).Biases!(chan1%) = sample(1).Biases!(chan2%)) Then

' Write chan2 "shared" alternating on-peak intensity data to chan1 alternating on/off multi-point bgd tables
If sample(1).AlternatingOnAndOffPeakAcquisitionFlag Then
Call DataVolatileGetData(Int(1), samplerow%, j%, chan2%, tVolatile)
If ierror Then Exit Sub
For sampleorder% = 1 To tVolatile.VolatilePoints%
If sample(1).CombinedConditionsFlag Then    ' re-normalize chan2% cps to beam current of chan1%
tVolatile.VolatileIntensity!(sampleorder%) = tVolatile.VolatileIntensity!(sampleorder%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If                                      ' "samplemulti" is always "1" for alternating on-peak intensities
Call DataMultiPointOnOffSendData(Int(1), samplerow%, j%, chan1%, Int(1), sampleorder%, tVolatile.VolatileIntensity!(sampleorder%), tVolatile.VolatileInterval!(sampleorder%), tVolatile.VolatileDateTime#(sampleorder%))
If ierror Then Exit Sub
Next sampleorder%
End If

' Start checking for high side off-peaks (0=linear, 1=average, 2=high only, 3=low only, 4=exponential, 5=slope hi, 6=slope lo, 7=polynomial, 8=multi-point)
If sample(1).HiPeaks!(chan2%) > sample(1).OnPeaks!(chan1%) And sample(1).OffPeakCorrectionTypes%(chan2%) <> 3 Then      ' modified to exclude high off-peaks if low only off-peaks (Williams and Jercinovic, 12-10-2020)
If samplemultihi% + 1 <= MAXMULTI% Then
If samplemultihi% + 1 <= MAXMULTI_OLD% Or ProbeDataFileVersionNumber! >= 12.84 Then
samplemultihi% = samplemultihi% + 1

' Write chan2 "shared" alternating hi off-peak intensity data (from HiPeak channels) to chan1 alternating on/off multi-point bgd tables
If sample(1).AlternatingOnAndOffPeakAcquisitionFlag Then
Call DataVolatileGetData(Int(2), samplerow%, j%, chan2%, tVolatile)
If ierror Then Exit Sub
For sampleorder% = 1 To tVolatile.VolatilePoints%
If sample(1).CombinedConditionsFlag Then    ' re-normalize chan2% cps to beam current of chan1%
tVolatile.VolatileIntensity!(sampleorder%) = tVolatile.VolatileIntensity!(sampleorder%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If
Call DataMultiPointOnOffSendData(Int(2), samplerow%, j%, chan1%, samplemultihi%, sampleorder%, tVolatile.VolatileIntensity!(sampleorder%), tVolatile.VolatileInterval!(sampleorder%), tVolatile.VolatileDateTime#(sampleorder%))
If ierror Then Exit Sub
Next sampleorder%
End If

' Now write high off-peak intensities to MPB arrays for chan2% (normalize to chan1% beam current if combined condition sample)
If Not sample(1).CombinedConditionsFlag Then
sample(1).MultiPointAcquireCountsHi!(j%, chan1%, samplemultihi%) = sample(1).HiPeakCounts!(j%, chan2%)
Else
sample(1).MultiPointAcquireCountsHi!(j%, chan1%, samplemultihi%) = sample(1).HiPeakCounts!(j%, chan2%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If

sample(1).MultiPointAcquireCountTimesHi!(j%, chan1%, samplemultihi%) = sample(1).HiCountTimes!(j%, chan2%)
sample(1).MultiPointAcquirePositionsHi!(chan1%, samplemultihi%) = sample(1).HiPeaks!(chan2%)
sample(1).MultiPointAcquireLastCountTimesHi!(chan1%, samplemultihi%) = sample(1).LastHiCountTimes!(chan2%)
End If
End If
End If

' Now check low peaks for high side  (0=linear, 1=average, 2=high only, 3=low only, 4=exponential, 5=slope hi, 6=slope lo, 7=polynomial, 8=multi-point)
If sample(1).LoPeaks!(chan2%) > sample(1).OnPeaks!(chan1%) And sample(1).OffPeakCorrectionTypes%(chan2%) <> 2 Then      ' modified to exclude low off-peaks if high only off-peaks (Williams and Jercinovic, 12-10-2020)
If samplemultihi% + 1 <= MAXMULTI% Then
If samplemultihi% + 1 <= MAXMULTI_OLD% Or ProbeDataFileVersionNumber! >= 12.84 Then
samplemultihi% = samplemultihi% + 1

' Write chan2 "shared" alternating hi off-peak intensity data (from LoPeak channels) to chan1 alternating on/off multi-point bgd tables
If sample(1).AlternatingOnAndOffPeakAcquisitionFlag Then
Call DataVolatileGetData(Int(2), samplerow%, j%, chan2%, tVolatile)
If ierror Then Exit Sub
For sampleorder% = 1 To tVolatile.VolatilePoints%
If sample(1).CombinedConditionsFlag Then    ' re-normalize chan2% cps to beam current of chan1%
tVolatile.VolatileIntensity!(sampleorder%) = tVolatile.VolatileIntensity!(sampleorder%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If
Call DataMultiPointOnOffSendData(Int(2), samplerow%, j%, chan1%, samplemultihi%, sampleorder%, tVolatile.VolatileIntensity!(sampleorder%), tVolatile.VolatileInterval!(sampleorder%), tVolatile.VolatileDateTime#(sampleorder%))
If ierror Then Exit Sub
Next sampleorder%
End If

' Now write low off-peak intensities to MPB arrays for chan2% (normalize to chan1% beam current if combined condition sample)
If Not sample(1).CombinedConditionsFlag Then
sample(1).MultiPointAcquireCountsHi!(j%, chan1%, samplemultihi%) = sample(1).LoPeakCounts!(j%, chan2%)
Else
sample(1).MultiPointAcquireCountsHi!(j%, chan1%, samplemultihi%) = sample(1).LoPeakCounts!(j%, chan2%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If

sample(1).MultiPointAcquireCountTimesHi!(j%, chan1%, samplemultihi%) = sample(1).LoCountTimes!(j%, chan2%)
sample(1).MultiPointAcquirePositionsHi!(chan1%, samplemultihi%) = sample(1).LoPeaks!(chan2%)
sample(1).MultiPointAcquireLastCountTimesHi!(chan1%, samplemultihi%) = sample(1).LastLoCountTimes!(chan2%)
End If
End If
End If

' Update high side MPB arrays for new data
If samplemultihi% > sample(1).MultiPointNumberofPointsAcquireHi%(chan1%) Then
sample(1).MultiPointNumberofPointsAcquireHi%(chan1%) = samplemultihi%
sample(1).MultiPointNumberofPointsIterateHi(chan1%) = samplemultihi%
sample(1).MultiPointBackgroundFitType(chan1%) = 2   ' assume exponential
End If

' Start checking for low side off-peaks (0=linear, 1=average, 2=high only, 3=low only, 4=exponential, 5=slope hi, 6=slope lo, 7=polynomial, 8=multi-point)
If sample(1).LoPeaks!(chan2%) < sample(1).OnPeaks!(chan1%) And sample(1).OffPeakCorrectionTypes%(chan2%) <> 2 Then      ' modified to exclude low off-peaks if high only off-peaks (Williams and Jercinovic, 12-10-2020)
If samplemultilo% + 1 <= MAXMULTI% Then
If samplemultilo% + 1 <= MAXMULTI_OLD% Or ProbeDataFileVersionNumber! >= 12.84 Then
samplemultilo% = samplemultilo% + 1

' Write chan2 "shared" alternating lo off-peak intensity data (from LoPeak channels) to chan1 alternating on/off multi-point bgd tables
If sample(1).AlternatingOnAndOffPeakAcquisitionFlag Then
Call DataVolatileGetData(Int(3), samplerow%, j%, chan2%, tVolatile)
If ierror Then Exit Sub
For sampleorder% = 1 To tVolatile.VolatilePoints%
If sample(1).CombinedConditionsFlag Then    ' re-normalize chan2% cps to beam current of chan1%
tVolatile.VolatileIntensity!(sampleorder%) = tVolatile.VolatileIntensity!(sampleorder%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If
Call DataMultiPointOnOffSendData(Int(3), samplerow%, j%, chan1%, samplemultilo%, sampleorder%, tVolatile.VolatileIntensity!(sampleorder%), tVolatile.VolatileInterval!(sampleorder%), tVolatile.VolatileDateTime#(sampleorder%))
If ierror Then Exit Sub
Next sampleorder%
End If

' Now write low off-peak intensities to MPB arrays for chan2% (normalize to chan1% beam current if combined condition sample)
If Not sample(1).CombinedConditionsFlag Then
sample(1).MultiPointAcquireCountsLo!(j%, chan1%, samplemultilo%) = sample(1).LoPeakCounts!(j%, chan2%)
Else
sample(1).MultiPointAcquireCountsLo!(j%, chan1%, samplemultilo%) = sample(1).LoPeakCounts!(j%, chan2%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If

sample(1).MultiPointAcquireCountTimesLo!(j%, chan1%, samplemultilo%) = sample(1).LoCountTimes!(j%, chan2%)
sample(1).MultiPointAcquirePositionsLo!(chan1%, samplemultilo%) = sample(1).LoPeaks!(chan2%)
sample(1).MultiPointAcquireLastCountTimesLo!(chan1%, samplemultilo%) = sample(1).LastLoCountTimes!(chan2%)
End If
End If
End If

' Start checking for high side off-peaks  (0=linear, 1=average, 2=high only, 3=low only, 4=exponential, 5=slope hi, 6=slope lo, 7=polynomial, 8=multi-point)
If sample(1).HiPeaks!(chan2%) < sample(1).OnPeaks!(chan1%) And sample(1).OffPeakCorrectionTypes%(chan2%) <> 3 Then       ' modified to exclude high off-peaks if low only off-peaks (Williams and Jercinovic, 12-10-2020)
If samplemultilo% + 1 <= MAXMULTI% Then
If samplemultilo% + 1 <= MAXMULTI_OLD% Or ProbeDataFileVersionNumber! >= 12.84 Then
samplemultilo% = samplemultilo% + 1

' Write chan2 "shared" alternating lo off-peak intensity data (from HiPeak channels) to chan1 alternating on/off multi-point bgd tables
If sample(1).AlternatingOnAndOffPeakAcquisitionFlag Then
Call DataVolatileGetData(Int(3), samplerow%, j%, chan2%, tVolatile)
If ierror Then Exit Sub
For sampleorder% = 1 To tVolatile.VolatilePoints%
If sample(1).CombinedConditionsFlag Then    ' re-normalize chan2% cps to beam current of chan1%
tVolatile.VolatileIntensity!(sampleorder%) = tVolatile.VolatileIntensity!(sampleorder%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If
Call DataMultiPointOnOffSendData(Int(3), samplerow%, j%, chan1%, samplemultilo%, sampleorder%, tVolatile.VolatileIntensity!(sampleorder%), tVolatile.VolatileInterval!(sampleorder%), tVolatile.VolatileDateTime#(sampleorder%))
If ierror Then Exit Sub
Next sampleorder%
End If

' Now write low off-peak intensities to MPB arrays for chan2% (normalize to chan1% beam current if combined condition sample)
If Not sample(1).CombinedConditionsFlag Then
sample(1).MultiPointAcquireCountsLo!(j%, chan1%, samplemultilo%) = sample(1).HiPeakCounts!(j%, chan2%)
Else
sample(1).MultiPointAcquireCountsLo!(j%, chan1%, samplemultilo%) = sample(1).HiPeakCounts!(j%, chan2%) * sample(1).OnBeamCountsArray!(j%, chan1%) / sample(1).OnBeamCountsArray!(j%, chan2%)
End If

sample(1).MultiPointAcquireCountTimesLo!(j%, chan1%, samplemultilo%) = sample(1).HiCountTimes!(j%, chan2%)
sample(1).MultiPointAcquirePositionsLo!(chan1%, samplemultilo%) = sample(1).HiPeaks!(chan2%)
sample(1).MultiPointAcquireLastCountTimesLo!(chan1%, samplemultilo%) = sample(1).LastHiCountTimes!(chan2%)
End If
End If
End If

' Update low side MPB arrays for new data
If samplemultilo% > sample(1).MultiPointNumberofPointsAcquireLo%(chan1%) Then
sample(1).MultiPointNumberofPointsAcquireLo%(chan1%) = samplemultilo%
sample(1).MultiPointNumberofPointsIterateLo(chan1%) = samplemultilo%
sample(1).MultiPointBackgroundFitType(chan1%) = 2   ' assume exponential
End If

End If  ' bias
End If  ' crystal
End If  ' spectrometer
End If  ' kilovolts

End If  ' off-peak acquisition
End If  ' disable quant
End If  ' disable acquisition
Next chan2%

' Check if less than two shared bgds were loaded
If sample(1).MultiPointNumberofPointsAcquireHi%(chan1%) + sample(1).MultiPointNumberofPointsAcquireLo%(chan1%) > 2 Then
sampleupdated = True
MPB_Flag(chan1%) = True             ' flag to set MPB background type below

' If two or fewer shared backgrounds were found, clear shared MPB data and re-set back to original off-peak type
Else
Call AnalyzeSharedBgdDeleteChannel(j%, chan1%, tOffPeakCorrectionTypes%(chan1%), sample())
If ierror Then Exit Sub
End If

End If  ' end of mode = 1 section

' If removing shared bgds, clear MPB data for shared backgrounds and re-set to original off-peak type
If mode% = 2 Then
Call AnalyzeSharedBgdDeleteChannel(j%, chan1%, tOffPeakCorrectionTypes%(chan1%), sample())
If ierror Then Exit Sub
End If

End If           ' off-peak acquisition channel and not EDS channel
Next chan1%

' Display status
If ProbeDataFileVersionNumber! > 8.45 Then
If mode% = 1 Then
If sampleupdated Then
Call IOWriteLog("Updating shared multi-point bgd sample arrays for " & sample(1).Name$ & ", line " & Format$(sample(1).Linenumber&(j%)) & "...")
DoEvents

Else
Call IOWriteLog("No shared multi-point bgd sample intensities found for " & sample(1).Name$ & ", line " & Format$(sample(1).Linenumber&(j%)) & "...")
DoEvents
End If
End If

If mode% = 2 Then
Call IOWriteLog("Clearing shared multi-point bgd sample arrays for " & sample(1).Name$ & ", line " & Format$(sample(1).Linenumber&(j%)) & "...")
DoEvents
End If
End If

Next j%

' Clear out all MPB records for this sample in the MDB file (this is slightly dangerous, but actual MPB acquisitions will get written back properly by DataReplaceAddSample)
Call DataMultiPointDeleteSample(samplerow%)
If ierror Then Exit Sub

' If mode% = 1 specify MPB off-peak correction for new MPB shared channels
If mode% = 1 Then
For chan1% = 1 To sample(1).LastElm%
If MPB_Flag(chan1%) Then sample(1).OffPeakCorrectionTypes%(chan1%) = MAXOFFBGDTYPES%
Next chan1%
End If

' Save sample with searched/removed shared MPB data and parameters
Call DataReplaceAddSample(Int(2), samplerow%, sample())
If ierror Then Exit Sub

End If  ' sampletyps and sampledels
End If  ' selected samples
Next i%

Call IOStatusAuto(vbNullString)
Call AnalyzeStatusAnal(vbNullString)
DoEvents

' Confirm with user
msg$ = Format$(nsams%) & " shared multi-point background (MPB) array samples were updated or cleared"
MsgBox msg$, vbOKOnly + vbInformation, "AnalyzeSharedBgdSearchOrRemove"

Exit Sub

' Errors
AnalyzeSharedBgdSearchOrRemoveError:
Screen.MousePointer = vbDefault
MsgBox Error$, vbOKOnly + vbCritical, "AnalyzeSharedBgdSearchOrRemove"
ierror = True
Exit Sub

End Sub

Of course another approach that wouldn't have required any code changes at all, would be to have some off-peak background positions be the same for two elements, and then simply count half as long on those "doubled up" background positions. I think the statistics would be equivalent...