-
Notifications
You must be signed in to change notification settings - Fork 28
Resolution lookup #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolution lookup #188
Conversation
…r to every function that previously had as a parameter parmDict, a large dictionary of refinable parameters that contains the original histDict
…o the regular sig parametersation for TOF
@vondreele I am going to ask Bob to look at this. I suspect the conflicts are because he also fixed the hstrain bug. |
Hi Brian,
(removed information not relevant to PR-- BHT)
Now back from vacation (a pile of e-mail...). Not sure what the conflict might be but, I suppose it is about the HStrain fix that both Malcolm & I did. Looks like his 'pdabc' thing is correct. We can also use something similar for "gear errors" in CW data and other possible anomalies in powder data.
|
Hi both, thanks for looking over this, just let me know if I need to change anything :) |
I have brought this up-to-date with the current GSAS-II release (this PR was pretty far behind), looking fairly carefully to make sure that the changes here are pretty much the same as what Malcolm added originally. Self-tests work, but that is pretty much only testing for gross syntax errors. I think this is ready for a merge, but:
|
@briantoby sorry if I used an out of date starting point for my edits cand caused extra work! Anyway, once I figure out how to pull your branch I will run it locally with my SNS data. Thanks. |
@briantoby I tested your commits and confirmed the following:
I'm not sure what it's impact is. Refinements could continue. So, other than the error above, it seems to be working. |
71ae6ac should address error message 5 in above. I think this error occurred when plotting peak widths. You might confirm this before updating by opening the .gpx and selecting the "Instrument Parameters" tree item and confirm that this produces the error. If you update and the error goes away (and I hope the alpha & beta values look correct) then my fix was correct. |
I pulled the latest version (71ae6ac) and the error changed: Traceback (most recent call last):
File "/gpfs/neutronsfs/instruments/SNAP/shared/Malcolm/code/GSAS-II/pixi/.pixi/envs/default/lib/python3.12/site-packages/wx/core.py", line 3427, in <lambda>
lambda event: event.callable(*event.args, **event.kw) )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/gpfs/neutronsfs/instruments/SNAP/shared/Malcolm/code/GSAS-II/GSASII/GSASIIdataGUI.py", line 8873, in SelectDataTreeItem
G2plt.PlotPeakWidths(G2frame)
File "/gpfs/neutronsfs/instruments/SNAP/shared/Malcolm/code/GSAS-II/GSASII/GSASIIplot.py", line 3214, in PlotPeakWidths
data = G2mth.setPeakparms(Parms,Parms2,T,Z)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/gpfs/neutronsfs/instruments/SNAP/shared/Malcolm/code/GSAS-II/GSASII/GSASIImath.py", line 5130, in setPeakparms
alp = np.interp(dsp,Pdabc[0],Pdabc[1])
~~~~~^^^
KeyError: 0 |
ok, my attempt to fix this by looking at code in another routine failed. I'd better do this in a more systematic way. Could you e-mail me the .gpx file? |
These changes had an unintended consequence, since the call signature for errRefine changed, all calls to that needed to be updated. I have done that, but in many places the new histDict1 array was not available so I passed {} as a placeholder, but obviously computations in those places will not give the right result when the width table is used with TOF (~5 places each in testDeriv and GSASIIstrMain, see 41c552b). |
This PR includes work to implement an existing partial support for a second instrument parameter dicitionary that contains tabular data. The focus was on doing this for TOF diffraction data from multibank instruments.
In this PR, I added the ability to load and save instprm format files that contain a tabular description of the instrument resolution in the form of (already supported) multiline input with each line consisting of 5 comma separated values.
Example entry for bank 1 (also see attached instprm file and matching dataset for testing purposes):
It is mandatory that the number of entries for all lines is identical and all entries are expected to be readable as floats. The data are loaded into a dictionary with keys : "d", "TOF","alp","bet","sig", each with a list of values.
This dictionary is then included in the instprm1 dictionary with the key
pdabc
, allowing possible extension of instprm1 with other future entries.Functions accepting the original
instprm
as a single dictionary have been modified to accept bothinstprm
andinstprm1
dictionaries as separate parameters. Some functions already accepted instprm as a list of two dictionaries, these were left as is.So far, the only use of the new dictionary, with the
pdabc
entry, is the interpolation of an additional additive term in the TOF sigma parameter calculation. This term is determined via interpolation of the tabulation of instprm1["pdabc"]["sig"] according to the d-spacing of the reflection. However, this could be extended to have much broader usage.Notes:
OnSaveAll
, not in the functionOnSave
.Test data:
pdabc.zip