xraypy / xraylarch

Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging, and more.
https://xraypy.github.io/xraylarch
Other
138 stars 68 forks source link

Results of LCF won't plot #509

Open fluxmap opened 7 months ago

fluxmap commented 7 months ago

I am using the current version of Larix.

While running LCF, 'fit' generates results in the 'Linear Combination Results' window, but the plot window doesn't update. The larch buffer output is shown below:

plot_mu(d04_1merge_1, show_flat=True, delay_draw=True, label='data', emin=2450.0, emax=2500.0, title='d04(1)_merge, Fit #01', win=1) plot(d04_1__merge_1.lcf_result[0].xdata, d04_1merge_1.lcf_result[0].yfit, label='Fit #01', zorder=30, delay_draw=True, win=1) plot(d04_1merge_1.lcf_result[0].xdata, d04_1merge_1.lcf_result[0].ycomps['ESRF_methionine [R-S-R'] 0'], label='ESRF_methionine [R-S-R'] 0', delay_draw=True, win=1) plot(d04_1merge_1.lcf_result[0].xdata, d04_1merge_1.lcf_result[0].ycomps['ESRF_glutathion(ox) [R-SH] -1'], label='ESRF_glutathion(ox) [R-SH] -1', delay_draw=True, win=1) plot(d04_1__merge_1.lcf_result[0].xdata, d04_1__merge_1.lcf_result[0].ycomps['ESRF_glutathion(red) [R-SH] -1'], label='ESRF_glutathion(red) [R-SH] -1', delay_draw=False, win=1) plot_axvline(2465.000000, color='#EECCCC', zorder=-10, win=1) plot_axvline(2490.000000, color='#EECCCC', zorder=-10, win=1) <

I can save a 'statistics report', but none of the other output options seem to generate a file, though no errors are thrown (at least I can see). I am stumped. I would appreciate any advice.

I appreciate my description may be a little vague, so any suggestions on how to demonstrate/describe the problem more clearly will be gratefully received.

newville commented 7 months ago

@fluxmap Sorry for the trouble - that seems weird. Can you send example data?

I've had a couple of other serious bug reports for 0.9.75 that I am trying to address. This seems different, but I am not 100% certain of that. So, you might try to rollback to 0.9.74:

   python -m pip install xraylarch==0.9.74

If you do try that, please let me know whether that fixes it... that is at least a clue ;)

fluxmap commented 7 months ago

Hi Matt,

Thanks for the swift response. I think I'll ask you to stand down.

I had a bit of a mess due to various versions of Larch managed by Anaconda and two (Why two? Good question) installations of Larch via the Windows installer. I failed to realise these were hanging out on my system, and after blowing everything away and starting fresh, all seems well. I'll jump back in if I come across the issue again, but I am happy to chalk it up to some 'interesting' past decisions made on my end of the keyboard.

Thanks for your help.

fluxmap commented 7 months ago

Whelp, I am back.

Related but slightly different issue. Now, the LCF results will plot initially (as in the first time the fitting is initiated), but subsequent attempts don't appear to run. This is consistent between v9.74 and v9.75. Also, the behaviour is consistent across XAS viewer and Larix. I have attached some test data.

LCF_TestSet_20240328.zip

For clarity, I am using the GUIs as installed by the Windows installer.