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

Algorithm required for calculating transmission of the analyser #36383

Closed
10 of 11 tasks
rbauststfc opened this issue Nov 8, 2023 · 1 comment · Fixed by #36939
Closed
10 of 11 tasks

Algorithm required for calculating transmission of the analyser #36383

rbauststfc opened this issue Nov 8, 2023 · 1 comment · Fixed by #36939
Assignees
Labels
ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS SANS Issues and pull requests related to SANS
Milestone

Comments

@rbauststfc
Copy link
Contributor

rbauststfc commented Nov 8, 2023

An algorithm is required to calculate the depolarised transmission of the helium gas in the analyser. The algorithm will take two calibration runs (with four periods each) and use these to calculate the opacity as a function of wavelength. The output of this algorithm is intended to be passed to #36140 for calculating the polarised efficiency of the analyser.

The algorithm will make use of relevant hyperbolic functions that will be created under #36137.

This is required for the Polarised SANS reduction at ISIS.

Context:

  • At the end of an He3 cell’s life, the depolarised transmission though it needs to be calculated.
  • To do this, it is completely depolarised, and two calibration runs/workspaces are created:
    • One with the depolarised helium in the cell (referred to in the meeting as “dep”)
    • One with an empty cell containing nothing (referred to as “MT”)
  • The pair of runs are created for each cell used.
  • The input may contain 1, 2, or 4 periods. The signs (++, +-, -+, --) refer to the polarisation direction of the [polariser and flipper], and the [analyser] respectively. Which is which must be determined by looking at the SPIN_FLIPPER sample log and the Intensity, as there is no way to store the polarisation direction of the analyser. Cross polarisation (+-, -+) will result in a strong drop in intensity (beyond a certain wavelength (~3.5 Angstroms)).

Monitor setup

  • |P| |F| 3 |Sam| 6 |He3| 4 5|Det|
    • M3 is in the correct position
    • M4 is optional, and may be removed. It may also need moving.
    • M5 is in the middle of the detector, and is useless if M4 is in place.
    • M6 is not currently present, and is part of future development work.
  • Monitors (1-5) follow the workspace positions, (M1 = WSIndex 0, etc.)
  • Monitor 4 is normalised by monitor 3 to account for changes in the incoming beam.

Calculation:

Current Script:

  • There are a couple of MoveComponent operations required due to the movement of monitors. This will not be needed for the final data as the monitors will be in the correct positions.

New Implementation:

  • Polarisation information needs to be determined. (I.e. which of the workspaces is each polarisation orientation)
  • M4 needs to be normalised by M3 to account for changes in the incident beam.
  • The algorithm should take these two runs and produce a workspace of wavelength against transmission.
  • This is done by:
    • Dividing the “dep” workspace by the “MT” workspace.
    • When depolarized, pHe = 0 therefore T(λ) = T_E(λ) * exp(-μ).
    • We can then perform a fit to obtain T_E and p * d where μ = 0.0733 * p * d * λ.
      • The 0.0733 is a factor to allow the conversion between wavelength (λ) and the absorption cross-section.

Technical Decisions to Make

  • C++ vs Python
    • C++ is better suited to dealing with workspace groups (which is likely how the different periods will be handled) and is faster, so is probably the choice we're going to go with.
  • Input workspaces from the examples seem to contain 8 spectra. Which of these are important?

Workflow Steps

  • Input: Two workspaces,
    • dep (depolarised)
    • mt (empty cell)
    • Input Validation of these workspaces
      • Wavelength, single spectra. Both have the same number of bins and bin width.
  • Divide (see above)
  • Fit UserFunction1D (Formula=T_E * exp(-0.0733 * pxd * x) (As the workspace x values are wavelength (λ))
    • Starting values te=0.9 pxd=12.6
  • Output:
    • Fit params: p * d (pxd), T_E (transmission of empty cell)
@rbauststfc rbauststfc added SANS Issues and pull requests related to SANS ISIS Team: LSS Issue and pull requests managed by the LSS subteam at ISIS labels Nov 8, 2023
@rbauststfc rbauststfc moved this from New to Backlog in ISIS LSS Sprint Planning Nov 8, 2023
@cailafinn cailafinn moved this from To Do MVP to Gathering Requirements in ISIS Polarised SANS Reduction Jan 23, 2024
@cailafinn cailafinn self-assigned this Feb 13, 2024
@cailafinn cailafinn moved this from Gathering Requirements to Ready for Development in ISIS Polarised SANS Reduction Feb 13, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 14, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 14, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 15, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 15, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 15, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 15, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 15, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 15, 2024
@rbauststfc rbauststfc moved this from Backlog to In Progress in ISIS LSS Sprint Planning Feb 16, 2024
@rbauststfc rbauststfc added this to the Release 6.10 milestone Feb 16, 2024
@cailafinn cailafinn moved this from Ready for Development to In Progress in ISIS Polarised SANS Reduction Feb 20, 2024
@jclarkeSTFC
Copy link
Contributor

The analyser they installed this afternoon had a length of 5 cm and a pressure of 850 mBar, could be useful for benchmarking p*d results.

cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 21, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 21, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 21, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Feb 21, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 5, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 6, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 6, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 6, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 6, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 7, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 8, 2024
@cailafinn cailafinn moved this from In Progress to Review in ISIS LSS Sprint Planning Mar 8, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 12, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 12, 2024
We just want to keep consistency with the other algorithms in mantid if
we can.

RE mantidproject#36383
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 12, 2024
Ensure that we're checking monitors, as that's the only expected input.

RE mantidproject#36383
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 13, 2024
Ensure that we're checking monitors, as that's the only expected input.

RE mantidproject#36383
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 13, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 13, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 13, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 14, 2024
Ensure that we're checking monitors, as that's the only expected input.

RE mantidproject#36383
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 14, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 14, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 14, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 26, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Mar 26, 2024
This doesn't work for LARMOR, which uses a summed & masked section of
the main detector to take the place of the post-sample monitor it
doesn't have. Therefore it's not going to have a monitor spectrum.

RE mantidproject#36383
cailafinn added a commit to cailafinn/mantid that referenced this issue Apr 2, 2024
cailafinn added a commit to cailafinn/mantid that referenced this issue Apr 2, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in ISIS Polarised SANS Reduction Apr 4, 2024
@rbauststfc rbauststfc moved this from Done to In Review in ISIS Polarised SANS Reduction Apr 4, 2024
@cailafinn cailafinn moved this from In Developer Review to Scientist Review in ISIS Polarised SANS Reduction Apr 4, 2024
@rbauststfc rbauststfc moved this from Review to Done in ISIS LSS Sprint Planning Apr 8, 2024
@rbauststfc rbauststfc moved this from Scientist Review to Done in ISIS Polarised SANS Reduction Jun 6, 2024
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 SANS Issues and pull requests related to SANS
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants