Repository navigation
Make Tempest the primary source for all current-conditions fields - #12
Merged
Merged
Conversation
_merge_tempest_conditions enriched temperature, feels-like, humidity, wind, wet-bulb, and pressure from the Tempest station but never wrote dew point. Dew point came only from the NWS METAR, so when the METAR omitted it the field showed N/A even though the Tempest observation carried dew_point. Backfill dew point from the normalized Tempest value, labeling it frost_point at and below 0C to match the NWS path, and drop the opposite label so the merged result never carries both.
When a Tempest station is in range it should be the primary source for every field it measures, but several were still NWS-only or dropped. - source wind_gust from Tempest (was NWS-only) and add wind_lull - set observation_time to the Tempest reading time, not the NWS METAR - fix sea-level pressure never computing: station elevation lives under station_meta.elevation, so the top-level lookup always returned None and pressure silently fell back to NWS; pressure_source is now tempest_slp - add hyper-local fields: brightness, wet_bulb_globe_temperature, delta_t (degrees C by convention), precip_last_hour, and last-strike distance (shown only after recent lightning)
The local station-pressure reduction disagreed with the station's own sea_level_pressure by ~1 mb because it uses instantaneous temperature rather than a mean column temperature. Pass through the station's value instead (pressure_source: tempest), and reduce locally only when the station supplies no SLP (pressure_source: tempest_slp).
When a METAR reports no seaLevelPressure the code fell back to barometricPressure, which is absolute station pressure, but still labeled pressure_source "sea_level". Label that fallback "station" so station pressure is not presented as a sea-level value.
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.
Tempest is meant to be the primary source for every field it measures, but several conditions fields were still NWS-only, silently dropped, or wrong. The worst was sea-level pressure, which never computed at all. Station elevation lives under
station_meta.elevationand we were reading the absent top-level key, sopressure_sourcequietly stayedsea_level.This makes Tempest primary for dew point, wind gust, pressure, and observation time, and surfaces the fields it measures that we never showed (wind lull, brightness, WBGT, delta-T, last-hour precip, last-strike distance).
For pressure we now pass through the station's own
sea_level_pressureinstead of reducing station pressure ourselves. The local reduction was off by ~1 mb because it uses the instantaneous temperature rather than a mean column temperature, so it is now only a fallback for when the station gives no SLP.