McStasMcXtrace / iFit

a simple library to analyze data (with McCode and Phonons/DFT hooks). :warning: this project has been moved to https://gitlab.com/soleil-data-treatment/soleil-software-projects/remote-desktop
http://ifit.mccode.org
Other
5 stars 5 forks source link

ResLibCal: Convolution fitting of combined models #153

Closed tejsner closed 6 years ago

tejsner commented 6 years ago

I am having some issues with convolution fitting of combined models.

I have narrowed down the problem to the evaluation of the model. I have attached a .zip file with everything I try to do. In the first file everything works as intended (single acoustopt model), but in the second file the convolution fitting fails and it seems to be related to the evaluation of the unconvoluted model. I have also found that the fitting works in 1.9 but not 1.10.

If i have a model that is the sum of two 4D models (model = acoustopt1 + acoustopt2), I get the following behaviour:

With a single 4D model (model = acoustopt), everything works as intended apart from fitting in version 1.10.

I am running iFit (1.9/1.10) on MATLAB R2017b on Windows 10.

convofit_test.zip

farhi commented 6 years ago

Many thanks, will commit the fix tomorrow. It is identified, and under control.

farhi commented 6 years ago

I think I fixed it. At least your tests seem to go through.

This was a mixed error:

some statements would fail when using a scalar HKL axis value. It was planned to use grids, vectors, etc, but a special case for scalars is needed
the axes, which are modified to ease evaluation of a 4D Sqw, need to be restored prior to evaluating the second model term (from your model1+model2 binary operation).

Will now commit the fix.

farhi commented 6 years ago

Done with commit https://github.com/McStasMcXtrace/iFit/commit/01b2fb6aaa71d468a36ca2182ed84cbd11597047