Author Topic: Halogen correction  (Read 788 times)

BenjaminWade

  • Professor
  • ****
  • Posts: 195
Halogen correction
« on: September 30, 2019, 05:06:14 pm »
Hi John
I am not sure if its due to me doing something wrong, but I am finding something strange going on with the halogen correction at the moment, and I don't think I have seen it happen in the past so not sure what has changed or what I might be doing wrong now.

I am analysing apatite which I have done many times in the past, and typically I analyse a bunch of apatites as "standards" as well for QC checks. What I am finding is when I process these secondary standards it is subtracting double the amount of oxygen it should with the halogen correction enabled (ie ~3.2 oxygens). When I analyse the same apatites as "unknowns" and process them as "unknowns" it subtracts the correct amount of oxygen (ie ~1.6 oxygens). Its like there is a double flag subtracting when they are analysed as standards. This is with "calculate stoichiometric oxygen" and "display as oxides" ticked in calculation options.

As "Standard":

St  707 Set   1 Apatite, Results in Oxide Weight Percents

SPEC:        O     CO2
TYPE:     CALC    SPEC

AVER:   -3.212    .410
SDEV:     .035    .000

ELEM:      CaO     MgO    TiO2    SiO2   Al2O3     FeO     MnO      Cl       F   La2O3   Ce2O3   Nd2O3    P2O5    Na2O     SO3     SrO    Y2O3   SUM 
    45 53.3862  .04260  .00000  .46065  .00042  .00000  .00696  .36325 3.64139  .51881  .70278  .17773 41.0875  .16914  .25996  .04540  .11289 98.1913
    46 53.7970  .03712  .00000  .46968  .01290  .05835  .00016  .37404 3.75368  .47391  .67576  .13349 41.4981  .18669  .19775  .05872  .06839 98.9616
    47 53.2852  .04685  .00000  .46397  .00000  .05181  .00358  .33982 3.75822  .45751  .64484  .21806 41.6324  .18523  .12736  .05559  .09889 98.5411
    48 52.5823  .05287  .00000  .47128  .00318  .03399  .00110  .37115 3.58467  .50989  .64063  .15948 41.3289  .20837  .15113  .06991  .11026 97.5169

AVER:  53.2627  .04486  .00000  .46639  .00412  .03604  .00295  .36206 3.68449  .49003  .66600  .17219 41.3868  .18736  .18405  .05741  .09761 98.3027
SDEV:   .50468  .00666  .00000  .00495  .00602  .02614  .00304  .01552  .08572  .02910  .02909  .03556  .23497  .01610  .05844  .01009  .02040  .61124
SERR:   .25234  .00333  .00000  .00248  .00301  .01307  .00152  .00776  .04286  .01455  .01455  .01778  .11749  .00805  .02922  .00505  .01020



As "unknown":

Un    3 Durango2, Results in Oxide Weight Percents

SPEC:        O
TYPE:     CALC

AVER:  -1.504
SDEV:     .034

ELEM:      CaO     MgO    TiO2    SiO2   Al2O3     FeO     MnO      Cl       F   La2O3   Ce2O3   Nd2O3    P2O5    Na2O     SO3     SrO    Y2O3   SUM 
   107 54.2091  .04725  .00000  .41866  .00020  .01547  .00000  .36244 3.32484  .44270  .61604  .24827 41.4422  .17199  .21913  .03436  .11979 100.191
   108 53.2595  .04786  .00000  .41589  .01463  .04665  .01813  .36427 3.36025  .45606  .57950  .21030 41.5254  .17116  .25589  .05795  .10014 99.3864
   109 53.3979  .05882  .00000  .44552  .01022  .00891  .00090  .39483 3.50690  .46835  .61204  .25679 41.6277  .19061  .21152  .06647  .07528 99.7669
   110 53.0930  .04944  .00000  .45288  .00395  .04572  .01845  .32910 3.26784  .45868  .65655  .26986 41.8062  .19884  .23781  .09074  .09983 99.6286
   111 53.6377  .04895  .00506  .43000  .00708  .00000  .01192  .38136 3.35012  .40432  .61868  .14233 41.9211  .18779  .29513  .07202  .09161 100.108
   112 53.4209  .05359  .00000  .45582  .00696  .04606  .00000  .35811 3.41653  .46710  .66029  .19115 41.2252  .29098  .38589  .07846  .11351 99.6510
   113 53.8312  .05010  .00000  .47780  .00915  .00000  .00000  .40240 3.44283  .56007  .63156  .14622 41.3396  .29092  .42716  .05239  .11348 100.234
   114 53.1826  .05850  .00000  .35239  .01289  .00000  .00401  .35314 3.35610  .35307  .50914  .18175 41.8094  .20547  .17516  .04905  .09443 99.2042
   115 52.7779  .05023  .00000  .34551  .00918  .04377  .00528  .41335 3.27134  .40721  .61721  .20419 41.8926  .31852  .36512  .05145  .07190 99.3740
   116 53.9716  .05552  .00000  .34099  .00507  .02027  .00819  .41868 3.40459  .43163  .59893  .19126 41.5325  .23218  .33564  .07035  .10209 100.191

AVER:  53.4781  .05203  .00051  .41354  .00793  .02269  .00669  .37777 3.37013  .44492  .60999  .20421 41.6122  .22585  .29085  .06232  .09821 99.7736
SDEV:   .43606  .00430  .00160  .04991  .00426  .02078  .00727  .02912  .07476  .05406  .04289  .04357  .23982  .05460  .08433  .01646  .01574  .38624
SERR:   .13789  .00136  .00051  .01578  .00135  .00657  .00230  .00921  .02364  .01710  .01356  .01378  .07584  .01727  .02667  .00520  .00498


Any idea what I am doing wrong...?

Cheers

« Last Edit: September 30, 2019, 05:28:22 pm by John Donovan »

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2631
  • Other duties as assigned...
    • Probe Software
