Implements a comprehensive PyQt5-based GUI application for real-time …#269
Open
lg345 wants to merge 2 commits into263-cleanup-exafs-codefrom
Open
Implements a comprehensive PyQt5-based GUI application for real-time …#269lg345 wants to merge 2 commits into263-cleanup-exafs-codefrom
lg345 wants to merge 2 commits into263-cleanup-exafs-codefrom
Conversation
…visualization and analysis of live detector data from the MFX beamline. Features: - Real-time detector image streaming from PSANA-II data source - Interactive 2D detector image display with histogram-based color scaling - Independent X and Y projection plots with reference trace management - Region of Interest (ROI) support with interactive and spinbox controls - Auto-scale toggle and manual color range adjustment - Multiple reference traces with cycling color scheme for projection comparison - Flexible detector configuration with configurable detector name - ADU threshold filtering with optimization for zero-threshold case - Configurable image accumulation over multiple shots - Real-time status logging with timestamped messages - Detector boundary visualization to show array edges - Comprehensive error handling and bounds checking - Thread-safe data acquisition with worker thread architecture Technical Implementation: - PyQt5 for GUI framework - PyQtGraph for high-performance plotting - NumPy for data processing - Threading for non-blocking data acquisition - Signal-slot architecture for thread-safe GUI updates - ~10 Hz update rate for responsive interface UI Components: - Left control panel: Experiment/run selection, ROI controls, reference management - Right visualization: 2D detector image, Y projection (side), X projection (bottom) - Status messages: Real-time logging with auto-scrolling - Interactive ROI rectangle with drag, resize, and coordinate spinbox controls Configuration Options: - Experiment ID and run number - Detector name for flexible detector selection - Image accumulation count - ADU threshold filtering - PSANA connection timeout - ROI coordinates with bounds validation Documentation: - Comprehensive README with setup instructions - SLAC environment setup requirement documented - Full NumPy-style docstrings for all functions and classes - Usage guide, troubleshooting, and performance tips - Feature request specification (FEATURE_REQUEST.md) Files Added: - MFX_Detector_Viewer.py: Main application - README.md: User documentation and setup guide - FEATURE_REQUEST.md: Detailed feature specifications Resolves #268
fredericpoitevin
approved these changes
Nov 22, 2025
Collaborator
fredericpoitevin
left a comment
There was a problem hiding this comment.
Awesome! It's quite reactive. I gave it a quick shot (see recording) and it was a great experience.
Screen.Recording.2025-11-21.at.4.21.57.PM.mov
| Before running the application, you must source the appropriate environment: | ||
|
|
||
| ```bash | ||
| source /sdf/group/lcls/ds/ana/sw/conda2/rel/lcls2_092225/setup_env.sh |
Collaborator
There was a problem hiding this comment.
I believe the latest env is available if you source /sdf/group/lcls/ds/ana/sw/conda2/manage/bin/psconda.sh. Right now it links symbolically to /sdf/group/lcls/ds/ana/sw/conda2/rel/lcls2_112025/setup_env.sh.
Comment on lines
+37
to
+42
| ## Installation | ||
|
|
||
| ```bash | ||
| pip install PyQt5 pyqtgraph numpy | ||
| ``` | ||
|
|
Collaborator
There was a problem hiding this comment.
I did not need to do that after sourcing psconda.
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.
This PR introduces the MFX Detector Viewer, a PyQt5-based GUI application for real-time visualization and analysis of live detector data from the MFX beamline at SLAC. It is stored in the Visualizations directory. Added readme.md on how to use it. Address es #268