NRT Rrs estimate and sun elevation display - #3
Open
belasi01 wants to merge 7 commits into
Open
Conversation
Expose runner.sun_elevation (already computed for the auto-pilot threshold) next to Ship Heading, using the same freshness guard as the other NRT sidebar fields. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Display rho_sky*Li instead of raw Li in the spectrum plot so Lt and Li fall in comparable orders of magnitude, a first step toward an on-the-fly Rrs estimate. rho_sky defaults to the Fresnel reflectance (0.023, Mobley 1999) and is configurable via [Rrs] rho_sky in pysas_cfg.ini; this is a rough NRT approximation, not the precise glint correction HyperCP computes in post-processing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
New spectral plot next to the timeseries graph showing Lt, rho_sky*Li, and Ed together, mirroring the HyperSAS Spectrum callback pattern (same cache/freshness logic, same Es-source duality). This is a visual preparation step for an on-the-fly Rrs estimate; the Rrs ratio itself (and the wavelength-grid interpolation it needs, since Lt/Li/Es grids aren't guaranteed to match) is left for a follow-up change. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
set_dispatcher only recognized SATHPL/SATPLD headers for Lt, so Li
frames from that HyperOCR variant fell through to the else branch and
were silently dropped. Add the matching Li/Li_dark branches.
Also fix set_wavelengths: the fallback branches for missing Lt/Li
frame headers both assigned float('nan') to self.Es_wavelength
instead of self.Lt_wavelength/self.Li_wavelength respectively
(copy-paste bug), leaving stale or wrong wavelength arrays.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ntities ρ and · did not render in Plotly trace names/titles on the live pySAS006 (showed up as literal text), while μ and <sup>/<sub> tags in the pre-existing labels rendered fine. Use literal ρ/· unicode characters instead of HTML entities to sidestep Plotly's entity whitelist. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace the preparatory Lt/rho_sky*Li/Ed comparison graph with the actual Rrs = (Lt - rho_sky*Li) / Ed estimate, since displaying it next to the near-identical HyperSAS Spectrum plot was redundant. Li and Ed are interpolated onto the Lt wavelength grid via numpy.interp since the three channels' wavelength grids are not guaranteed to match. Division by near-zero Ed (e.g. at low sun elevation) is silenced with np.errstate rather than spamming logs; this remains a rough NRT approximation, not the HyperCP-grade Rrs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 20s DATA_EXPIRED_DELAY guard hid the sidebar's sun elevation after the runner enters auto-mode sleep (which only refreshes sun position every ASLEEP_INTERRUPT = 120s while below threshold), even though the last computed value was still meaningful. Show the value whenever it has ever been computed (isnan guard only), and display the configured min_sun_elevation threshold alongside it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Field-tested additions to the web UI's near-real-time display, developed while operating pySAS006 during the 2026 season:
SATHPL/SATPLDLi frame headers weren't recognized (only handled for Lt), so Li was silently dropped for that HyperOCR variant. Also fixes a copy-paste bug where the Lt/Li wavelength fallback both wrote toEs_wavelength.rho_sky(Fresnel reflectance, default 0.023) in the HyperSAS Spectrum plot, so Lt and rho_sky*Li fall in comparable orders of magnitude.Test plan
🤖 Generated with Claude Code