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

Support changes to polarization correction inputs in the ISIS Reflectometry GUI and ReflectometryISISLoadAndProcess #37617

Closed
rbauststfc opened this issue Jun 27, 2024 · 0 comments · Fixed by #38783
Assignees
Labels
ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS Reflectometry Issues and pull requests related to reflectometry
Milestone

Comments

@rbauststfc
Copy link
Contributor

rbauststfc commented Jun 27, 2024

Under issues #35067 and #36981 we amended the PolarizationCorrectionWildes and PolarizationCorrectionFredrikze algorithms to allow different input flipper and output spin state orders. We now need to extend the ISIS Reflectometry GUI to support these new options. This is particularly important for PA experiments on POLREF, as the default input flipper configuration for PolarizationCorrectionWildes and the default input spin state order for PolarizationCorrectionFredrikze do not match the child workspace order for POLREF PA datasets, so we need to be able to specify this via the GUI.

Key assumptions and considerations:

  • The flipper configuration of an instrument (relevant for Wildes algorithm) will change very infrequently, usually only as part of an instrument upgrade. As a result, this setting would be suitable to store in the instrument parameter file.
  • The input spin state (relevant for Fredrikze algorithm) can change per experiment, and potentially (although less likely) per measurement. This is because POLREF have three types of analyser (transmitting, reflecting and off-specular) and they switch these out fairly regularly. The type of analyser determines whether spin up or spin down neutrons are counted, thus changing the spin state associated with the analysing flipper being on or off.
  • Even where spin states have changed per measurement, there will still be batches of runs within an experiment that use the same input spin state. This means GUI users will be able to reduce their experiment in batches when different input spin states have been used, rather than needing to set spin states on a per-run basis.
  • Changing the output spin state order can be useful for loading into different analysis software, however we expect that GUI users would only need to be able to do this in edge case scenarios. In addition, the spin state will be identified if the reduced data is saved out using the ORSO format, so hopefully that will help as adoption of that standard grows. As a result, we have agreed with our scientists that we won’t support changing the output spin state order via the GUI - people can instead re-order their workspace group via a script if required. This could be revisited in future if it became clear that there was a need for it.

Suggested solution:

Based on the above, we have agreed the following changes with our scientists:

For Wildes flipper configuration
Add the Wildes flipper configuration to the parameter file as follows:

  <parameter name="wildes_flipper_config" type="string">
    <value val="00,01,10,11" />
  </parameter>

We would then look this up from the relevant place within ReflectometryReductionOneAuto3.

For Fredrikze spin states

Add an additional input on the Experiment Settings tab of the GUI to allow people to provide an input spin state when using the Fredrikze algorithm (see Polarization Correction Fredrikze Input SpinState in screenshot below). The Fredrikze algorithm is expected to be used infrequently. The new input will need to be supported with a sufficiently detailed tooltip to explain what it is for/when it should be used and how to use it. The tooltip is particularly important because the GUI automatically detects which correction algorithm to apply (e.g. from the labels on the efficiency workspace) so a tooltip will be needed to avoid confusion over when this new optional input would be used. We should also ensure that there is enough validation to help users to use the input correctly and under the right circumstances (i.e. only if doing a Fredrikze correction). The input spin state would be applied to all runs that were reduced as part of that batch.

Picture1

The new input should enable and disable according to the same logic that the existing polarization correction input fields do.

At the algorithm level, we would need to add a new property to ReflectometryISISLoadAndProcess to receive this setting.

Note that there are several different ways you could approach implementing this in the GUI, but we agreed with our scientists to go with this approach first because it should be straight-forward to implement. Depending on feedback once it starts to be used, the GUI layout could always be changed in future to improve usability, if necessary. We also discussed that if any further polarization settings were required in future then it might be worth creating a separate Polarization tab to hold everything, but again that would be something to address at a later time.

This is part of the Polarised Reflectivity epic.