Re: Halogen correction
« Reply #1 on: October 01, 2019, 08:35:15 am »
Hi John
I am not sure if its due to me doing something wrong, but I am finding something strange going on with the halogen correction at the moment, and I don't think I have seen it happen in the past so not sure what has changed or what I might be doing wrong now.

Hi Ben,
Interesting. Can you email me the MDB file?
john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

BenjaminWade

  • Professor
  • ****
  • Posts: 195
Re: Halogen correction
« Reply #2 on: October 03, 2019, 07:03:27 pm »
Ok just for the benefit of anyone who might encounter the same problem, it was entirely my own stupid fault.
My apatite "standards" in my Standard.MDB file already had their excess oxygen subtracted, thus when I turned on the halogen correction in a normal run my apatite standards had a double subtraction.

In the image below, on the left is without the excess oxygen corrected in my Standard.MDB file which gives me the correct halogen subtraction if I turn the halogen correction on in a run. Below right is obviously with the excess oxygen correction, resulting in a double subtraction in a run.


John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2631
  • Other duties as assigned...
    • Probe Software
Re: Halogen correction
« Reply #3 on: October 03, 2019, 09:07:15 pm »
Ok just for the benefit of anyone who might encounter the same problem, it was entirely my own stupid fault.
My apatite "standards" in my Standard.MDB file already had their excess oxygen subtracted, thus when I turned on the halogen correction in a normal run my apatite standards had a double subtraction.

In the image below, on the left is without the excess oxygen corrected in my Standard.MDB file which gives me the correct halogen subtraction if I turn the halogen correction on in a run. Below right is obviously with the excess oxygen correction, resulting in a double subtraction in a run.



Hi Ben,
You absolutely are correct in your conclusions.

Many years ago when we started CalcZAF and Probe for EPMA, we decided that it was very important, for geologists at least, to account for chemical substitution of stoichiometric oxygen by elements such as halogens (and additional oxygen from say, ferric iron).

So in the standard compositional database (Standard.exe) one can enter a standard composition with all the elements in ideal stoichchiometric proportions, but we can also enter the excess *or* deficit oxygen in those situations where ideal stoichiometric assumptions are not valid, due to the presence of, for example, ferric iron or halogens.

So yes, when you've already accounted for the excess or deficit oxygen in the standard composition database, applying the halogen correction in Probe for EPMA, results in a double correction of the oxygen-halogen equivalence.

Therefore, if one is utilizing an already halogen corrected composition for a standard, in Standard, there is no need to also apply a halogen correction in Probe for EPMA. Probe for EPMA automatically notes the excess or deficit oxygen (whether it be a magnetite or a fluor-phlogopite), and compensates for the difference in the matrix effects.

However, if one specifies a standard composition in the Standard compositional database where the excess or deficit oxygen is *not* documented, then, yes, one must apply the correction for this situation in Probe for EPMA when this standard is measured as a standard (or as an unknown), whether that situation be excess oxygen from ferric iron:

https://probesoftware.com/smf/index.php?topic=92.msg8593#msg8593

or for the replacement of oxygen by halogens:

https://probesoftware.com/smf/index.php?topic=92.msg8557#msg8557

Of course for samples measured as unknown samples, these excess or deficit oxygen corrections must always be applied because the program knows nothing (a priori) regarding the sample.

There is one exception I must take to your post however. Your characterization of this question as being "stupid" is simply incorrect. There is nothing obvious about the way in which the ferric or halogen corrections are applied in Probe for EPMA because one would need to carefully parse the physics code on Github (see the ZAFSmp procedure in ZAF.bas) to comprehend exactly how these corrections are applied:

https://github.com/openmicroanalysis/calczaf

Though please note that these procedures (regardless of the naming convention) are entirely agnostic as to exactly exactly what matrix correction models are being applied, i.e., ZAF vs. phi-rho-z!

The bottom line is: thank-you for noting this quite subtle and yet interesting aspect to the matrix correction models. To be entirely honest, when we first noticed these effects, we weren't too surprised when we noticed that including the deficit oxygen correction in apatites and phlogopites made a significant difference in the results, but we were completely surprised by the effect that excess oxygen from ferric iron had, on not only the iron concentrations, but also on the other elements.

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

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 2079
  • Never sleeps...
    • John Donovan
Re: Halogen correction
« Reply #4 on: October 11, 2019, 12:05:40 pm »
To emphasize what Ben Wade found in his investigations, here are examples of a fluor-phlogopite entered as both a "normal" standard composition where the stoichiometric oxygen is assumed to be in nominal proportions to the cations, and also where the fluor-phlogopite is entered with the "deficit" oxygen entered. 

So first the fluor-phlogopite entered with the assumption of default oxygen stoichiometry:

St  282 Fluor-phlogopite (synthetic)
TakeOff = 40.0  KiloVolt = 15.0  Density =  2.879  Type = phylosilicate

Grown by S. Wones, Univ of Tenn
Oxide and Elemental Composition

Average Total Oxygen:       41.775     Average Total Weight%:  103.789
Average Calculated Oxygen:  41.778     Average Atomic Number:   11.202
Average Excess Oxygen:       -.003     Average Atomic Weight:   20.822
Oxygen Equiv. from Halogen:  3.798

ELEM:     SiO2     MgO   Al2O3     K2O       F       O
XRAY:      ka      ka      ka      ka      ka      ka
OXWT:   42.791  28.700  12.100  11.180   9.020   -.003
ELWT:   20.002  17.307   6.404   9.281   9.020  41.775
KFAC:    .1502   .1224   .0432   .0818   .0249   .1837
ZCOR:   1.3317  1.4138  1.4820  1.1342  3.6217  2.2746
AT% :   14.287  14.285   4.761   4.762   9.525  52.379
24 O:    6.546   6.545   2.182   2.182   4.364  24.000

