[Ifeffit] unable to export xdi file in xas viewer

George Sterbinsky GeorgeSterbinsky at u.northwestern.edu
Mon May 4 10:53:47 CDT 2020


Hi Matt,

Thanks for the explanation, I now see what you meant.

George

On Fri, May 1, 2020 at 6:28 PM Matt Newville <newville at cars.uchicago.edu>
wrote:

> Hi George,
>
>
> On Thu, Apr 30, 2020 at 11:39 PM George Sterbinsky <
> GeorgeSterbinsky at u.northwestern.edu> wrote:
>
>> Hi Matt,
>>
>> Thank you, it is now working for me too. In your previous email, you
>> said, "It probably should not even be trying to estimate the uncertainty in
>> the model." Why do you say that? Having the uncertainty in the fit
>> parameters, and therefore the centroid, could seemingly be useful.
>>
>>
> Sorry for the delay in answering...
>
> I think the problem you were seeing was because uncertainties in fitted
> parameters were not estimated.  Sometimes that happens, say if some
> parameter doesn't actually alter the fit or gets stuck at a boundary or
> something like that.     That case is not ideal, but it should be
> acceptable - and definitely not cause problems.
>
> After a fit is done, the code tries to evaluate the uncertainties in the
> best-fit, per point `delta_fit` so that one would be able to plot bands of
> uncertainty (such as
> https://lmfit.github.io/lmfit-py/examples/documentation/model_uncertainty.html).
>  Of course, to calculate that `delta_fit`, it needs uncertainties in the
> parameters.  The error you were seeing wat that it could not do this
> calculation because, for some reason, it did not have those uncertainties.
> So, what I meant was that the code should not be trying to estimate that
> `delta_fit` if it doesn't have uncertainties in the parameters.
>
> --Matt
>
>
>
>
>
>
>
>
> George
>>
>> On Wed, Apr 29, 2020 at 12:05 PM Matt Newville <
>> newville at cars.uchicago.edu> wrote:
>>
>>> Hi George,
>>>
>>> Very sorry, that should have been
>>>  delta_fit = 0.0*result.best_fit
>>> It's now fixed in github master, and I verified that I could actually
>>> export a model from pre-edge peak fitting in XAS_Viewer.
>>>
>>>
>>>
>>> On Wed, Apr 29, 2020 at 10:31 AM George Sterbinsky <
>>> GeorgeSterbinsky at u.northwestern.edu> wrote:
>>>
>>>> Hi Matt and all,
>>>>
>>>> Unfortunately, after a clean install of larch following the source
>>>> installation instructions, I am not able export any fits to xdi files, and
>>>> a different error, shown below, is now printed in the terminal. Please let
>>>> me know if any additional information would be helpful in solving this
>>>> issue.
>>>>
>>>> Thank you,
>>>> George
>>>>
>>>>
>>>> Traceback (most recent call last):
>>>>   File
>>>> "/opt/anaconda3/lib/python3.7/site-packages/xraylarch-0.9.47-py3.7.egg/larch/wxxas/prepeak_panel.py",
>>>> line 366, in onExportFitResult
>>>>     yerr=yerr, x=x)
>>>>   File
>>>> "/opt/anaconda3/lib/python3.7/site-packages/xraylarch-0.9.47-py3.7.egg/larch/io/export_modelresult.py",
>>>> line 59, in export_modelresult
>>>>     delta_fit = 0.0*result_best_fit
>>>> NameError: name 'result_best_fit' is not defined
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, Apr 21, 2020 at 9:25 AM Matt Newville <
>>>> newville at cars.uchicago.edu> wrote:
>>>>
>>>>> Hi George,
>>>>>
>>>>> Hm, sorry about that.  It seems to be saying that the parameter
>>>>> uncertainties weren't calculated correctly.  It probably should not even be
>>>>> trying to estimate the uncertainty in the model.  I believe it should be
>>>>> fixed in git master for larch, and I'll see about looking for this in lmfit
>>>>> too.
>>>>>
>>>>> On Mon, Apr 20, 2020 at 4:00 PM George Sterbinsky <
>>>>> GeorgeSterbinsky at u.northwestern.edu> wrote:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> When attempting to export an xdi file for a pre-edge peak fit in XAS
>>>>>> viewer, the error message below prints to the terminal and the xdi file is
>>>>>> not generated. I can provide the project file and instructions for
>>>>>> generating the error message if that would be helpful.
>>>>>>
>>>>>> Thank you,
>>>>>> George
>>>>>>
>>>>>>
>>>>>> Traceback (most recent call last):
>>>>>>   File
>>>>>> "/anaconda3/lib/python3.7/site-packages/larch/wxxas/prepeak_panel.py", line
>>>>>> 369, in onExportFitResult
>>>>>>     yerr=yerr, x=x)
>>>>>>   File
>>>>>> "/anaconda3/lib/python3.7/site-packages/larch/io/export_modelresult.py",
>>>>>> line 60, in export_modelresult
>>>>>>     delta_fit = result.eval_uncertainty(result.params, **kwargs)
>>>>>>   File "/anaconda3/lib/python3.7/site-packages/lmfit/model.py", line
>>>>>> 1488, in eval_uncertainty
>>>>>>     dval = pars[pname].stderr/3.0
>>>>>> TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
>>>>>> _______________________________________________
>>>>>> Ifeffit mailing list
>>>>>> Ifeffit at millenia.cars.aps.anl.gov
>>>>>> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>>>>>> Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> --Matt Newville <newville at cars.uchicago.edu> 630-252-0431
>>>>> _______________________________________________
>>>>> Ifeffit mailing list
>>>>> Ifeffit at millenia.cars.aps.anl.gov
>>>>> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>>>>> Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>>>>>
>>>> _______________________________________________
>>>> Ifeffit mailing list
>>>> Ifeffit at millenia.cars.aps.anl.gov
>>>> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>>>> Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>>>>
>>>
>>>
>>> --
>>> --Matt Newville <newville at cars.uchicago.edu> 630-252-0431
>>> _______________________________________________
>>> Ifeffit mailing list
>>> Ifeffit at millenia.cars.aps.anl.gov
>>> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>>> Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>>>
>> _______________________________________________
>> Ifeffit mailing list
>> Ifeffit at millenia.cars.aps.anl.gov
>> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
>> Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>>
>
>
> --
> --Matt Newville <newville at cars.uchicago.edu> 630-252-0431
> _______________________________________________
> Ifeffit mailing list
> Ifeffit at millenia.cars.aps.anl.gov
> http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
> Unsubscribe: http://millenia.cars.aps.anl.gov/mailman/options/ifeffit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://millenia.cars.aps.anl.gov/pipermail/ifeffit/attachments/20200504/2dfbfc99/attachment.html>


More information about the Ifeffit mailing list