Skip to content
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

dmin setting in GSAS tab of Engineering UI not being respected #36618

Open
RichardWaiteSTFC opened this issue Jan 5, 2024 · 2 comments
Open
Assignees
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS
Milestone

Comments

@RichardWaiteSTFC
Copy link
Contributor

RichardWaiteSTFC commented Jan 5, 2024

Describe the bug
Found during course of #36606.

The dmin setting is used as the lower limit for the d-spacing of the reflections to be fitted - however it appears GSAS tries to fit all reflections within the bounds of the data.

To Reproduce
(0) Change dmin in the settings (cog in bottom left of UI) to 1.25 Ang (larger than default)
(1) Follow the steps 1-7 of Test 11 (Note if you already have the files you may be able to skip to step 5)
https://developer.mantidproject.org/Testing/EngineeringDiffraction/EngineeringDiffractionTestGuide.html#test-11

The graph displayed should look like this
image

It can be seen that there are reflections (vertical blue lines below the data) predicted right down to the lowest extent of the data (which is about 0.5 Ang).

Again if you look at the reflections output file(ending _reflections_1_Fe_gamma.txt) in the GSASII folder of the save directory in the settings you can see GSAS tries to fit 26 reflections with minimum TOF 8302 mus. You can also open the .gpx file

Note the reflection generation code is working correctly,

def create_pawley_reflections(self, cell_lengths, space_group, basis):

The variable returned generated_reflections has only 3 reflections.
The reflections are added to the GSAS input dict/JSON string here

Which I have confirmed is called 3 times in debug.

If you open the .gpx file with GSAS yo uwill see the Pawley reflections have been set
image

The dmin is retrieved here


which gets parsed here

but it doesn't look like it is used anywhere other than when adding the reflections here
add_pawley_reflections(mantid_pawley_reflections, gsas_project, d_spacing_min)

Perhaps the GSAS API requires something else - like Pawley dmin to be set?
For more details on Pawley refinement options see the GUI docs here
https://subversion.xray.aps.anl.gov/pyGSAS/trunk/help/gsasII-phase.html
Or it needs to be told to use the Pawley reflections?

See also GSAS scriptable API docs here
https://gsas-ii.readthedocs.io/en/latest/GSASIIscriptable.html#application-interface-api-summaryhttps://gsas-ii.readthedocs.io/en/latest/GSASIIscriptable.html#application-interface-api-summary

Expected behavior
It would only try and fit reflections with d-spacing > dmin

@RichardWaiteSTFC RichardWaiteSTFC added Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS labels Jan 5, 2024
@RichardWaiteSTFC RichardWaiteSTFC added this to the Release 6.10 milestone Jan 5, 2024
@RichardWaiteSTFC
Copy link
Contributor Author

GSAS also seems to create a list of reflection within the data limits
image
But maybe these aren't used and GSAS is using the correct Pawley reflections added and we're just loading the wrong file into mantid?

@RichardWaiteSTFC
Copy link
Contributor Author

RichardWaiteSTFC commented Apr 9, 2024

In course of investigating #37109 - I found that GSAS-II does only fit the reflections provided (i.e. respecting the dmin setting in the interface) but returns all the reflections in the data limits in the _reflections_ file - it could be that when we read these we only plot those actually fitted. Also the code reads the reflection file twice - once to fill a table, and again to plot the peak ticks - this should be addressed at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Diffraction Issues and pull requests related to diffraction ISIS Team: Diffraction Issue and pull requests managed by the Diffraction subteam at ISIS
Projects
Status: No status
Status: Todo
Development

No branches or pull requests

2 participants