disorderedmaterials / dissolve

Structure refinement software for total scattering data
GNU General Public License v3.0
9 stars 16 forks source link

Fitting namespace #1979

Open RobBuchananCompPhys opened 1 month ago

RobBuchananCompPhys commented 1 month ago

Describe the feature / issue Namespace DissolveFit will contain basic fitting operations for 1D data. This originally started as a motivation to include a go-to method for a general case of fitting a Gaussian to histogram data, but the scope expanded to peak finding - a class for this has now been implemented (#1978 ), although the Gaussian fit has yet to be implemented.

Additional details I thought given the arrival of the first PR, we could maybe flesh out exactly what else should go into this namespace in terms of classes or methods that would be good to have in there. Some ideas from my side:

RobBuchananCompPhys commented 1 month ago

@rprospero @trisyoungs

rprospero commented 1 month ago

If we're going to be adding a large number of these fitting functions, I'm beginning to wonder if we might be better off using pre-existing library for these functions. For example, GSL provides most of the fitting and polynomial functionality that we might desire. It's available on Conan, so it shouldn't be more onerous than other dependencies that we already include. Honestly, I'm rather hoping that we could find a better library than GSL, but it serves as an example.

RobBuchananCompPhys commented 1 month ago

I'm currently looking into how applicable the GSL library is for covering this functionality - I imagine it will be very applicable though. My guess is that as a first course of action, we could remove my peak finding work from the DissolveFit namespace, and place it in its own namespace, Peaks. Then the fitting namespace could be a wrapper to GSL functions.