-
-
Notifications
You must be signed in to change notification settings - Fork 47
[WIP] Tweaks to auto exposure and sqm #370
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
Open
mrosseel
wants to merge
16
commits into
brickbots:main
Choose a base branch
from
mrosseel:test-upstream
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
The histogram zero-star handler was using a hardcoded saturation threshold of 250 ADU, which only works for 8-bit images (0-255). For 16-bit images (0-65535), this incorrectly flagged nearly all pixels as saturated. Changes: - Detect image bit depth by checking max pixel value - Use 64000 threshold for 16-bit images (98% of 65535) - Use 250 threshold for 8-bit images (98% of 255) - Add saturation_threshold to metrics for debugging This fixes histogram analysis when processing 16-bit raw sensor data, though currently auto exposure only receives 8-bit processed images. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Enhanced the SQM view to show additional diagnostic information: - Current camera exposure time (top right): "400ms" or "0.4s" - 8-bit processed SQM value (right side, labeled "8bit") - 16-bit raw sensor SQM value (left side, labeled "16bit") when available The 8-bit and 16-bit values are positioned to not overlap, with the 8-bit value keeping its original position from when it was labeled "raw". This helps users understand: - Which exposure time is being used for SQM measurements - Differences between 8-bit processed and 16-bit raw SQM calculations - Whether the camera is using optimal exposure for SNR 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replaced static constellation display in title bar with animated rotating wheel that alternates between showing: - Constellation name (e.g., "Orion") - SQM value with 1 decimal place (e.g., "21.5") Changes to UIModule base class (affects all views): - Added wheel animation state tracking - Implemented _update_wheel_state() for rotation timing - Implemented _get_wheel_content() to fetch constellation and SQM - Added _draw_titlebar_rotating_info() for title bar display - Added draw_rotating_info() for optional main content area display The wheel rotates every 3 seconds with smooth fade transitions in the title bar. Individual views can also call draw_rotating_info() for a full slide-up animation in the main content area. This replaces the static constellation that was only visible when the title was short (<9 chars), now all views show this dynamic information display. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Scale centroids from 512x512 to raw image size (e.g., 1088x1088) - Scale aperture radii proportionally - Use actual image dimensions for arcsec/pixel calculation instead of hardcoded 512x512 - Add logging to debug remaining discrepancy between 8-bit and 16-bit SQM
- Replace slide-up wheel animation with simple cross-fade - Quick transition (~7 frames at 30fps) so values are visible most of the time - Fade out old value, fade in new value with overlapping alpha blend - Rename wheel_* variables to rotating_* for clarity
- First half: fade out old value (64→0) - Second half: fade in new value (0→64) - No overlapping - clean transition
- 8-bit processed image matches real SQM meters (ISP-calibrated) - 16-bit raw required separate calibration (mzero offset issue) - Simplified to single pipeline using processed images - Removed: sqm_calculator_raw, raw scaling, raw UI display - Function renamed: update_sqm_dual_pipeline → update_sqm_single_pipeline
Implements ExposureSNRController that targets background SNR instead of star count. This provides more stable exposures (0.4-1.0s) compared to PID controller which can drop to 0.1s for dim skies. Key features: - Maintains minimum 0.4s exposure for good photon statistics - Targets 15-100 ADU background range using 10th percentile - Gentle 1.3x (30%) adjustment steps for stability - 5 second update interval to prevent rapid changes Will be used in SQM view to ensure consistent long exposures for accurate sky brightness measurements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds command to switch between PID and SNR auto-exposure modes: - Camera interface now supports "set_ae_mode:pid" and "set_ae_mode:snr" commands - Auto-exposure controller selection based on _auto_exposure_mode flag - SQM view now switches to SNR mode on activate (for stable 0.4-1.0s exposures) - SQM view switches back to PID mode on deactivate (for general observing) This ensures SQM measurements get consistent long exposures for accurate sky brightness readings, while other screens still use the responsive PID controller optimized for star tracking. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The animation was backwards for the gray title bar background: - Was: fade out 64→0 (gray to black = MORE visible) - Now: fade out 0→64 (black to gray = invisible) - Was: fade in 0→64 (black to gray = LESS visible) - Now: fade in 64→0 (gray to black = visible) Fade now correctly goes from visible (black text on gray) to invisible (gray text on gray) and back. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
No description provided.