Subset Dates consistently within 's2dv_cube' and add 'time_bounds' for period aggregations
Functions to change
-
CST_PeriodMean -
CST_PeriodAccumulation
Development
-
Subset attrsDates with data subset -
Add attribute time_bounds indicating the beggining and the end of the aggregated period interval. It is a list with 2 elements: the start date of the aggregation and the end date. It has the same dimensions as Dates. -
Add check if dates doesn't have dimensions and if not the data is not subset if start and end are NULL. -
Improve documentation with time dimensions in Dates
Development regarding time_bounds
In functions: CST_PeriodMean, CST_PeriodAccumulation, CST_AccumulationExceedingThreshold, CST_TotalSpellTimeExceedingThreshold, CST_TotalTimeExceedingThreshold
- Subset
Datesaccordingly with reduced dimension specified withtime_dimand add addtime_bounds. See lines here. - Updated documentation with the description of the new attribute 'time_bounds' in the output section and update example with using 'start' and 'end' parameters (see here)
- Include in documentation imports
ClimProjDiags::Subset
Development regarding start and end subset
In functions: PeriodMean, PeriodAccumulation, AccumulationExceedingThreshold, TotalSpellTimeExceedingThreshold, TotalTimeExceedingThreshold, QThreshold, Threshold, WindCapacityFactor, WindPowerDensity
- In dates parameter description specify that it must have time dimensions. See here.
- Add check if
dateshas dimensions to useSelectPeriodOnData, if not andendandstartnot NULL, a warning appears. See changes here.
Other changes
- In all CST functions update or add element
res$dims(here). -
Changed default value ofUpdate: this change will be done in a separated branch #35 (closed). The default value will betime_dimtoftimeof some functions.time. - Add unit tests for new features
Edited by Eva Rifà