Repository navigation
Place window-averaged samples at their window centers - #478
Merged
Merged
Conversation
ECCO4Monthly and EN4Monthly files hold a calendar-month mean and carry that window's center in their own `time` variable, while `all_dates` names them by the first of the month. `native_times` used the naming date as the FieldTimeSeries node time, so every sample interpolated about 15 days before the time it describes. Add `sample_window` and `time_window_offset`, applied by `native_times`, and declare a one-month window for both datasets. The default window is zero-width, so instantaneous products are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
simone-silvestri
approved these changes
Jul 29, 2026
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
Co-authored-by: Simone Silvestri <silvestri.simone0@gmail.com>
`sample_window` becomes the single dataset hook: `window_center`, `time_window_offset`, `sample_window_span` and `uncovered_time_gaps` derive from it. It is declared for every monthly-mean product and for ERA5's hourly accumulations and mean rates, which cover the hour ending at the stamp. A cyclical series now repeats over the span its windows tile rather than the node spacing, and `FieldTimeSeries` warns under `Cyclical` and throws under `Linear` when the ends of the series can only be extrapolated. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Renamed 'Linear' to 'LinearTimeIndexing' to avoid shadowing.
Updated the wording for clarity in the documentation regarding time indexing operations.
xkykai
marked this pull request as ready for review
August 10, 2026 09:37
simone-silvestri
approved these changes
Aug 13, 2026
This was referenced Aug 17, 2026
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.
Fixes #477.
ECCO4MonthlyandEN4Monthlyfiles hold a calendar-month mean and carry that window's center in their owntimevariable, whileall_datesnames them by the first of the month.native_timesused the naming date as theFieldTimeSeriesnode time, so an EN4 series asked for 1 July returned July's mean, 3 K too warm at 40°N 60°W where the files' own dates give 296.79 K.sample_window(metadatum)— the(start, stop)dates of the window a value represents, and the only thing a dataset declares. Zero-width by default, so instantaneous products are unchanged.window_center,time_window_offset,sample_window_spananduncovered_time_gapsderive from it, andnative_timesplaces each node at its window center.FieldTimeSerieswarns underCyclical— which fills the ends by wrapping — and throws underLinear, which extrapolates without bound past the last node.Clamp, instantaneous products and single samples are untouched.all_datesstill returns the first of the month: it is the file key, and the centers are not aMonth(1)range (16 June 00:00 to 16 July 12:00 is 30.5 days).Not covered here: the coupled atmosphere applies one time interpolator, built from
u.times, to the precipitation fluxes as well, so ERA5's shifted rain nodes have no effect there (radiation interpolates on its own axis and does pick them up); and the daily products (ECCO2Daily,AVISODaily,GLORYSDaily) need theirtime_bndschecked before a window is declared.#424 adds the same functions for MODIS composites; whichever lands first, the other drops its copy.