From cdfb159f93a7b7a9a3f36813c5d9c38ef0e06d33 Mon Sep 17 00:00:00 2001 From: Nischal Dhungana Date: Wed, 28 Aug 2024 10:45:45 +0200 Subject: [PATCH] base modified to include rescale --- src/cdsaxs/simulations/base.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/cdsaxs/simulations/base.py b/src/cdsaxs/simulations/base.py index e4b0f9e..79a07d7 100644 --- a/src/cdsaxs/simulations/base.py +++ b/src/cdsaxs/simulations/base.py @@ -21,6 +21,22 @@ def convert_to_dataframe(self, fitparams): returns: df (pandas.DataFrame): a DataFrame containing the fitparams in a readable format. """ + + def rescale_fit_params(self, fitparams): + """ + This is a obligatory method that should be implemented by the Geometry class. + The values incoming from the fitter are normalized in the range of -sigma to sigma they need to be rescaled. + so this method's job is to take the arrays of fitparams and rescale them based on the initial guess given by the user. + the formula used should be something like this: + rescaled_fitparams = fitparams * multiplier + initial_guess + multiplier and initial_guess are the values given by the user. if you find that a certain set of multiplier works + better you can hardcode them as well but it is not recommended as it will make the code less flexible. + + Parameters: + fitparams (list): an array returned by the fitter that contains the population to be evaluated. + + returns: + fitparams (list): an array containing the rescaled fitparams. ...