feat!: available forecast window is now dependent the current hour (instead of 12 AM of the day) and implemented quantitive changes to let the OpenMeteo forecast and reflect the amount of sunshine that passes through clouds - #92
Merged
Conversation
…how much sun gets through The forecast request asked for seven calendar days from local midnight, so a launch at 22:00 had spent most of its first day already and could scrub six days ahead. It now asks for 24 hours back and 168 forward from the current hour, with unix timestamps, which also removes the local wall-clock string parsing and its error path. Three hand-derived quantities are replaced by fields the model already computes. The analytic sky's weight was (1 - cover), which switched the physical model off under any cloud, a cirrus veil included; it is now the direct beam over Meinel's clear-sky beam, and the same number dims the sun disc and its glow, so a sun behind a deck is a faint patch rather than a disc painted over the cloud. Turbidity came from visibility, which most models cap at 24 km and which therefore sat at 2 on most days; it now comes from CAMS aerosol optical depth through Preetham's own beta relation, fetched beside the forecast and falling back to visibility when that request fails or past its five-day horizon. Storm intensity was rain rate; it is CAPE when present. Rain, showers and snowfall are read separately, so a sleet hour draws both renderers, freezing rain draws rain, and any showers make the low deck cumulonimbus. Precipitation probability scales what is drawn, with a floor so light certain rain still shows. Fog, from the code or from saturation with under a kilometre of visibility, becomes a full-frame veil, pulls the gradient toward a fog palette by daylight, and hides the stars. The README credits Open-Meteo and GeoNames as their licence asks. BREAKING CHANGE: HourlyArrays.time and DailyArrays.time, sunrise and sunset are i64 unix seconds instead of local ISO strings; HourlyArrays gains rain, showers, precipitation_probability, cape, direct_normal_irradiance_instant and aerosol_optical_depth; Sun gains strength; compose_at no longer fails on a timestamp it cannot parse.
Contributor
Merging this PR will improve performance by 52.95%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | at_far |
212 µs | 73.9 µs | ×2.9 |
| ⚡ | Simulation | at_near |
82.5 µs | 73.1 µs | +12.91% |
| ⚡ | Simulation | timeline_168h |
5.1 ms | 4.6 ms | +10.52% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing weather-intake (6aba832) with main (f546234)
Footnotes
-
10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Merged
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.
What changed
Request window.
forecast_hours=168&past_hours=24&timeformat=unixtimereplacesforecast_days=7. The old window started at local midnight, so an evening launch had already spent most of its first day and could scrub six days ahead; the new one is 24 hours back and 168 forward from now, and--at -6hlands inside it. Timestamps are unix seconds, so the local-string parse and its Decode path are gone.Sun through cloud. The analytic sky's weight was
(1 - cover), which switched the physical model off under any cloud, a cirrus veil included. It is now the model'sdirect_normal_irradiance_instantover Meinel's clear-sky beam at that elevation, and the same number isSun.strength, which scales the disc and its glow. This closes the "known compromise in the analytic blend" note.Turbidity from aerosol optical depth. New
weather::aerosolfetches CAMS AOD at 550 nm beside the forecast (scoped thread, same latency);Atmosphere::from_readingsmaps it through Preetham's beta relation and falls back to visibility when the request fails or past the five-day horizon. Visibility still drives the near-ground haze.Precipitation.
rain,showersandsnowfallare read separately: sleet draws both renderers, freezing rain draws rain, any showers make the low deck cumulonimbus.precipitation_probabilityscales what is drawn (floor 0.3). Storm intensity iscape / 2500when CAPE is present.Fog. Code 45/48, or humidity >= 97% with visibility under 1 km, becomes a full-frame veil (the fog draft's haze, darkened at night), pulls the gradient toward a new
Palette::Fogby daylight, and hides stars and meteors.README credits Open-Meteo (CC BY 4.0) and GeoNames, as their licence asks.
Not in this change
minutely_15=lightning_potentialis regional and needs a second time axis. No--modelflag and no previous-runs request; forecast confidence is expressed through precipitation probability only.Release
Breaking on the public API (
HourlyArrays.timeand the daily timestamps arei64,HourlyArraysandSungain fields), so this is 0.8.0. cargo-semver-checks reports the added fields; the type change it cannot see is named in theBREAKING CHANGEtrailer. Goldens are unchanged: no scene carries an analytic sky andSun.strengthdefaults to 1.0, so the render is bit-identical there.Verification
just ciandjust policygreen locally; 210 tests. Live:--plainnow,--at -6h,--at -23h,--at +7d,--at +167h,--frameall return the expected sky.