AdvancedPhotonSource / GSAS-II

Home for GSAS-II: crystallographic and diffraction-based structural characterization of materials
Other
34 stars 14 forks source link

Tutorial #23 Peak Fitting unit cell indexing results drawing error when selecting 'use' #107

Closed jmoon-uran closed 5 days ago

jmoon-uran commented 6 days ago

Sorry, me again - continuing with the tutorials, I've come across another (really minor) drawing issue this time on the unit cells indexing results in the Fitting Individual Peaks and Auto Indexing tutorial.

During Step 7 (https://advancedphotonsource.github.io/GSAS-II-tutorials/FitPeaks/Fit%20Peaks.htm) when reviewing my choices, I am advised to hover over the drawing lines and check their hkl values as I select different results from the indexing result table.

When I do this, the console shows lots of errors, and the drawing doesn't redraw the newly selected unit cell chosen when clicking the 'use' flag.

I have figured a workaround, which is to leave the one I want displayed with its 'use' flag selected, while I click the powder pattern again in the data tree, then click back to the unit cells list item in the data tree, and it draws it correctly with no issue, but thought I'd report this anyway in case it was something you'd want attention brought to or if it's an easy fix or something.

Attached the gpx file and a screenshot attempting to show what I mean (but it's dynamic, the errors appear as you hover the cursor over the dashed lines, and hopefully you can see the corresponding selected unit cell is not what is currently drawn in the plot window).

tutorial23_peakfit.zip unitcellindex_tutorial23bug

Console says:

AttributeError: 'list' object has no attribute 'T' Traceback (most recent call last): File "C:\Users\\AppData\Local\gsas2full\Lib\site-packages\matplotlib\cbook.py", line 298, in process func(*args, **kwargs) File "C:\Users\\AppData\Local\gsas2full\GSAS-II\GSASII\GSASIIpwdplot.py", line 550, in OnMotion found = G2frame.HKL[np.where(np.fabs(G2frame.HKL.T[indx]-xpos) < dT/2.)] ^^^^^^^^^^^^^

briantoby commented 5 days ago

This error has been noted and I thought fixed. Are you using the latest GSAS-II version?

It is possible that this has been fixed only in a branch we are working on, with a major revamp of the indexing process.

Either way this is being worked on.

jmoon-uran commented 5 days ago

Oh I'm sorry, I didn't realise! I just tried updating again tonight - I was getting messages that there weren't any updates whenever I tried to click it in the help menu, even though I could see that my version was over a week old - but I tried again tonight and it updated okay, now says 15-nov-24 is the version I'm on.

I still get messages in the console saying that there are importers that can't be installed and there are importer errors that I don't understand - but I can confirm after the update that this drawing error has gone.

I'm really sorry for wasting your time - I am well aware that the bug reporting advice says to update before you post anything to see if that fixes it, I should have tried more rigorously to get the update to work and then retry the unit cell results step before posting, that's my bad. Won't happen again!

briantoby commented 4 days ago

No significant time spent on this, but we do ask that people check for updates before reporting bugs.

The importer warning is not very important, unless you happen to need that importer. This menu:

image

shows the error and the window shows the importer(s) that can't be loaded. If you need them you can use the "Install packages" button.

image

The reasoning behind this is that if a file format requires extra python modules, we still want to make the code available, but not require people to install that module if they don't need it.

jmoon-uran commented 4 days ago

It was totally my mistake, I apologise for that and glad to hear no significant time was spent on it. Thank you for letting me know about the importers. Thanks for your help!