Chebyshev backgrounds for XRD fitting

Hi,

There is literature guidance to use a Chebyshev generated function for a background for X-Ray Diffraction patterns (they are technically not spectra).

Looking for guidance to jump start this.  Any help on how I would generate a background curve using this function.  I have no experience with it so I am not sure how it should look.

Andy

Andy-

I presume you are using Mulitpeak Fit, and need a baseline function. The help for Multipeak Fit has a section that describes how to write your own baseline function: DisplayHelpTopic "Adding Your Own Baseline Function" It is not a trivial task, but I know you have quite a bit of experience with Igor code. Be sure to get the latest version of MPF- chozo has enhanced the package, particularly in regard to how baseline functions are handled.

Another possibility might be Tony Wither's baseline fitting project: https://www.wavemetrics.com/project/Baselines

Do you want to use the background in a fit or just subtract it? I can certainly help with creating a background function for Multipeak Fit as John suggested. I would be also happy to implement this into my background remover tool ( https://www.wavemetrics.com/node/21532 ) if this will be useful. There, I have already ordinary polynomials as a selection. Tony's Baselines tool will be similarly useful, and he even offers user baseline function support for his project. First, I certainly can find information about Chebyshev polynomials, but are they used as is in XRD? Or in other words, what function exactly are you looking for?

Hi,

 

Looking just to establish a baseline for subtraction in standard data processing workflow.  The XRD Software with the Tool (Rigaku has the option and the client has shown some example).

 

Manually applied in XRD Fitting Software

 

In XRD there is a problem of the background increasing very significantly at low angles and I have yet to find a physics based method for constructing a baseline.  A confounding issue is that the baseline seems to be sample type dependent - so is it really a baseline or more properly part of the signal.  With the goal to have a generic fitting methodology for all types of samples in contrast to type specific.

I have looked at Tony's baseline program and shameless stole the Arc hull method for my automation work and it provides an answer that still leaves some concerns.  The biggest being that when I do a multipack fit (4 peaks of various types, Gaussian, Voigt and exponentially modified Gaussian) for some of the sample I am still left with a very significant linear baseline to get a reasonable fit.  Some sample type have a very shallow sloped baseline that I can hand wave away when no one is looking.

What the client has done as an example is to select 5 points manually and have the XRD fitting software fit a background.  It does not appear to simultaneously fit the background but rather is preprocessing step. As if I want incorporate this approach I would need a way to fit a baseline.

Andy

It might help that Igor has two Chebyshev functions: DisplayHelpTopic "chebyshev" and DisplayHelpTopic "chebyshevU"

HI,

I saw it thanks and I have been playing with various curves to get a sense of the shape and scaling/shifting opportunities to fit a background.

The more I look at this the less I like the approach.  If you look at equation 13.2 in the reference xi basically is going from -1 to 1 and the Chebyshev function is either symmetric or antisymmetric about 0.  So curve will probably need to be truncated and or shifted as well as scaled in y to fit the experimental data.  The example that was drawn from the experimental data which was fit to 5 points is doing just that fitting a curve.  Generally I do not like this approach of just fitting a function.  Additionally there is great sensitivity to the extreme values chosen for the fit.  Unless I can find some physics, I might push back on this approach.

Andy

@Andy wrote ... Unless I can find some physics, I might push back on this approach.

If you don't find your physics answer, I'd have to wonder whether you might gain sufficient internal consistency to satisfy yourself with an empirical approach by going through an FFT->Filter->IFFT approach. I suggest this because when I had similar issues in sloping backgrounds some decades ago doing analysis on XPS spectra, I developed routines that would mirror+invert the spectrum (in this case probably about the right ordinate axis), FFT, cut up to a specific low frequency, and do an IFFT. You might even be able to extract the Gauss and Lorentz shapes in the FFT.

This is no help with Chebyshev background fitting on its own:   <useless comment: But obviously, there is physics behind the background and especially the rise at low angles (q values), small-angle scattering does have quite a bit of physics behind it. Now, it gets complicated beyond reason quickly - I have been recently fitting some carbon/graphite samples, first two peaks + small angle scattering (up to micron length scales) and model has ~20 parameters which are impossible to fit reliably. And that is simplified model of two diffractions peaks and two length scales in small-angle scattering - and designed specifically for these carbon materials.  That makes this difficult to apply in generic case for diffraction... Comically, small-angle scattering fights with "background" at high angles which originates from diffraction region while diffraction fights with "background" originating from small-angle region. There are exceptions, but we really should talk together more... :end of useless comment>

Helpful suggestion:  may be to look at GSAS-II (aka: pyGSAS) which is well-respected open source python tool for diffraction and see, how they approach background fitting. It is Python, so it should be readable? That would show what tricks they have to get background fitting. It might even be described in human language in the papers or talk to authors. Why develop new methods, someone has already done this. 

It's not clear to me what advantage a Chebyshev series has over a spline for baseline approximation. Maybe it's helpful if you want to refine the background when modelling an XRD pattern? As far as I can see, Chebyshev backgrounds are usually fit though user-defined nodes, so they act just like a spline. The real advantage of Chebyshev polynomials is that a smooth function f(x) can be very efficiently approximated by a Chebyshev series if you can can calculate f for the Chebyshev node positions. Since baseline fitting is all about finding an unknown baseline function, you cannot easily calculate the roots and end up having to use leastsquares refinement. Using leastsquares to fit a Chebyshev series though arbitrary node positions or though some data points seems to work OK; I added this as a option in the baselines project, but it would benefit from some critical feedback before it's ready for release.

In reply to by tony

Hi Tony,

After studying it some more I would agree with you.  The short take away is I think the Chebyshev approach here was a solution in search of a problem. At present we are focusing on an arc hull approach based on the code you have provided in baselines.ipf -

Thank you very much.

Andy