Note that it totals over 100% because in reality some of the fluorine replaces some of the stoichiometric oxygen.  So what happens when we analyze this as a standard in PFE:

St  282 Set   1 Fluor-phlogopite (synthetic)
TakeOff = 40.0  KiloVolt = 15.0  Beam Current = 30.0  Beam Size =    0
(Magnification (analytical) =  20000),        Beam Mode = Analog  Spot
(Magnification (default) =      600, Magnification (imaging) =    200)
Image Shift (X,Y):                                         .00,    .00

Grown by S. Wones, Univ of Tenn

Formula Based on Sum of Cations = .000   Oxygen Calc. by Stoichiometry
Number of Data Lines:   3             Number of 'Good' Data Lines:   3
First/Last Date-Time: 03/08/2016 01:07:36 PM to 03/08/2016 01:08:57 PM

Average Total Oxygen:       42.236     Average Total Weight%:  105.056
Average Calculated Oxygen:  42.239     Average Atomic Number:   11.196
Average Excess Oxygen:       -.003     Average Atomic Weight:   20.818
Oxygen Equiv. from Halogen:  3.827  Halogen Corrected Oxygen:   38.409
Average ZAF Iteration:        4.00     Average Quant Iterate:     2.00

Oxygen Calculated by Cation Stoichiometry and Included in the Matrix Correction
Oxygen Equivalent from Halogens (F/Cl/Br/I), Not Subtracted in the Matrix Correction

St  282 Set   1 Fluor-phlogopite (synthetic), Results in Elemental Weight Percents
 
ELEM:        F      Mg      Si      Al       K       O
TYPE:     ANAL    ANAL    ANAL    ANAL    ANAL    CALC
BGDS:      LIN     LIN     LIN     LIN     LIN
TIME:    20.00   20.00   20.00   20.00   20.00     ---
BEAM:    29.99   29.99   29.99   29.99   29.99     ---

ELEM:        F      Mg      Si      Al       K       O   SUM 
    16   9.109  17.911  19.906   6.399   9.278  42.058 104.661
    17   9.096  18.065  19.874   6.577   9.333  42.293 105.239
    18   9.056  17.895  20.097   6.476   9.389  42.356 105.270

AVER:    9.087  17.957  19.959   6.484   9.333  42.236 105.056
SDEV:     .028    .094    .121    .090    .056    .157    .343
SERR:     .016    .054    .070    .052    .032    .091
%RSD:      .30     .52     .60    1.38     .60     .37

PUBL:    9.020  17.307  20.002   6.404   9.281  41.775 103.789
%VAR:      .74    3.75    -.21    1.25     .56    1.10
DIFF:     .067    .650   -.043    .080    .052    .461
STDS:      831     284     374     374     374     ---

STKF:    .1545   .1235   .2480   .0703   .1132     ---
STCT:    51.52   39.60   82.71   23.26   37.65     ---

UNKF:    .0251   .1271   .1495   .0436   .0823     ---
UNCT:     8.38   40.77   49.86   14.43   27.37     ---
UNBG:      .18     .70     .95     .53     .75     ---

ZCOR:   3.6155  1.4126  1.3350  1.4873  1.1342     ---
KRAW:    .1627  1.0294   .6028   .6205   .7271     ---
PKBG:    46.46   59.87   53.96   28.34   37.44     ---

We see the total is actually even higher than the assumption of stoichiometry, mostly because the matrix correction for Mg incorrectly calculates the effect due to the extra oxygen. Calculating the same as oxides we get:

St  282 Set   1 Fluor-phlogopite (synthetic), Results in Oxide Weight Percents

ELEM:        F     MgO    SiO2   Al2O3     K2O       O   SUM 
    16   9.109  29.702  42.586  12.090  11.176   -.003 104.661
    17   9.096  29.957  42.518  12.428  11.242   -.003 105.239
    18   9.056  29.675  42.995  12.236  11.310   -.003 105.270

AVER:    9.087  29.778  42.700  12.252  11.243   -.003 105.056
SDEV:     .028    .156    .258    .169    .067    .000    .343
SERR:     .016    .090    .149    .098    .039    .000
%RSD:      .30     .52     .60    1.38     .60    -.14

PUBL:    9.020  28.700  42.791  12.100  11.180   -.003 103.789
%VAR:      .74    3.75    -.21    1.25     .56    -.14
DIFF:     .067   1.078   -.092    .151    .063    .000
STDS:      831     284     374     374     374     ---

Note that the excess/deficit oxygen is close to zero, but not a good analysis.  So now, let's turn on the halogen correction in PFE from the Analytical | Analysis Options dialog as seen here:



and analyze this standard again in PFE:

St  282 Set   1 Fluor-phlogopite (synthetic)
TakeOff = 40.0  KiloVolt = 15.0  Beam Current = 30.0  Beam Size =    0
(Magnification (analytical) =  20000),        Beam Mode = Analog  Spot
(Magnification (default) =      600, Magnification (imaging) =    200)
Image Shift (X,Y):                                         .00,    .00

Grown by S. Wones, Univ of Tenn

Formula Based on Sum of Cations = .000   Oxygen Calc. by Stoichiometry
Number of Data Lines:   3             Number of 'Good' Data Lines:   3
First/Last Date-Time: 03/08/2016 01:07:36 PM to 03/08/2016 01:08:57 PM

Average Total Oxygen:       38.412     Average Total Weight%:  100.872
Average Calculated Oxygen:  38.415     Average Atomic Number:   11.321
Average Excess Oxygen:       -.003     Average Atomic Weight:   21.059
Oxygen Equiv. from Halogen:  3.735  Halogen Corrected Oxygen:   38.412
Average ZAF Iteration:        4.00     Average Quant Iterate:     2.00

Oxygen Calculated by Cation Stoichiometry and Included in the Matrix Correction
Oxygen Equivalent from Halogens (F/Cl/Br/I), Subtracted in the Matrix Correction

