Skip to content

Monitor_nD: support 1D x or y banks in Mantid mode - #2892

Merged
willend merged 2 commits into
mainfrom
2026-10-monnd-mantid-1d-2178
Oct 23, 2026
Merged

willend merged 2 commits into
mainfrom
2026-10-monnd-mantid-1d-2178

Conversation

@willend

@willend willend commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Mantid's LoadMcStas requires 6 event columns (p x y n id t), so a 'mantid square' monitor binned only in x (or y) wrote 5 columns and Mantid silently loaded no events; 'y bins=1' was the workaround.

  • In mantid mode with a square monitor, add the missing x or y coordinate with a single bin spanning the monitor, keeping x before y.
  • MANTID_RECTANGULAR_DET now finds the x, y and pixel coordinates by type instead of assuming positions 1, 2 and 4, so 'y ... x' no longer gives a 90-degree rotated IDF.
  • mcdisplay-mantid: write xstart/ystart as the first pixel centre, as Mantid expects, instead of the bin edge (half-pixel shift, half the detector size in a 1-bin direction).

Fixes #2178

Free-form text area

Please describe what your PR is adding in terms of features or bugfixes:


Declaration of use of AI-tools

  • Please add a checkmark here if you used AI-tools during the work for this contribution
  • Furter, please describe how / where and for what the tools were used:

Development OS / boundary conditions

Please describe what OS you developed and tested your additions on, and if any special dependencies are required:


PR Checklist for contributing to McStas/McXtrace

For a coherent and useful contribution to McStas/McXtrace, please fill in relevant parts of the checklist:

  • My contribution contains something else

    • Explanation is added in free form text above or below the checklist

willend and others added 2 commits October 22, 2026 13:31
Mantid's LoadMcStas requires 6 event columns (p x y n id t), so a
'mantid square' monitor binned only in x (or y) wrote 5 columns and
Mantid silently loaded no events; 'y bins=1' was the workaround.

- In mantid mode with a square monitor, add the missing x or y
  coordinate with a single bin spanning the monitor, keeping x before y.
- MANTID_RECTANGULAR_DET now finds the x, y and pixel coordinates by
  type instead of assuming positions 1, 2 and 4, so 'y ... x' no longer
  gives a 90-degree rotated IDF.
- mcdisplay-mantid: write xstart/ystart as the first pixel centre, as
  Mantid expects, instead of the bin edge (half-pixel shift, half the
  detector size in a 1-bin direction).

Fixes #2178

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@willend
willend merged commit e697bd5 into main Oct 23, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: [FEATURE]: Monititor_nD event lists in Mantid should support 1-d "binning"

1 participant