Time Utilities
Calendars
Water-year and calendar-year reindexing for cftime-aware datasets.
- elm_diagnostics.time.calendars.water_year(time_val, start_month=10)[source]
Compute the water year for a given time value.
A water year starting in October means that Oct 2014 - Sep 2015 is water year 2015.
- elm_diagnostics.time.calendars.add_water_year_coord(ds, start_month=10, dim='time')[source]
Add a
water_yearcoordinate to a dataset.
- elm_diagnostics.time.calendars.select_year(ds, year, frame='calendar', start_month=10, dim='time')[source]
Select a single year from a dataset.
- elm_diagnostics.time.calendars.get_available_years(ds, frame='calendar', start_month=10, dim='time')[source]
Return sorted list of complete years available in the dataset.
Integration
Time-bounds-aware cumulative integration for flux variables.
- elm_diagnostics.time.integration.get_time_deltas(ds, dim='time')[source]
Compute time step widths (in seconds) from time_bounds.
This is non-negotiable: we never assume uniform dt. The actual time_bounds widths are used for flux integration.
- elm_diagnostics.time.integration.cumulative_integral(da, ds, dim='time')[source]
Integrate a flux variable cumulatively over time using time_bounds.