St  282 Set   1 Fluor-phlogopite (synthetic), Results in Elemental Weight Percents
 
ELEM:        F      Mg      Si      Al       K       O
TYPE:     ANAL    ANAL    ANAL    ANAL    ANAL    CALC
BGDS:      LIN     LIN     LIN     LIN     LIN
TIME:    20.00   20.00   20.00   20.00   20.00     ---
BEAM:    29.99   29.99   29.99   29.99   29.99     ---

ELEM:        F      Mg      Si      Al       K       O   SUM 
    16   8.890  17.751  19.926   6.392   9.282  38.226 100.465
    17   8.879  17.904  19.895   6.570   9.337  38.465 101.049
    18   8.841  17.736  20.116   6.468   9.393  38.545 101.101

AVER:    8.870  17.797  19.979   6.477   9.337  38.412 100.872
SDEV:     .025    .093    .120    .090    .056    .166    .353
SERR:     .015    .054    .069    .052    .032    .096
%RSD:      .29     .52     .60    1.38     .60     .43

PUBL:    9.020  17.307  20.002   6.404   9.281  41.775 103.789
%VAR:    -1.66    2.83    -.12    1.13     .61   -8.05
DIFF:    -.150    .490   -.023    .073    .056  -3.363
STDS:      831     284     374     374     374     ---

STKF:    .1545   .1235   .2480   .0703   .1132     ---
STCT:    51.52   39.60   82.71   23.26   37.65     ---

UNKF:    .0251   .1271   .1495   .0436   .0823     ---
UNCT:     8.38   40.77   49.86   14.43   27.37     ---
UNBG:      .18     .70     .95     .53     .75     ---

ZCOR:   3.5293  1.4000  1.3363  1.4856  1.1347     ---
KRAW:    .1627  1.0294   .6028   .6205   .7271     ---
PKBG:    46.46   59.87   53.96   28.34   37.44     ---

Much better. And here again as oxide concentrations:

St  282 Set   1 Fluor-phlogopite (synthetic), Results in Oxide Weight Percents

ELEM:        F     MgO    SiO2   Al2O3     K2O       O   SUM 
    16   8.890  29.436  42.629  12.077  11.181  -3.746 100.465
    17   8.879  29.689  42.561  12.414  11.247  -3.742 101.049
    18   8.841  29.412  43.036  12.222  11.315  -3.726 101.101

AVER:    8.870  29.512  42.742  12.238  11.248  -3.738 100.872
SDEV:     .025    .154    .257    .169    .067    .011    .353
SERR:     .015    .089    .148    .098    .039    .006
%RSD:      .29     .52     .60    1.38     .60    -.29

PUBL:    9.020  28.700  42.791  12.100  11.180   -.003 103.789
%VAR:    -1.66    2.83    -.12    1.13     .61137523.80
DIFF:    -.150    .812   -.049    .137    .068  -3.735
STDS:      831     284     374     374     374     ---

The reason we are still slightly high with our total is because the std k-factor from the standard database is slightly wrong due to the excess oxygen assumed in the standard database! 

In the next post we'll look at how this should be handled properly...
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 2079
  • Never sleeps...
    • John Donovan
Re: Halogen correction
« Reply #5 on: October 11, 2019, 12:24:32 pm »
So in the previous post we saw how we should *not* be handling the oxygen halogen equivalence in our standard database compositions.  In my own standard database I have the same fluor-phlogopite standard as seen in the previous post, but this time entered (with a different standard number of course), with the missing oxygen specified, as seen here:

St  284 Fluor-phlogopite (halogen corrected)
TakeOff = 40.0  KiloVolt = 15.0  Density =  2.879  Type = phylosilicate

Grown by S. Wones, Univ of Tenn
(applied F=O equivalence)
Oxide and Elemental Composition

Average Total Oxygen:       37.980     Average Total Weight%:   99.994
Average Calculated Oxygen:  41.778     Average Atomic Number:   11.324
Average Excess Oxygen:      -3.798     Average Atomic Weight:   21.063
Oxygen Equiv. from Halogen:  3.798

ELEM:     SiO2     MgO   Al2O3     K2O       F       O
XRAY:      ka      ka      ka      ka      ka      ka
OXWT:   42.791  28.700  12.100  11.180   9.020  -3.798
ELWT:   20.002  17.307   6.404   9.281   9.020  37.980
KFAC:    .1500   .1235   .0432   .0818   .0256   .1630
ZCOR:   1.3338  1.4016  1.4818  1.1346  3.5255  2.3298
AT% :   15.001  14.999   4.999   5.000  10.001  50.000
24 O:    7.200   7.200   2.400   2.400   4.800  24.000

Note that our total is correct because we entered -3.798 oxygen in the standard database as seen here:



Now let's leave the halogen correction in Probe for EPMA turned on, as Ben did originally and see what we get:

St  284 Set   1 Fluor-phlogopite (halogen corrected)
TakeOff = 40.0  KiloVolt = 15.0  Beam Current = 30.0  Beam Size =    0
(Magnification (analytical) =  20000),        Beam Mode = Analog  Spot
(Magnification (default) =      600, Magnification (imaging) =    200)
Image Shift (X,Y):                                         .00,    .00

Grown by S. Wones, Univ of Tenn
(applied F=O equivalence)

Formula Based on Sum of Cations = .000   Oxygen Calc. by Stoichiometry
Number of Data Lines:   3             Number of 'Good' Data Lines:   3
First/Last Date-Time: 03/08/2016 12:46:56 PM to 03/08/2016 12:48:17 PM

Average Total Oxygen:       34.141     Average Total Weight%:   95.774
Average Calculated Oxygen:  37.939     Average Atomic Number:   11.464
Average Excess Oxygen:      -3.798     Average Atomic Weight:   21.336
Oxygen Equiv. from Halogen:  3.702  Halogen Corrected Oxygen:   34.141
Average ZAF Iteration:        4.00     Average Quant Iterate:     2.00

