reflectivity / analysis

Data analysis for Neutron and X-ray Reflectometry
https://www.reflectometry.org/
Creative Commons Zero v1.0 Universal
0 stars 4 forks source link

Identify batch fitting as a high-priority in analysis software (and simultaneous fitting of large numbers of datasets) #42

Open bmaranville opened 4 years ago

andyfaff commented 3 years ago

The refnx GUI is setup to do this. For those who use python scripts to do analysis, it's also possible. An example of doing this with refnx is here

andyfaff commented 3 years ago

I don't know what actions are possible to do with this issue. Wiki page for batch fitting?

andyfaff commented 1 year ago

@jwuttke @bmaranville, @aglavic, do you have examples of how to perform batch fitting with bornagain/refl1d/genx? Perhaps a good way of closing this issue is to either make a github wiki page for batch fitting, or to create a page on reflectometry.org

jwuttke commented 1 year ago

In BornAgain, exemplary Python scripts that show how to fit are provided in directories

arm61 commented 1 year ago

What does “batch fitting” mean in this context? Multiple contrasts or time resolved?

aglavic commented 1 year ago

I think the main issue is, that it's not clear and used in different ways what people mean by "batch fitting". Maybe we should describe these different use cases and solutions to them separately.

Interpretations I can think of:

  1. Fitting multiple datasets to the same model, combining their FOM. (Not actually a batch fit as many use the term, but just tom mention.)
  2. Fitting multiple datasets to a model which changes only in some aspects. E.g. a magnetic sample at different fields/temperatures where each has different magnetization profile but same structure, so a coupled fit to all FOMs with varying model parameters.
  3. Fit the same model subsequently to different data to get parameter variation over datasets, starting with same starting values.
  4. Fit the same model subsequently to different data to get parameter variation over datasets, starting with the outcome of the last fit.
  5. Automatic fitting of any dataset using some sort of automatized guessing.

For scripted model building this is obviously always possible, just having examples might be helpful.

In GenX 1. and 2. is the default. Running 3. and 4. is possible and I have a simple example for that: https://aglavic.github.io/genx/doc/tutorials/batch_fitting.html ORSO headers can be used to extract sample parameters for each dataset to plot vs. fit parameters. I didn't get any feedback on that feature, so I doubt many people are using it.