News:

:) Remember, you need to be logged in to see posted attachments!

Main Menu

NeXL

Started by Ben Buse, April 29, 2026, 04:25:34 AM

Previous topic - Next topic

Ben Buse

#60
Yes I tried that, not sure what my problem is...

Separately is it possible to quant k-ratios in NeXL where oxygen is calculated by stoichometry rather than using a oxygen standard.

I see you have functions
NeXLCore.obystoichiometry
NeXLCore.asoxide

Can I apply them to the quantify command?

Here's the results of NeXL quantifying the PFE spectra, you can see for Wollasonite (the standard for Ca), the O is high, but other values pretty good.



Ben Buse

#61
Figured out gadfly in weave, it likes breaks in the code for the plot to appear
other plots
```julia
Gadfly.plot(res9[1])
```

Seems if not last line in block of code, plot doesn't show

which means can't run a for loop of plots to html report, but can when saving as interactive svg

John Donovan

Quote from: Ben Buse on June 03, 2026, 05:18:26 AMHere's the results of NeXL quantifying the PFE spectra, you can see for Wollasonite (the standard for Ca), the O is high, but other values pretty good.




Very impressive!
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Nicholas Ritchie

The key to O-by-stoic is within NeXLMatrixCorrection. 

`quantify` takes an optional argument `iteration` that allows you to configure the iteration algorithm.

NeXLMatrixCorrection.quantify(
    ffr::FitResult;
    strip::AbstractVector{Element} = Element[],
    iteration::Iteration = Iteration(mc=XPP, fc=ReedFluorescence, cc=Coating),
    kro::KRatioOptimizer = SimpleKRatioOptimizer(1.5),
    coating::Union{Nothing, Pair{CharXRay, <:Material}}=nothing
)::IterationResult
https://github.com/usnistgov/NeXLMatrixCorrection.jl/blob/master/src/iterate.jl

You can configure the iteration procedure using the

Iteration(;
        mc::Type{<:MatrixCorrection}=XPP,
        fc::Type{<:FluorescenceCorrection}=ReedFluorescence,
        cc::Type{<:CoatingCorrection}=Coating,
        updater=WegsteinUpdateRule(),
        converged=RMSBelowTolerance(0.00001),
        unmeasured=NullUnmeasuredRule()
    )

structure.  The key being the unmeasured argument which defaults to NullUnmeasuredRule() but can be replaced with a rule from https://github.com/usnistgov/NeXLMatrixCorrection.jl/blob/master/src/unmeasuredelement.jl.

The rule you want is
OByStoichiometry(valences = NeXLCore.defaultValences)
where default valances is defined in https://github.com/usnistgov/NeXLCore.jl/blob/master/src/stoichiometry.jl.

"Do what you can, with what you have, where you are"
  - Teddy Roosevelt