GithubHelp home page GithubHelp logo

neutrons / licorne-py Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 3.0 1.13 MB

Port of LICORNE program to Python

License: GNU General Public License v3.0

Python 43.76% M 0.26% MATLAB 16.61% HTML 32.85% Objective-C 0.01% Shell 0.02% Jupyter Notebook 6.50%

licorne-py's People

Contributors

andreisavici avatar jmborr avatar mdoucet avatar quantumsteve avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

licorne-py's Issues

ValueError: The input contains nan values

Hi developers,

I ran into another problem while doing the Licorne fit to my experimental data. I have attached the yaml file associated with this error. I think that the minimizer might have diverged the chi value to an unrealistic value leading to this error.

Thanks!

Traceback (most recent call last):
  File "/home/georgeyumnam/Work/Honey-Comb-lattice-DWBA/MAGREF/Licorne-Py/licorne/fit_worker.py", line 57, in run
    result=minimize(self.calculate_residuals, parameters,method=lu.get_minimizer())
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 2274, in minimize
    return fitter.minimize(method=method)
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 1926, in minimize
    return function(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 1464, in leastsq
    lsout = scipy_leastsq(self.__residual, variables, **lskws)
  File "/home/georgeyumnam/.local/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 394, in leastsq
    gtol, maxfev, epsfcn, factor, diag)
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 533, in __residual
    nan_policy=self.nan_policy)
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 2140, in _nan_policy
    raise ValueError("The input contains nan values")
ValueError: The input contains nan values

state_final.zip

ValueError of incompatible shape type.

Hi developers,

I am getting the following error while working with the Licorne-Py GUI.
I was trying to fit the MSLD of an experimental data with 26 layers of thickness "10" each,
After finally setting up the NSLD for the 26 Layers, and finally hitting the "fit" tab, licorne shuts down immediately, and gives this error.

Traceback (most recent call last):
  File "/home/georgeyumnam/Work/Honey-Comb-lattice-DWBA/MAGREF/Licorne-Py/licorne/fit_worker.py", line 57, in run
    result=minimize(self.calculate_residuals, parameters,method=lu.get_minimizer())
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 2274, in minimize
    return fitter.minimize(method=method)
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 1926, in minimize
    return function(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 1464, in leastsq
    lsout = scipy_leastsq(self.__residual, variables, **lskws)
  File "/home/georgeyumnam/.local/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 383, in leastsq
    shape, dtype = _check_func('leastsq', 'func', func, x0, args, n)
  File "/home/georgeyumnam/.local/lib/python2.7/site-packages/scipy/optimize/minpack.py", line 27, in _check_func
    res = atleast_1d(thefunc(*((x0[:numinputs],) + args)))
  File "/usr/local/lib/python2.7/dist-packages/lmfit/minimizer.py", line 518, in __residual
    out = self.userfcn(params, *self.userargs, **self.userkws)
  File "/home/georgeyumnam/Work/Honey-Comb-lattice-DWBA/MAGREF/Licorne-Py/licorne/fit_worker.py", line 51, in calculate_residuals
    self.chiSquaredChanged.emit((chi**2).mean())
  File "/home/georgeyumnam/.local/lib/python2.7/site-packages/numpy/core/_methods.py", line 70, in _mean
    ret = umr_sum(arr, axis, dtype, out, keepdims)
ValueError: operands could not be broadcast together with shapes (214,) (215,)

Also, Licorne-Py shuts down completely and closes the window without saving the work if an error is made while setting the NSLD or thickness. For example, while setting NSLD, I accidentally set the value to 3.1-6 instead of 3.1e-6, and this resulted in a core dumped error shutting down the window completely without saving the work in progress.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.