Skip to content

Conversation

@mrosseel
Copy link
Collaborator

No description provided.

mrosseel and others added 15 commits December 26, 2025 21:00
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>
@mrosseel mrosseel changed the title Tweaks to auto exposure and sqm [WIP] Tweaks to auto exposure and sqm Dec 26, 2025
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