Oxygen Calculated by Cation Stoichiometry and Included in the Matrix Correction
Oxygen Equivalent from Halogens (F/Cl/Br/I), Subtracted in the Matrix Correction

St  284 Set   1 Fluor-phlogopite (halogen corrected), Results in Elemental Weight Percents
 
ELEM:        F      Mg      Si      Al       K       O
TYPE:     ANAL    ANAL    ANAL    ANAL    ANAL    CALC
BGDS:      LIN     LIN     LIN     LIN     LIN
TIME:    20.00   20.00   20.00   20.00   20.00     ---
BEAM:    29.99   29.99   29.99   29.99   29.99     ---

ELEM:        F      Mg      Si      Al       K       O   SUM 
     7   8.832  17.174  19.891   6.361   9.282  34.009  95.549
     8   8.813  17.127  19.932   6.382   9.412  34.078  95.743
     9   8.729  17.137  20.047   6.512   9.269  34.337  96.030

AVER:    8.791  17.146  19.957   6.418   9.321  34.141  95.774
SDEV:     .055    .025    .081    .082    .079    .173    .242
SERR:     .032    .014    .047    .047    .046    .100
%RSD:      .62     .14     .40    1.27     .85     .51

PUBL:    9.020  17.307  20.002   6.404   9.281  37.980  99.994
%VAR:    -2.54  (-.93)    -.23     .22     .43  -10.11
DIFF:    -.229  (-.16)   -.045    .014    .040  -3.839
STDS:      831     284     374     374     374     ---

STKF:    .1545   .1235   .2480   .0703   .1132     ---
STCT:    51.52   41.12   82.71   23.26   37.65     ---

UNKF:    .0256   .1235   .1494   .0434   .0821     ---
UNCT:     8.54   41.14   49.84   14.36   27.32     ---
UNBG:      .21     .66     .92     .52     .77     ---

ZCOR:   3.4329  1.3880  1.3354  1.4798  1.1350     ---
KRAW:    .1658  1.0004   .6025   .6173   .7256     ---
PKBG:    41.65   63.50   55.28   28.88   36.40     ---

As Ben Wade saw, we're now getting a *double* correction for the halogen effect. Once because the missing oxygen is already accounted for in the standard database and again because we turned on the halogen correction in Probe for EPMA.  And here is the same standard analyzed in PFE as oxide concentrations (and still wrong!):

St  284 Set   1 Fluor-phlogopite (halogen corrected), Results in Oxide Weight Percents

ELEM:        F     MgO    SiO2   Al2O3     K2O       O   SUM 
     7   8.832  28.480  42.554  12.019  11.181  -7.517  95.549
     8   8.813  28.402  42.642  12.058  11.338  -7.509  95.743
     9   8.729  28.418  42.887  12.304  11.166  -7.473  96.030

AVER:    8.791  28.433  42.694  12.127  11.228  -7.500  95.774
SDEV:     .055    .041    .173    .154    .095    .023    .242
SERR:     .032    .024    .100    .089    .055    .013
%RSD:      .62     .14     .40    1.27     .85    -.31

PUBL:    9.020  28.700  42.791  12.100  11.180  -3.798  99.994
%VAR:    -2.54  (-.93)    -.23     .22     .43   97.48
DIFF:    -.229  (-.27)   -.097    .027    .048  -3.702
STDS:      831     284     374     374     374     ---

What we should really be doing is specifying the deficit oxygen in the standard database composition, and simply *not* utilize the halogen correction in PFE as seen here:

St  284 Set   1 Fluor-phlogopite (halogen corrected)
TakeOff = 40.0  KiloVolt = 15.0  Beam Current = 30.0  Beam Size =    0
(Magnification (analytical) =  20000),        Beam Mode = Analog  Spot
(Magnification (default) =      600, Magnification (imaging) =    200)
Image Shift (X,Y):                                         .00,    .00

Grown by S. Wones, Univ of Tenn
(applied F=O equivalence)

Formula Based on Sum of Cations = .000   Oxygen Calc. by Stoichiometry
Number of Data Lines:   3             Number of 'Good' Data Lines:   3
First/Last Date-Time: 03/08/2016 12:46:56 PM to 03/08/2016 12:48:17 PM

Average Total Oxygen:       37.939     Average Total Weight%:   99.963
Average Calculated Oxygen:  41.737     Average Atomic Number:   11.327
Average Excess Oxygen:      -3.798     Average Atomic Weight:   21.066
Oxygen Equiv. from Halogen:  3.801  Halogen Corrected Oxygen:   34.138
Average ZAF Iteration:        4.00     Average Quant Iterate:     2.00

Oxygen Calculated by Cation Stoichiometry and Included in the Matrix Correction
Oxygen Equivalent from Halogens (F/Cl/Br/I), Not Subtracted in the Matrix Correction

St  284 Set   1 Fluor-phlogopite (halogen corrected), Results in Elemental Weight Percents
 
ELEM:        F      Mg      Si      Al       K       O
TYPE:     ANAL    ANAL    ANAL    ANAL    ANAL    CALC
BGDS:      LIN     LIN     LIN     LIN     LIN
TIME:    20.00   20.00   20.00   20.00   20.00     ---
BEAM:    29.99   29.99   29.99   29.99   29.99     ---

ELEM:        F      Mg      Si      Al       K       O   SUM 
     7   9.071  17.344  19.872   6.370   9.277  37.825  99.759
     8   9.050  17.296  19.913   6.391   9.408  37.885  99.943
     9   8.961  17.304  20.028   6.521   9.265  38.108 100.186

AVER:    9.027  17.315  19.937   6.427   9.317  37.939  99.963
SDEV:     .059    .026    .081    .082    .079    .149    .214
SERR:     .034    .015    .047    .047    .046    .086
%RSD:      .65     .15     .41    1.27     .85     .39

