TimeSamplers Types
This page documents all types defined in TimeSamplers.jl, generated using get_type_docstring from OmniTools.jl.
TimeSampler
TimeSampler
Abstract type for implementing time subset, sampling, resampling, and aggregation types
TimeSampler <: AnyTimeSamplerMethod
TimeSamplerMethod
Abstract type for time sampling / aggregation methods
TimeSamplerMethod <: AnyCore Types
TimeSample
define a type for temporal sampling/aggregation of an array
TimeSamplers.TimeSample Type
TimeSample{I, sampler_func}define a type for temporal sampling/aggregation of an array
Fields:
indices::I: indices to be collected for sampling/aggregationsampler_func::sampler_func: a function to use for sampling/aggregation, defaults to meann_time::Int: the number of time steps in the time axis the indices were built for, which the data must match along the sampled dimension
TimeSample <: TimeSampler <: AnyTimeSampleViewInstance
view of a TimeSample
TimeSamplers.TimeSampleViewInstance Type
TimeSampleViewInstance{T, N, D, P, AV <: TimeSample}Fields:
parent::P: the parent dataagg::AV: a view of the parent datadim::Val{D}: a val instance of the type that stores the dimension to be aggregated on
TimeSamplers.TimeResampler Type
TimeResampler{M, S, C, O}A time sampling method with its samplers built once for a time axis. Build it with TimeResampler(date_vector, period; ...) and apply it to any number of arrays on that axis with time_resample(dat, rs).
Fields:
method::M: the resolved time sampling methodsamplers::S: a tuple ofTimeSample, where the first isnothingwhen skippedcombine::C:TimeNoDiff()orTimeDiff(), how the samplers are combinedout_dates::O: one label per output slice, astime_resample_datesgives
TimeSampleViewInstance <: AbstractArray <: AnyBasic Aggregation
TimeDay
aggregation to daily time steps
TimeDay <: TimeSamplerMethod <: TimeSampler <: AnyTimeHour
aggregation to hourly time steps
TimeHour <: TimeSamplerMethod <: TimeSampler <: AnyTimeMean
aggregation to mean over all time steps
TimeMean <: TimeSamplerMethod <: TimeSampler <: AnyTimeMonth
aggregation to monthly time steps
TimeMonth <: TimeSamplerMethod <: TimeSampler <: AnyTimeYear
aggregation to yearly time steps
TimeYear <: TimeSamplerMethod <: TimeSampler <: AnyPeriod Based
TimeSamplers.TimePeriodAnomaly Type
TimePeriodAnomaly(period; origin = :calendar)
TimePeriodAnomaly(n, unit; origin = :calendar)Anomalies of n-unit bins, computed as each bin value minus the overall mean.
Fields:
period::P: the bin length as aDates.Periodorigin::Symbol: where bins start, seeTimePeriodSample
TimePeriodAnomaly <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: AnyTimeSamplers.TimePeriodIAV Type
TimePeriodIAV(period; cycle = Year(1))
TimePeriodIAV(n, unit; cycle = Year(1))Inter-cycle variability of n-unit bins, computed as each bin value minus the mean cycle value at the position of that bin. See TimePeriodMSC.
Fields:
period::P: the bin length as aDates.Periodcycle::C: the length of the cycle as aDates.Period
TimePeriodIAV <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: AnyTimeSamplers.TimePeriodMSC Type
TimePeriodMSC(period; cycle = Year(1))
TimePeriodMSC(n, unit; cycle = Year(1))Mean cycle of n-unit bins. With the default yearly cycle this is the multi-year seasonal cycle, and with cycle = Day(1) it is the mean diurnal cycle. The value at each cycle position pools all timesteps at that position across all cycles. Bins restart at the start of every cycle, and the output runs from the first position of the cycle to the last, whatever the first date of the record.
In a yearly cycle of day or sub-day bins, positions follow calendar dates on a 366 day leap year calendar. Every date is grouped with the same date in all years, and Feb 29 only has data from leap years. Daily bins give 366 values when the record has a leap year and 365 otherwise.
Fields:
period::P: the bin length as aDates.Periodcycle::C: the length of the cycle as aDates.Period
TimePeriodMSC <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: AnyTimeSamplers.TimePeriodMSCAnomaly Type
TimePeriodMSCAnomaly(period; cycle = Year(1))
TimePeriodMSCAnomaly(n, unit; cycle = Year(1))Mean cycle of n-unit bins minus the overall mean. See TimePeriodMSC.
Fields:
period::P: the bin length as aDates.Periodcycle::C: the length of the cycle as aDates.Period
TimePeriodMSCAnomaly <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: AnyTimePeriodMethod
Abstract type for time sampling methods defined by an n-unit period
Extended help
Available methods/subtypes:
TimePeriodAnomaly: aggregation to anomalies of n-unit binsTimePeriodIAV: aggregation to the inter-annual variability of n-unit binsTimePeriodMSC: aggregation to the mean seasonal or diurnal cycle of n-unit binsTimePeriodMSCAnomaly: aggregation to anomalies of the mean cycle of n-unit binsTimePeriodSample: aggregation to bins of an n-unit period
TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: AnyTimeSamplers.TimePeriodSample Type
TimePeriodSample(period; origin = :calendar)
TimePeriodSample(n, unit; origin = :calendar)Resample to bins of an n-unit period such as Hour(6), "6-hour" or Day(8).
Fields:
period::P: the bin length as aDates.Periodorigin::Symbol: where bins start.:calendarfloors dates on the calendar,:startcounts bins from the first date, and:yearrestarts bins at every Jan 1 so that the last bin of each year may be short.
With :calendar, bins of hours, minutes and seconds align to midnight, and month bins align to Jan 1, so 3-month bins are calendar quarters. Bins of several days or weeks align to the Dates epoch instead of the data. Use :start or :year to align such bins to the data.
TimePeriodSample <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: AnyAnomalies
TimeDayAnomaly
aggregation to daily anomalies
TimeDayAnomaly <: TimeSamplerMethod <: TimeSampler <: AnyTimeDayMSCAnomaly
aggregation to daily MSC anomalies
TimeDayMSCAnomaly <: TimeSamplerMethod <: TimeSampler <: AnyTimeHourAnomaly
aggregation to hourly anomalies
TimeHourAnomaly <: TimeSamplerMethod <: TimeSampler <: AnyTimeMonthAnomaly
aggregation to monthly anomalies
TimeMonthAnomaly <: TimeSamplerMethod <: TimeSampler <: AnyTimeMonthMSCAnomaly
aggregation to monthly MSC anomalies
TimeMonthMSCAnomaly <: TimeSamplerMethod <: TimeSampler <: AnyTimeYearAnomaly
aggregation to yearly anomalies
TimeYearAnomaly <: TimeSamplerMethod <: TimeSampler <: AnyClimatological Statistics
TimeDayIAV
aggregation to daily IAV
TimeDayIAV <: TimeSamplerMethod <: TimeSampler <: AnyTimeDayMSC
aggregation to daily MSC
TimeDayMSC <: TimeSamplerMethod <: TimeSampler <: AnyTimeHourDayMean
aggregation to mean of hourly data over days
TimeHourDayMean <: TimeSamplerMethod <: TimeSampler <: AnyTimeMonthIAV
aggregation to monthly IAV
TimeMonthIAV <: TimeSamplerMethod <: TimeSampler <: AnyTimeMonthMSC
aggregation to monthly MSC
TimeMonthMSC <: TimeSamplerMethod <: TimeSampler <: AnyTime Selection
TimeAllYears
aggregation/slicing to include all years
TimeAllYears <: TimeSamplerMethod <: TimeSampler <: AnyTimeFirstYear
aggregation/slicing of the first year
TimeFirstYear <: TimeSamplerMethod <: TimeSampler <: AnyTimeRandomYear
aggregation/slicing of a random year
TimeRandomYear <: TimeSamplerMethod <: TimeSampler <: AnyTimeShuffleYears
aggregation/slicing/selection of shuffled years
TimeShuffleYears <: TimeSamplerMethod <: TimeSampler <: AnySpecial Methods
TimeArray
use array-based time sampling/aggregation
TimeArray <: TimeSamplerMethod <: TimeSampler <: AnyTimeDiff
aggregation to time differences, e.g. monthly anomalies
TimeDiff <: TimeSamplerMethod <: TimeSampler <: AnyTimeIndexed
aggregation using time indices, e.g., TimeFirstYear
TimeIndexed <: TimeSamplerMethod <: TimeSampler <: AnyTimeNoDiff
aggregation without time differences
TimeNoDiff <: TimeSamplerMethod <: TimeSampler <: AnyTimeSizedArray
aggregation to a sized array
TimeSizedArray <: TimeSamplerMethod <: TimeSampler <: AnyAll TimeSampler Types
To list all available time sampler types and their purposes:
using TimeSamplers
using OmniTools: show_methods_of
# Display all time sampler types
show_methods_of(TimeSampler)