Repository navigation
mcdisplay-webgl(-classic): --simdir shows monitor data on the monitors - #3155
Merged
Merged
Conversation
Reads the 1D/2D monitor data of a simulation output directory and paints it on the monitors: a colour map (or a 1D curve) on flat monitors, a colour map on cylinder, banana and sphere monitors. Translucent like the other surfaces, with "Monitor data" and "curved" toggles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- log toggle in both viewers, recolouring in the browser - maps shrunk to at most 256x256 (1D: 1024) bins, to keep displays small - NeXus output (mccode.h5) read too - mctest adds the monitor data of test 1 to the instrument display; loader messages only with --verbose Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test displays - mcdisplay-webgl(-classic): show/hide 1D and 2D monitor data separately - 1D data on curved monitors as a curve along the angle, not a colour band - 1D curves upright on monitors turned upside down in the instrument - mctest: mcdisplay with -n1e3 (-n0 with --openacc) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The controls no longer fit one line, e.g. with rays shown: the bar wraps onto more lines and the 3D view starts below two of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-n above 1000 is lowered to 1000, with a message. The trace reader keeps up to 1e5 rays (was 1000), room for SPLIT giving several rays per particle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
Test video
The above are done with a patched cogen with a fix for the SPLIT-'return-artefac', see incoming PR |
A display directory from an earlier run in place of the instrument: the --simdir monitor data is added to it and it is shown, with no simulation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mcdisplay: -n cap, --campath, --simdir and display directories, monitor data, -t for pyqtgraph. mctest: display with rays and monitor data, -j/--jobs, --nohtml, --verbose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Free-form text area
Please describe what your PR is adding in terms of features or bugfixes:
Adds
--simdir DIRto mcdisplay-webgl and mcdisplay-webgl-classic (McStas and McXtrace): the 1D/2D monitor data of a finished simulation is shown on the monitors in the 3D view. Also: monitor data and rays in the mctest displays, a cap on-nwith room for SPLIT rays, a wrapping webgl top bar, and updated tool pages.Monitor data (
--simdir)mccodelib.mcplotloader:mccode.sim, else NeXusmccode.h5(first entry = first scan point); matched to components by name. Neither file: message andexit(-1).PSDcyl_monitor,Monitor_nDbanana/sphere,PSD_monitor_4PI): 2D data as a colour map, 1D data (e.g. a theta banana) as a curve along the angle. Radius from the monitor's drawing; recognised by the axis labels (Longitude / radial position / Latitude).Detector,ROTATED (0, 0, 180)); 2D maps stay as placed.--log).--nobrowse: only add). A display from the other webgl viewer gives a warning.mctest
display/, which the mctest report already links to. Only test 1, whose parameters the display was made with; errors are logged and do not affect the test result. Loader messages only with--verbose.-n1e3, so the displays include rays (-n0with--openacc).Rays
-nabove 1000 particles to 1000, with a message. The trace reader keeps up to 1e5 rays (was 1000), room for SPLIT giving several rays per particle (the SPLIT trace change incogen.c.inis not in this PR).mcdisplay-webgl top bar
dist/bundle is rebuilt.Docs
mcdisplay.mdandmctest.mdbrought in sync:-ncap,--campath,--simdirand display directories, monitor data,-tfor pyqtgraph; mctest display with rays and monitor data,-j/--jobs,--nohtml,--verbose.Example:
Declaration of use of AI-tools
Co-Authored-Byline naming the tool, see CONTRIBUTING.mdDevelopment 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. Tested with 1e6–1e7 runs:
Monitor data
(nr-1)binning).detector.dat; strongest bin (71.8°) lands at 71.6° on the banana; upright from the sample in both viewers.--simdiron BNL_H8, classic and webgl (--nobrowse): 0 → 9 monitors with data; a display from the other viewer: warning, data added; no--simdir, or a directory that is not a display: message and exit -1; an instrument run with--simdirunchanged.mctest
--nexus: all tests pass, displays get the monitor data, no loader messages without--verbose. BNL_H8 again after the later changes: display has 1000 rays and the monitor data.Rays and top bar
-n5000on BNL_H8: lowered to 1000 with the message. PSI_DMC with the coming SPLIT trace change:-n1000gives 25 564 rays, all kept and played in the classic viewer (16.5 MB).Not tested on Linux or Windows. Not tested: mctest with a scan as test 1,
--verboseoutput, mctest-j> 1 with this step,--openaccdisplays, opening/serving an existing display (browser launch, webgl server).PR Checklist for contributing to McStas/McXtrace
My contribution contains something else
🤖 Generated with Claude Code