Skip to content

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 <: Any

TimeSamplerMethod ​

TimeSamplerMethod

Abstract type for time sampling / aggregation methods

TimeSamplerMethod <: Any

Core Types ​

TimeSample

define a type for temporal sampling/aggregation of an array

TimeSamplers.TimeSample Type
julia
TimeSample{I, sampler_func}

define a type for temporal sampling/aggregation of an array

Fields:

  • indices::I: indices to be collected for sampling/aggregation

  • sampler_func::sampler_func: a function to use for sampling/aggregation, defaults to mean

  • n_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 <: Any

TimeSampleViewInstance

view of a TimeSample

TimeSamplers.TimeSampleViewInstance Type
julia
TimeSampleViewInstance{T, N, D, P, AV <: TimeSample}

Fields:

  • parent::P: the parent data

  • agg::AV: a view of the parent data

  • dim::Val{D}: a val instance of the type that stores the dimension to be aggregated on

TimeSamplers.TimeResampler Type
julia
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 method

  • samplers::S: a tuple of TimeSample, where the first is nothing when skipped

  • combine::C: TimeNoDiff() or TimeDiff(), how the samplers are combined

  • out_dates::O: one label per output slice, as time_resample_dates gives

TimeSampleViewInstance <: AbstractArray <: Any

Basic Aggregation ​

TimeDay

aggregation to daily time steps

TimeDay <: TimeSamplerMethod <: TimeSampler <: Any

TimeHour

aggregation to hourly time steps

TimeHour <: TimeSamplerMethod <: TimeSampler <: Any

TimeMean

aggregation to mean over all time steps

TimeMean <: TimeSamplerMethod <: TimeSampler <: Any

TimeMonth

aggregation to monthly time steps

TimeMonth <: TimeSamplerMethod <: TimeSampler <: Any

TimeYear

aggregation to yearly time steps

TimeYear <: TimeSamplerMethod <: TimeSampler <: Any

Period Based ​

TimeSamplers.TimePeriodAnomaly Type
julia
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 a Dates.Period

  • origin::Symbol: where bins start, see TimePeriodSample

TimePeriodAnomaly <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: Any

TimeSamplers.TimePeriodIAV Type
julia
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 a Dates.Period

  • cycle::C: the length of the cycle as a Dates.Period

TimePeriodIAV <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: Any

TimeSamplers.TimePeriodMSC Type
julia
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 a Dates.Period

  • cycle::C: the length of the cycle as a Dates.Period

TimePeriodMSC <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: Any

TimeSamplers.TimePeriodMSCAnomaly Type
julia
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 a Dates.Period

  • cycle::C: the length of the cycle as a Dates.Period

TimePeriodMSCAnomaly <: TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: Any

TimePeriodMethod

Abstract type for time sampling methods defined by an n-unit period


Extended help ​

Available methods/subtypes: ​

  • TimePeriodAnomaly: aggregation to anomalies of n-unit bins

  • TimePeriodIAV: aggregation to the inter-annual variability of n-unit bins

  • TimePeriodMSC: aggregation to the mean seasonal or diurnal cycle of n-unit bins

  • TimePeriodMSCAnomaly: aggregation to anomalies of the mean cycle of n-unit bins

  • TimePeriodSample: aggregation to bins of an n-unit period

TimePeriodMethod <: TimeSamplerMethod <: TimeSampler <: Any

TimeSamplers.TimePeriodSample Type
julia
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 a Dates.Period

  • origin::Symbol: where bins start. :calendar floors dates on the calendar, :start counts bins from the first date, and :year restarts 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 <: Any

Anomalies ​

TimeDayAnomaly

aggregation to daily anomalies

TimeDayAnomaly <: TimeSamplerMethod <: TimeSampler <: Any

TimeDayMSCAnomaly

aggregation to daily MSC anomalies

TimeDayMSCAnomaly <: TimeSamplerMethod <: TimeSampler <: Any

TimeHourAnomaly

aggregation to hourly anomalies

TimeHourAnomaly <: TimeSamplerMethod <: TimeSampler <: Any

TimeMonthAnomaly

aggregation to monthly anomalies

TimeMonthAnomaly <: TimeSamplerMethod <: TimeSampler <: Any

TimeMonthMSCAnomaly

aggregation to monthly MSC anomalies

TimeMonthMSCAnomaly <: TimeSamplerMethod <: TimeSampler <: Any

TimeYearAnomaly

aggregation to yearly anomalies

TimeYearAnomaly <: TimeSamplerMethod <: TimeSampler <: Any

Climatological Statistics ​

TimeDayIAV

aggregation to daily IAV

TimeDayIAV <: TimeSamplerMethod <: TimeSampler <: Any

TimeDayMSC

aggregation to daily MSC

TimeDayMSC <: TimeSamplerMethod <: TimeSampler <: Any

TimeHourDayMean

aggregation to mean of hourly data over days

TimeHourDayMean <: TimeSamplerMethod <: TimeSampler <: Any

TimeMonthIAV

aggregation to monthly IAV

TimeMonthIAV <: TimeSamplerMethod <: TimeSampler <: Any

TimeMonthMSC

aggregation to monthly MSC

TimeMonthMSC <: TimeSamplerMethod <: TimeSampler <: Any

Time Selection ​

TimeAllYears

aggregation/slicing to include all years

TimeAllYears <: TimeSamplerMethod <: TimeSampler <: Any

TimeFirstYear

aggregation/slicing of the first year

TimeFirstYear <: TimeSamplerMethod <: TimeSampler <: Any

TimeRandomYear

aggregation/slicing of a random year

TimeRandomYear <: TimeSamplerMethod <: TimeSampler <: Any

TimeShuffleYears

aggregation/slicing/selection of shuffled years

TimeShuffleYears <: TimeSamplerMethod <: TimeSampler <: Any

Special Methods ​

TimeArray

use array-based time sampling/aggregation

TimeArray <: TimeSamplerMethod <: TimeSampler <: Any

TimeDiff

aggregation to time differences, e.g. monthly anomalies

TimeDiff <: TimeSamplerMethod <: TimeSampler <: Any

TimeIndexed

aggregation using time indices, e.g., TimeFirstYear

TimeIndexed <: TimeSamplerMethod <: TimeSampler <: Any

TimeNoDiff

aggregation without time differences

TimeNoDiff <: TimeSamplerMethod <: TimeSampler <: Any

TimeSizedArray

aggregation to a sized array

TimeSizedArray <: TimeSamplerMethod <: TimeSampler <: Any

All TimeSampler Types ​

To list all available time sampler types and their purposes:

julia
using TimeSamplers
using OmniTools: show_methods_of

# Display all time sampler types
show_methods_of(TimeSampler)

TimeSamplers.jl - Temporal sampling and aggregation for time series data