PUBL:    9.020  17.307  20.002   6.404   9.281  37.980  99.994
%VAR:      .08   (.04)    -.32     .36     .39    -.11
DIFF:     .007   (.01)   -.065    .023    .036   -.041
STDS:      831     284     374     374     374     ---

STKF:    .1545   .1235   .2480   .0703   .1132     ---
STCT:    51.52   41.12   82.71   23.26   37.65     ---

UNKF:    .0256   .1235   .1494   .0434   .0821     ---
UNCT:     8.54   41.14   49.84   14.36   27.32     ---
UNBG:      .21     .66     .92     .52     .77     ---

ZCOR:   3.5251  1.4016  1.3341  1.4819  1.1345     ---
KRAW:    .1658  1.0004   .6025   .6173   .7256     ---
PKBG:    41.65   63.50   55.28   28.88   36.40     ---

Now that's better!  And again here as oxides:

St  284 Set   1 Fluor-phlogopite (halogen corrected), Results in Oxide Weight Percents

ELEM:        F     MgO    SiO2   Al2O3     K2O       O   SUM 
     7   9.071  28.762  42.513  12.036  11.176  -3.798  99.759
     8   9.050  28.682  42.601  12.075  11.332  -3.798  99.943
     9   8.961  28.694  42.846  12.321  11.161  -3.798 100.186

AVER:    9.027  28.713  42.653  12.144  11.223  -3.798  99.963
SDEV:     .059    .043    .173    .155    .095    .000    .214
SERR:     .034    .025    .100    .089    .055    .000
%RSD:      .65     .15     .41    1.27     .85     .00

PUBL:    9.020  28.700  42.791  12.100  11.180  -3.798  99.994
%VAR:      .08   (.04)    -.32     .36     .39     .00
DIFF:     .007   (.01)   -.138    .044    .043    .000
STDS:      831     284     374     374     374     ---

Voila!

OK, I probably didn't explain this well, so if anyone has any questions at all please ask away! 

I'll sum up by saying that these considerations also apply to any other mineral compositions that contain halogens and those halogens replace some of the assumed stoichiometric oxygen, e.g., chlor-apatites as Ben Wade showed. Of course if you want to measure oxygen on all your minerals, that would work too, but that's another discussion!

So in summary:

1. Enter your standard compositions with any deficit (or excess oxygen) accounted for in the standard database.

2. Do not apply the halogen correction to standards when the halogen replacement of oxygen has already occurred in the standard database (this is actually Donovan's fault because he really should not have made the halogen correction a global parameter, but he's a lazy slacker, so what did you expect?).   ;)

3. Do apply the halogen correction to your unknown chlor-apatites and fluor-phlogopites!  Then you will automatically compensate for the replacement of stoichiometric oxygen by halogens, and this effect will be included in the matrix correction properly.
« Last Edit: October 11, 2019, 03:47:02 pm by Probeman »
The only stupid question is the one not asked!

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2631
  • Other duties as assigned...
    • Probe Software
Re: Halogen correction
« Reply #6 on: June 17, 2020, 11:04:40 am »
Because there are multiple ways to do these oxygen-halogen corrections, it should be pointed out that one can use the oxygen-halogen correction on standard samples (when the oxygen-halogen correction is already accounted for in the standard composition), but then you want to be sure to use the actual oxygen value from the standard database as seen here (by not calculating oxygen by stoichiometry in PFE):

St  284 Set   4 Fluor-phlogopite (halogen corrected), Results in Elemental Weight Percents
 
ELEM:       Si       F      Cl      Mg      Ca       P      Al       K       O
TYPE:     ANAL    ANAL    ANAL    ANAL    ANAL    ANAL    ANAL    ANAL    SPEC
BGDS:      LIN     LIN     LIN     LIN     LIN     EXP     LIN     LIN
TIME:    20.00   20.00   20.00   30.00   30.00   20.00   20.00   20.00     ---
BEAM:    30.18   30.18   30.18   30.18   30.18   30.18   30.18   30.18     ---

ELEM:       Si       F      Cl      Mg      Ca       P      Al       K       O   SUM 
   500  19.746   9.086    .006  17.146    .006    .001   6.611   9.431  37.980 100.014
   501  20.414   8.670    .002  16.990    .011   -.007   6.598   9.339  37.980  99.998
   502  20.307   9.530    .004  17.256    .001    .003   6.602   9.414  37.980 101.096
   503  19.871   8.945    .005  17.271    .005   -.004   6.609   9.387  37.980 100.068
   504  21.925   9.162    .015  15.628    .022    .002   6.227   8.441  37.980  99.400
   505  21.238   8.648    .002  16.261    .004    .002   6.174   9.078  37.980  99.388

AVER:   20.584   9.007    .006  16.758    .008    .000   6.470   9.181  37.980  99.994
SDEV:     .842    .332    .005    .669    .007    .004    .210    .385    .000    .623
SERR:     .344    .135    .002    .273    .003    .002    .086    .157    .000
%RSD:     4.09    3.68   84.10    3.99   92.35-1540.98    3.24    4.20     .00

PUBL:   20.002   9.020    n.a.  17.307    n.a.    n.a.   6.404   9.281  37.980  99.994
%VAR:     2.91  (-.15)     ---   -3.17     ---     ---    1.03   -1.07     .00
DIFF:     .582  (-.01)     ---   -.549     ---     ---    .066   -.100    .000
STDS:      160     284     285      12     285     285     160     374     ---

STKF:    .1621   .0256   .0602   .4736   .3596   .1601   .0335   .1132     ---
STCT:   1749.1    71.9  2270.1 18778.0  8626.5  3449.1  5319.3  1650.6     ---

