Performs minimum time step standardization, gap filling and start/end time selection. This function provides the option to select the minimum temporal step size of an is.trex object. Additionally, the user can define the start and end time of the series and select the minimum size under which gaps should be filled, using linear interpolation.

Time series have different temporal resolutions. This function provides the option to standardize the minimum time step by either performing a linear interpolation when the requested time step is smaller than the minimum time step of the series or average values when the requested time step is larger than the minimum time step of the series. Before this process, the entire time series is converted to a one-minute time step by applying a linear interpolation (excluding gap \(periods > \code{max.gap}\)).

dt.steps(input, start,
       end, time.int = 10, max.gap = 60,
       decimals = 10, df = FALSE)

Arguments

input

An is.trex-compliant (output) object

start

Character string providing the start time for the series. Format has to be provided in "UTC" (e.g., "2012-05-28 00:00" or Year-Month-Day Hour:Minute). Starting time should not be earlier than the start of the series.

end

Character string providing the start time for the series. Format has to be provided in "UTC" (e.g., "2012-06-28 00:50" or Year-Month-Day Hour:Minute). End time should be earlier than the end time and not later than that of the series.

time.int

Numeric value providing the number of minutes for the minimum time step. When time.int is smaller than the minimum time step of the series, a linear interpolation is applied. If time.int is larger than the minimum time step of the series values are averaged to the chosen value of time.int (after performing a linear interpolation to obtain a one-minute resolution).

max.gap

Numeric value providing the maximum size of a gap in minutes, which can be filled by performing a linear interpolation.

decimals

Integer value defining the number of decimals of the output (default = 10).

df

Logical; if TRUE, output is provided in a data.frame format with a timestamp and a value (\(\Delta T\) or \(\Delta V\)) column. If FALSE, output is provided as a zoo object (default = FALSE).

Value

A zoo object or data.frame in the appropriate format for further processing.

Examples

if (FALSE) {
input <- is.trex(example.data(type="doy"),
           tz="GMT",time.format="%H:%M", solar.time=TRUE,
           long.deg=7.7459,ref.add=FALSE)
in.ts <- dt.steps(input=input,start='2012-06-28 00:00',end='2012-07-28 00:00',
                   time.int=60,max.gap=120,decimals=6,df=FALSE)
plot(in.ts)
head(in.ts)
}