Skip to content

mcdisplay-webgl(-classic): --simbins for the monitor data binning - #3160

Merged
willend merged 1 commit into
mainfrom
mcdisplay-simbins
Nov 21, 2026
Merged

willend merged 1 commit into
mainfrom
mcdisplay-simbins

Conversation

@willend

@willend willend commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Free-form text area

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

Follow-up to #3155: the binning of the --simdir monitor data in mcdisplay-webgl and mcdisplay-webgl-classic (McStas and McXtrace) is now set with --simbins N: at most N x N (2D) or 4N (1D) bins, by averaging neighbouring bins. The default 256 keeps the earlier behaviour (256 x 256 / 1024); output files are untouched.

  • read_simdir(dirname, nbins=256); mctest keeps the default.
  • --simdir is read in main, after all options are parsed, so the order of --simdir and --simbins does not matter. Also applies when adding data to an existing display.
  • Help text and mcdisplay.md: the display grows as N^2 (~16 bytes/bin), a large N may exceed the browser's texture size.

Example:

mcdisplay-webgl-classic PSI_DMC.instr --simdir sim --simbins 512 -y

Declaration of use of AI-tools

  • Please add a checkmark here if you used AI-tools during the work for this contribution
  • Further, please describe how / where and for what the tools were used: Claude Code (Claude Opus 5.5) wrote the code and ran the tests below, under my direction and review.
  • AI-assisted commits must carry a Co-Authored-By line naming the tool, see CONTRIBUTING.md

Development OS / boundary conditions

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

macOS (arm64), mccode-dev conda env. No new dependencies. With a 2000x1500 PSD + 5000-bin L_monitor:

  • Classic, existing display: default 250x250 / 1000 (as before, 480 kB), --simbins 64: 63x63 / 250 (40 kB), --simbins 1000: 750x1000 / 2500 (4.9 MB).
  • webgl: instrument run with --simbins 64 (63x63 / 250), and an existing display with the default (250x250 / 1000).
  • --help in both viewers shows the option.

Not tested: the large displays in a browser, Linux, Windows.


PR Checklist for contributing to McStas/McXtrace

  • My contribution contains something else

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

🤖 Generated with Claude Code

--simdir data is shown with at most N x N (2D) or 4N (1D) bins, default 256 as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@willend
willend merged commit b031c49 into main Nov 21, 2026
25 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.

1 participant