Time offset fix - #43
Merged
Merged
Conversation
A site the radar never sampled comes back from Py-ART as an all-NaN column. column_vertical_profile averages an empty set of rays, so time_offset -- the mean gate time -- is NaN right along with every field. subset_points purged every all-NaN variable and took time_offset with it, then raised KeyError: 'time_offset' three lines later at the gate_time calculation. np.isnan returns True for NaT, so the check fired on the time columns as readily as on the float ones. The whole scan was lost, and every co-located site in it, not just the one out of coverage. time_offset is bookkeeping, not a measurement. It is now exempt from the purge and from the dropna height mask, so an out-of-coverage column comes back whole with time_offset and gate_time as NaT -- missing, which is true. The dropna exemption also fixes a second, quieter loss: a partly-NaN time_offset stayed in the dataset and helped decide which heights survived, discarding gates the radar had genuinely sampled. Two more in the same block: - da.drop(v) -> da.drop_vars(v). The former is deprecated and emitted a FutureWarning on every all-NaN field. - Guard the time_offset.drop_duplicates call in the InvalidIndexError handler behind the RHI check. time_offset is only bound in the RHI branch, so a non-RHI column with duplicate heights hit NameError, or silently reused the previous site's offsets. This predates the pluvio accumulation fix and is independent of it; the all-NaN purge came in with d837757 (ADD: XSAPR). Scans dropped to this KeyError were skipped rather than corrupted, so no written output needs revisiting on its account. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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.
Fix time_offset from being dropped from the 90 degree PPI retrieval.