getChunkSize: Calculate the number of time steps to read from DST file for...

View source: R/getChunkSize.R

getChunkSizeR Documentation

Calculate the number of time steps to read from DST file for each model component.

Description

RSMinerve result files can be stored in .dst files where time series of each model component are stored in rows. getChunkSize can be used to determine the chunk size of each model output. Typically used to deterimine input to readResultDST.

Usage

getChunkSize(start_date, end_date, recordingTimeStep)

Arguments

start_date

Lubridate datetime of the start of the simulation

end_date

Lubridate datetime of the end of the simulation

recordingTimeStep

The simulations recording time step (in seconds) as character or as numeric.

Value

A numeric of the number of time steps, including one header line, to be read.

Note

Currently only hourly, daily and monthly time steps are implemented.

See Also

[readResultDST]

Other RS Minerve IO: load_minerve_input_csv(), readDBCSV(), readForcingCSV(), readForcingSTR(), readRSMParameters(), readResultCSV(), readResultDST(), readSelectionCHK(), translateCSVtoDST(), writeRSMParameters(), writeSelectionCHK()

Examples

start_date <- lubridate::as_datetime("20.01.2021 00:00:00",
                                     format = "%d.%m.%Y %H:%M:%S")
end_date <- lubridate::as_datetime("25.01.2021 00:00:00",
                                   format = "%d.%m.%Y %H:%M:%S")
recordingTimeStep <- 3600  # In seconds
chunk_size <- getChunkSize(start_date, end_date, recordingTimeStep)

hydrosolutions/riversCentralAsia documentation built on Feb. 7, 2023, 4:50 p.m.