UNKF:    .1549   .0255   .0000   .1196   .0001   .0000   .0439   .0809     ---
UNCT:   1671.0    71.8     1.8  4741.7     1.7      .0  6979.3  1179.7     ---
UNBG:      4.2     3.7    10.4    20.6    17.8     3.5    81.9     9.0     ---

ZCOR:   1.3295  3.5271  1.2181  1.4013  1.1187  1.4130  1.4733  1.1351     ---
KRAW:    .9553   .9982   .0008   .2525   .0002   .0000  1.3121   .7147     ---
PKBG:   399.72   20.80    1.18  231.91    1.10    1.00   86.24  133.02     ---
INT%:     ----     .00    ----    ----    ----    ----    ----    ----     ---

TDI%:     .249   -.837  -5.332    .678    .245    .000    .000    .000     ---
DEV%:       .2     1.8     6.2      .1     3.7      .0      .0      .0     ---
TDIF:  LOG-LIN LOG-LIN LOG-LIN LOG-LIN LOG-LIN    ----    ----    ----     ---
TDIT:    44.00   41.00   41.33   52.67   56.33     .00     .00     .00     ---
TDII:    1674.    75.1    11.2   4759.    19.4    ----    ----    ----     ---
TDIL:     7.42    4.32    2.41    8.47    2.96    ----    ----    ----     ---

St  284 Set   4 Fluor-phlogopite (halogen corrected), Results in Oxide Weight Percents

ELEM:     SiO2       F      Cl     MgO     CaO    P2O5   Al2O3     K2O       O   SUM 
   500  42.245   9.086    .006  28.433    .008    .003  12.492  11.360  -3.619 100.014
   501  43.672   8.670    .002  28.174    .016   -.015  12.467  11.250  -4.239  99.998
   502  43.443   9.530    .004  28.616    .002    .007  12.474  11.340  -4.319 101.096
   503  42.512   8.945    .005  28.640    .006   -.009  12.488  11.307  -3.826 100.068
   504  46.904   9.162    .015  25.915    .030    .005  11.766  10.167  -4.564  99.400
   505  45.437   8.648    .002  26.965    .005    .005  11.666  10.935  -4.276  99.388

AVER:   44.035   9.007    .006  27.791    .011   -.001  12.225  11.060  -4.141  99.994
SDEV:    1.800    .332    .005   1.110    .010    .009    .396    .464    .349    .623
SERR:     .735    .135    .002    .453    .004    .004    .162    .190    .143
%RSD:     4.09    3.68   84.10    3.99   92.35-1540.98    3.24    4.20   -8.44

PUBL:   42.791   9.020    n.a.  28.700    n.a.    n.a.  12.100  11.180  -3.798  99.994
%VAR:     2.91  (-.15)     ---   -3.17     ---     ---    1.03   -1.07    9.03
DIFF:    1.244  (-.01)     ---   -.910     ---     ---    .125   -.120   -.343
STDS:      160     284     285      12     285     285     160     374     ---

Because, if you use the PFE option to calculate oxygen by stoichiometry in a standard sample (and the standard composition is already corrected for the oxygen-halogen correction in the standard database), the oxygen-halogen correction in PFE is incorrectly applied twice! Hopefully this makes sense after one has tried this out for themselves in PFE.

