<div dir="ltr"><div class="gmail_default" style="color:#38761d">Hi Matt,</div><div class="gmail_default" style="color:#38761d"><br></div><div class="gmail_default" style="color:#38761d">Thanks for the explanation, I now see what you meant.<br></div><div class="gmail_default" style="color:#38761d"><br></div><div class="gmail_default" style="color:#38761d">George<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 1, 2020 at 6:28 PM Matt Newville <<a href="mailto:newville@cars.uchicago.edu">newville@cars.uchicago.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hi George, </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020 at 11:39 PM George Sterbinsky <<a href="mailto:GeorgeSterbinsky@u.northwestern.edu" target="_blank">GeorgeSterbinsky@u.northwestern.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="color:rgb(56,118,29)">Hi Matt,</div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)">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.</div><div style="color:rgb(56,118,29)"><br></div></div></blockquote><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Sorry for the delay in answering...  </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">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.  </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">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 <a href="https://lmfit.github.io/lmfit-py/examples/documentation/model_uncertainty.html" style="font-family:Arial,Helvetica,sans-serif" target="_blank">https://lmfit.github.io/lmfit-py/examples/documentation/model_uncertainty.html</a>).   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.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">--Matt</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="color:rgb(56,118,29)"></div><div style="color:rgb(56,118,29)">George<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 29, 2020 at 12:05 PM Matt Newville <<a href="mailto:newville@cars.uchicago.edu" target="_blank">newville@cars.uchicago.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">Hi George, </div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">Very sorry, that should have been</div><div style="font-family:arial,helvetica,sans-serif"><span style="color:rgb(56,118,29);font-family:monospace"> delta_fit = 0.0*result.best_fit</span><br></div></div><div style="font-family:arial,helvetica,sans-serif"></div><div style="font-family:arial,helvetica,sans-serif">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.</div><div><br></div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 29, 2020 at 10:31 AM George Sterbinsky <<a href="mailto:GeorgeSterbinsky@u.northwestern.edu" target="_blank">GeorgeSterbinsky@u.northwestern.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="color:rgb(56,118,29)">Hi Matt and all,</div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)">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.</div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)">Thank you,</div><div style="color:rgb(56,118,29)">George<br></div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)"><span style="font-family:monospace">Traceback (most recent call last):<br>  File "/opt/anaconda3/lib/python3.7/site-packages/xraylarch-0.9.47-py3.7.egg/larch/wxxas/prepeak_panel.py", line 366, in onExportFitResult<br>    yerr=yerr, x=x)<br>  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<br>    delta_fit = 0.0*result_best_fit<br>NameError: name 'result_best_fit' is not defined</span></div><div style="color:rgb(56,118,29)"><span style="font-family:monospace"><br></span></div><div style="color:rgb(56,118,29)"><span style="font-family:monospace"><br></span></div><div style="color:rgb(56,118,29)"><span style="font-family:monospace"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 21, 2020 at 9:25 AM Matt Newville <<a href="mailto:newville@cars.uchicago.edu" target="_blank">newville@cars.uchicago.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif">Hi George,<br></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style="font-family:arial,helvetica,sans-serif">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.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 20, 2020 at 4:00 PM George Sterbinsky <<a href="mailto:GeorgeSterbinsky@u.northwestern.edu" target="_blank">GeorgeSterbinsky@u.northwestern.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="color:rgb(56,118,29)">Hello,</div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)">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.</div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)">Thank you,</div><div style="color:rgb(56,118,29)">George</div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)"><br></div><div style="color:rgb(56,118,29)"><span style="font-family:monospace">Traceback (most recent call last):<br>  File "/anaconda3/lib/python3.7/site-packages/larch/wxxas/prepeak_panel.py", line 369, in onExportFitResult<br>    yerr=yerr, x=x)<br>  File "/anaconda3/lib/python3.7/site-packages/larch/io/export_modelresult.py", line 60, in export_modelresult<br>    delta_fit = result.eval_uncertainty(result.params, **kwargs)<br>  File "/anaconda3/lib/python3.7/site-packages/lmfit/model.py", line 1488, in eval_uncertainty<br>    dval = pars[pname].stderr/3.0<br>TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'</span></div></div>
_______________________________________________<br>
Ifeffit mailing list<br>
<a href="mailto:Ifeffit@millenia.cars.aps.anl.gov" target="_blank">Ifeffit@millenia.cars.aps.anl.gov</a><br>
<a href="http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit</a><br>
Unsubscribe: <a href="http://millenia.cars.aps.anl.gov/mailman/options/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/options/ifeffit</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">--Matt Newville <newville at <a href="http://cars.uchicago.edu" target="_blank">cars.uchicago.edu</a>> 630-252-0431<br></div>
_______________________________________________<br>
Ifeffit mailing list<br>
<a href="mailto:Ifeffit@millenia.cars.aps.anl.gov" target="_blank">Ifeffit@millenia.cars.aps.anl.gov</a><br>
<a href="http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit</a><br>
Unsubscribe: <a href="http://millenia.cars.aps.anl.gov/mailman/options/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/options/ifeffit</a><br>
</blockquote></div></div>
_______________________________________________<br>
Ifeffit mailing list<br>
<a href="mailto:Ifeffit@millenia.cars.aps.anl.gov" target="_blank">Ifeffit@millenia.cars.aps.anl.gov</a><br>
<a href="http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit</a><br>
Unsubscribe: <a href="http://millenia.cars.aps.anl.gov/mailman/options/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/options/ifeffit</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">--Matt Newville <newville at <a href="http://cars.uchicago.edu" target="_blank">cars.uchicago.edu</a>> 630-252-0431<br></div></div>
_______________________________________________<br>
Ifeffit mailing list<br>
<a href="mailto:Ifeffit@millenia.cars.aps.anl.gov" target="_blank">Ifeffit@millenia.cars.aps.anl.gov</a><br>
<a href="http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit</a><br>
Unsubscribe: <a href="http://millenia.cars.aps.anl.gov/mailman/options/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/options/ifeffit</a><br>
</blockquote></div>
_______________________________________________<br>
Ifeffit mailing list<br>
<a href="mailto:Ifeffit@millenia.cars.aps.anl.gov" target="_blank">Ifeffit@millenia.cars.aps.anl.gov</a><br>
<a href="http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit</a><br>
Unsubscribe: <a href="http://millenia.cars.aps.anl.gov/mailman/options/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/options/ifeffit</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr">--Matt Newville <newville at <a href="http://cars.uchicago.edu" target="_blank">cars.uchicago.edu</a>> 630-252-0431<br></div></div>
_______________________________________________<br>
Ifeffit mailing list<br>
<a href="mailto:Ifeffit@millenia.cars.aps.anl.gov" target="_blank">Ifeffit@millenia.cars.aps.anl.gov</a><br>
<a href="http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit</a><br>
Unsubscribe: <a href="http://millenia.cars.aps.anl.gov/mailman/options/ifeffit" rel="noreferrer" target="_blank">http://millenia.cars.aps.anl.gov/mailman/options/ifeffit</a><br>
</blockquote></div>