@rbauststfc rbauststfc added Reflectometry Issues and pull requests related to reflectometry ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS labels Jun 27, 2024
@rbauststfc rbauststfc added this to the Release 6.11 milestone Jun 27, 2024
@rbauststfc rbauststfc moved this from New to Backlog in ISIS LSS Sprint Planning Jun 27, 2024
@rbauststfc rbauststfc added the Awaiting User Response Waiting on input or testing from a third party label Jul 3, 2024
@rbauststfc rbauststfc moved this from Backlog to Icebox in ISIS LSS Sprint Planning Jul 11, 2024
@rbauststfc rbauststfc modified the milestones: Release 6.11, Release 6.12 Sep 13, 2024
@rbauststfc rbauststfc self-assigned this Dec 13, 2024
@rbauststfc rbauststfc moved this from Icebox to Backlog in ISIS LSS Sprint Planning Dec 13, 2024
@rbauststfc rbauststfc moved this from Backlog to In Progress in ISIS LSS Sprint Planning Dec 19, 2024
@rbauststfc rbauststfc moved this from ToDo MVP to Gathering Requirements in ISIS Polarised Reflectivity epic Jan 6, 2025
@rbauststfc rbauststfc moved this from Gathering Requirements to Ready for Development in ISIS Polarised Reflectivity epic Jan 7, 2025
@rbauststfc rbauststfc removed their assignment Jan 7, 2025
@rbauststfc rbauststfc removed the Awaiting User Response Waiting on input or testing from a third party label Jan 7, 2025
@rbauststfc rbauststfc moved this from In Progress to Backlog in ISIS LSS Sprint Planning Jan 7, 2025
@rbauststfc rbauststfc modified the milestones: Release 6.12, Release 6.13 Jan 7, 2025
@cailafinn cailafinn moved this from Backlog to In Progress in ISIS LSS Sprint Planning Jan 17, 2025
@rbauststfc rbauststfc moved this from Ready for Development to In Progress in ISIS Polarised Reflectivity epic Jan 20, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
This is needed for batch saving/loading and for project recovery.

RE mantidproject#37617
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 4, 2025
This is needed for batch saving/loading and for project recovery.

RE mantidproject#37617
@cailafinn cailafinn moved this from In Progress to In Review in ISIS Polarised Reflectivity epic Feb 4, 2025
@cailafinn cailafinn moved this from In Progress to Review in ISIS LSS Sprint Planning Feb 4, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
Uses a SpinStateValidator to match the validator in
PolarizationCorrectionWildes. This additionally fixes a problem where
not including spaces when providing spin states would result in an
error.

RE mantidproject#37617
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
This is needed for batch saving/loading and for project recovery.

RE mantidproject#37617
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 13, 2025
Uses a SpinStateValidator to match the validator in
PolarizationCorrectionWildes. This additionally fixes a problem where
not including spaces when providing spin states would result in an
error.

RE mantidproject#37617
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 14, 2025
Uses a SpinStateValidator to match the validator in
PolarizationCorrectionWildes. This additionally fixes a problem where
not including spaces when providing spin states would result in an
error.

RE mantidproject#37617
MialLewis pushed a commit that referenced this issue Feb 20, 2025
…r File (#38783)

* Return spin states from parameter file for Wildes

RE #37617

* Add fredrikze spin state line-edit to gui

RE #37617

* Add getters and setters to view

RE #37617

* Implement input disabling logic

RE #37617

* Add spin state order to Pol Corr model

RE #37617

* Update model from presenter

RE #37617

* Validate Fredrikze spinstate order at alg level

RE #37617

* Add documentation

RE #37617

* Include new field in encoder and decoder

This is needed for batch saving/loading and for project recovery.

RE #37617

* Use std::optional where appropriate

RE #37617

* Use a  SpinStateValidator for passing to Wildes

Uses a SpinStateValidator to match the validator in
PolarizationCorrectionWildes. This additionally fixes a problem where
not including spaces when providing spin states would result in an
error.

RE #37617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS Reflectometry Issues and pull requests related to reflectometry
Projects
Status: Review
Development

Successfully merging a pull request may close this issue.

2 participants