However (and I have not tested this) but I suspect if the standard composition in the standard database is *not* already oxygen-halogen corrected, then applying the oxygen-halogen correction to a standard sample in PFE will work fine.  I have my fluor-phlogopite standard entered both with and without the oxygen-halogen correction (std #282 and #284) in the default standard database.  One of these days I will get around to testing this!

The bottom line is, just use the oxygen-halogen correction for your unknowns and all will be fine!
« Last Edit: June 17, 2020, 11:21:01 am by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2631
  • Other duties as assigned...
    • Probe Software
Re: Halogen correction
« Reply #7 on: June 17, 2020, 02:23:04 pm »
Also, please remember that all corrections in CalcZAF/Probe for EPMA are performed during the matrix iteration procedures, including these oxygen-halogen calculations.  What these oxygen-halogen calculations are changing during the matrix iteration is not the halogen concentrations, but the "excess" oxygen concentration from stoichiometric oxygen.

Here is the code for the calculation of stoichiometric oxygen and the calculations for subtracting oxygen based on the halogen equivalent, and/or adding excess oxygen from Fe2O3.

Code: [Select]
' Calculate amount of stoichiometric oxygen and add to total
r1!(zaf.in0%) = 0#
For i% = 1 To zaf.in1%
r1!(zaf.in0%) = r1!(zaf.in0%) + r1!(i%) * zaf.p1!(i%)
Next i%

' Calculate equivalent oxygen from halogens and subtract from calculated oxygen if flagged
If UseOxygenFromHalogensCorrectionFlag Then
r1!(zaf.in0%) = r1!(zaf.in0%) - ConvertHalogensToOxygen(zaf.in1%, sample(1).Elsyms$(), sample(1).DisableQuantFlag%(), r1!())
If ierror Then Exit Sub
End If

' Calculate excess oxygen from ferric Fe
If sample(1).FerrousFerricCalculationFlag Then
Call ConvertFerrousFerricRatioFromComposition(zaf.in0%, zaf.Z%(), zaf.atwts!(), r1!(), sample(1).numcat%(), sample(1).numoxd%(), zaf.p1!(), sample(1).DisableQuantFlag%(), sample(1).FerrousFerricTotalCations!, sample(1).FerrousFerricTotalOxygens!, tFerricToTotalIronRatio!, tFerricOxygen!, tFe_as_FeO!, tFe_as_Fe2O3!)
If ierror Then Exit Sub
r1(zaf.in0%) = r1(zaf.in0%) + tFerricOxygen! / 100#
End If

' Add to sum
zaf.ksum! = zaf.ksum! + r1!(zaf.in0%)
End If

It's complicated!     ;D

The complete matrix correction code is available here:

https://github.com/openmicroanalysis/calczaf
« Last Edit: June 17, 2020, 07:25:12 pm by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2631
  • Other duties as assigned...
    • Probe Software
Re: Halogen correction
« Reply #8 on: June 28, 2020, 11:47:39 am »
Julien Allaz and I have been discussing the oxygen-halogen correction in PFE and wanted to share our recent efforts to improve the way PFE handles oxygen-halogen containing samples.  It's a little complicated.

First of all it should be noted that the program properly handles the oxygen-halogen correction on unknown samples for all situations, particularly when oxygen is calculated by stoichiometry. It also handles the situation where an unknown is calculated by simply specifying the amount of oxygen. But of course in that case, the oxygen-halogen correction has already been applied.

PFE also handles the situation where a standard is analyzed and the oxygen in the standard database was *not* already corrected for the oxygen-halogen equivalence (#282). As seen here:

Oxygen Calculated by Cation Stoichiometry and Included in the Matrix Correction
Oxygen Equivalent from Halogens (F/Cl/Br/I), Subtracted in the Matrix Correction

St  282 Set   2 Fluor-phlogopite (synthetic), Results in Elemental Weight Percents
 
ELEM:        F      Si      Mg      Al       K       O
TYPE:     ANAL    SPEC    SPEC    SPEC    SPEC    CALC
BGDS:      LIN
TIME:    20.00     ---     ---     ---     ---     ---
BEAM:    29.99     ---     ---     ---     ---     ---

ELEM:        F      Si      Mg      Al       K       O   SUM 
     6   8.453  20.002  17.307   6.404   9.281  38.218  99.665
     7   8.766  20.002  17.307   6.404   9.281  38.086  99.846
     8   8.536  20.002  17.307   6.404   9.281  38.183  99.713

AVER:    8.585  20.002  17.307   6.404   9.281  38.163  99.741
SDEV:     .162    .000    .000    .000    .000    .068    .094
SERR:     .094    .000    .000    .000    .000    .039
%RSD:     1.89     .00     .00     .00     .00     .18

PUBL:    9.020  20.002  17.307   6.404   9.281  41.775 103.789
%VAR:    -4.83     .00     .00     .00     .00   -8.65
DIFF:    -.435    .000    .000    .000    .000  -3.612
STDS:      835     ---     ---     ---     ---     ---

Note that the "published" (PUBL) amount of oxygen from the standard database is based on the assumed cation stoichiometry, and is not correct, but the halogen correction does make the proper correction.

Previously if the standard composition was already corrected for the oxygen-halogen correction as in the following standard (#284), the program performed a double correction of the oxygen-halogen equivalence (see above posts). However, Julien and I added some code that checks for a negative excess oxygen from the standard database, and if it is negative, it zeros out the deficit oxygen before entering the matrix correction routine. The new code is seen here:

Code: [Select]
If sample(1).Type% = 1 Then
analysis.WtPercents!(chan%) = ConvertTotalToExcessOxygen!(Int(1), sample(), stdsample())
If UseOxygenFromHalogensCorrectionFlag And sample(1).OxideOrElemental% = 1 Then
If analysis.WtPercents!(chan%) < 0# Then analysis.WtPercents!(chan%) = 0#  ' zero out oxygen equivalence of halogen from standard database
End If

' For unknowns, use specified oxygen weight percent
Else
analysis.WtPercents!(chan%) = stdsample(1).ElmPercents!(ip%)
End If

Here is an example of a standard, already corrected for the oxygen equivalence of halogens, analyzed with the oxygen-halogen correction:

Oxygen Calculated by Cation Stoichiometry and Included in the Matrix Correction
Oxygen Equivalent from Halogens (F/Cl/Br/I), Subtracted in the Matrix Correction

St  284 Set   2 Fluor-phlogopite (halogen corrected), Results in Elemental Weight Percents
 
ELEM:        F      Si      Mg      Al       K       O
TYPE:     ANAL    SPEC    SPEC    SPEC    SPEC    CALC
BGDS:      LIN
TIME:    20.00     ---     ---     ---     ---     ---
BEAM:    30.01     ---     ---     ---     ---     ---

ELEM:        F      Si      Mg      Al       K       O   SUM 
     9   8.806  20.002  17.307   6.404   9.281  38.069  99.870
    10   8.832  20.002  17.307   6.404   9.281  38.059  99.885
    11   8.824  20.002  17.307   6.404   9.281  38.062  99.880

AVER:    8.821  20.002  17.307   6.404   9.281  38.063  99.878
SDEV:     .013    .000    .000    .000    .000    .006    .008
SERR:     .008    .000    .000    .000    .000    .003
%RSD:      .15     .00     .00     .00     .00     .01

PUBL:    9.020  20.002  17.307   6.404   9.281  37.980  99.994
%VAR:    -2.21     .00     .00     .00     .00     .22
DIFF:    -.199    .000    .000    .000    .000    .083
STDS:      835     ---     ---     ---     ---     ---

STKF:    .1715     ---     ---     ---     ---     ---
STCT:    59.95     ---     ---     ---     ---     ---

Note that both the published concentration of oxygen is corrected for in the standard database, and the stoichiometric oxygen in the standard is properly corrected as expected.

Part of the reason for this issue is that many, many years ago we decided to allow the user to handle the deficit (or excess) oxygen in the standard compositional database, but then include that deficit (or excess) oxygen in the matrix calculation. For example, when analyzing magnetite, the default is to include the excess oxygen by simply loading the speciifed oxygen concentration from the standard database.

But (and here it gets complicated), if the user decides to simply calculate oxygen by stoichiometry for this standard (instead of loading the specified oxygen from the standard database as is the default), the program automatically includes the deficit (or excess) oxygen from the standard database.

But if the standard composition in the standard database is already corrected for the deficit (or excess) oxygen, this results in an double correction during the matrix correction. The new code above should prevent this double correction.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"