Superimposing Scattering Profiles

Skip to first unread message

Matthias Zeug

May 26, 2021, 7:21:10 AM5/26/21
Hi all,

I wondered if you could help clear up a question, for which I unfortunately can't find the complete answers in the docs

 My question would be if RAW also considers the experimental errors of the scattering curves when superimposing them. Also, it is somehow possible to obtain the x^2 value of the fit?

 Thank you very much.



Jesse Hopkins

May 26, 2021, 9:08:12 AM5/26/21
Hi Matthias,

RAW does just a simple linear least squares fit for the superposition (forcing offset or scale to be zero, if you’re just doing a scaled or offset superposition respectively), and it is not error weighted. Unfortunately, there’s no way in RAW to get the chi^2 value of the difference between the datasets. It’s been a while since I looked at this code (years), but having it be error weighted wouldn’t be hard, and is probably a good idea.

If you’re interested in making your own method to do this, if you use python it would be pretty simple to use the RAW API to load in your .dat files, and then probably something like the scipy.optimize.curve_fit to do the actual error weighted fitting.

All the best.

- Jesse

Jesse Hopkins, PhD
Beamline Scientist
BioCAT, Sector 18
Advanced Photon Source

You received this message because you are subscribed to the Google Groups "BioXTAS RAW" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Reply all
Reply to author
0 new messages