HydroNumerics‎ > ‎

Time series


In hydrology, hydrological information systems and hydrological modelling time series plays an important role. Usually you spend much time on tedious tasks concerning time series handling. Maybe you need the monthly precipitation rate for your analysis, but the time series at hand are based on daily values and the unit is centimeters pr day, but what you want is millimeters pr month. Even more cumbersome are situations where you need to prepare a large number of time series to be ready for input to a model. Model developers often find that they spend much time on time series handling within their code. The HydroNumerics.Time namespace contains generic C# time series classes are designed to be build into you code and thus freeing you from the tedious work related to time series handling and allowing you to focus on numerical and physical issues.


HydroNet modellen er en dynamisk model. Modellen simulerer udvekslingen mellem søvand og grundvand over en given tidsperiode. Under simuleringen læser modellen data for randbetingelserne som f.eks. observeret nedbør, temperatur eller grundvandspotentialer. Internt i modellen fortages der tidsskridt således, at værdier for et tidsskridt beregnes på baggrund af beregnede værdier og randbetingelser for det forrige tidsskridt. De beregnede resultater udskrives til filer, der ligeledes er tidsserier. Derfor vil håndtering af tidsserier udgøre en substantiel del af modellen. For at gøre det muligt for udviklere i fremtiden at videreudvikle på modellen eller at udnytte dele af modellen til andre formål (HydroNet er open source) er der lagt stor vægt på, at selve programkoden er så simpel og overskuelig som muligt. Derfor er hele håndteringen af tidsserier lagt i et separat modul. Det betyder, at modellens beregningskerne bliver meget simplere og samtidig vil tidsserie-modulet kunne anvendes i andre sammenhænge.

 

Umiddelbart virker det banalt at håndtere tidsserier. Tidsserier er jo blot en samling af sammenhængende værdier af tid og værdi. Programmeringsmæssig håndtering af tidsserier er da heller ikke svært, men ekstremt besværligt. Derfor giver det rigtig god mening at isolere alt funktionalitet vedrørende tidsserier i et veltestet modul, så man ikke skal rode med det mere end højst nødvendigt.

 

Tidspunkt og tidsperiode baserede tidsserier

Tidsserier kan opdeles i to typer: Tidspunkt-baserede (time stamp based) og tidsperiode-baserede (timespan based). Når man måler en vandstande over tid, vil det typisk resultere i en tidspunktbaseret tidsserie. Den enkelte målte vandstand gælder for et specifikt tidspunkt. Men for f.eks. nedbør er det en anden sag. Når man måler nedbør, foregår det i princippet ved, at man lader det regne i et målebæger over en periode. Den vandmængde, som er akkumuleret i bægeret kan omsættes til den gennemsnitlige nedbør for perioden. Den målte tidsserie bliver altså en tidsperiode baseret tidsserie. De to typer tidsserier optræder også i numeriske modeller. Konceptuelle modeller regner typisk på en vandbalance over et tidsskridt. Derfor vil en sådan model fordre, at input, så som indstrømning til modellen, repræsenterer middelstrømningen over beregningstidskridtet. Ligeledes vil outputtet repræsentere gennemsnitsværdier for et tidskridt. Andre typer modeller, så som fysisk baserede modeller kan anvende værdier, som svarer til et specifikt tidspunkt. Tidsseriemodulet er derfor designet til både at kunne repræsentere begge typer tidsserier og kunne konvertere værdier fra den ene type til den anden.


Time Series

Hydron model is a dynamic model. The model simulates the exchange between lake water and groundwater over a given time period. During the simulation reads the model data for boundary conditions such as. observed precipitation, temperature or groundwater potentials. Internally, the model performed the time-step so that the values of a time step is calculated based on calculated values and boundary conditions for the previous time step. The calculated results are written to files that are also time series. Therefore, management of time series constitute a substantial part of the model. To make it possible for developers in the future to further develop the model or to use part of the model for other purposes (Hydron is open source) has placed a strong emphasis on the actual program code is as simple and straightforward as possible. Therefore, the whole handling of time series subject to a separate module. This means that the model calculation kernel is much simpler and simultaneously the time series module could be used in other contexts. 

Immediately, it seems trite to handle time series. Time series is indeed just a collection of continuous values of time and value. Programming Proper handling of time series is indeed not difficult, but extremely difficult.Therefore it makes perfect sense to isolate all functionality relating to time series in a veltestet module, so you should not mess with it more than necessary.

Time and time-based time series

Time series can be divided into two types: Time-based (timestamp-based) and time-based (time span based). When you measure a sea levels over time, it will typically result in a time-based time series. The single measured water levels apply to a specific time. But for example. precipitation is another matter. When measuring precipitation, it works in principle by allowing the rain in a measuring cup over a period. The water that accumulated in the cup can be translated to the average rainfall for the period. The measured time series is therefore a time-based time series. The two types of time series also appear in numerical models. Conceptual models rains typically a water balance over a time step. Therefore, such a model require that the input, such as inflow to the model, representing the average flow over the calculation time chalk. Similarly, output will represent the average values of a time-chalk. Other types of models, such as physically-based models can use values that correspond to a specific time. Time Series module is designed both to represent both types of time series and to convert values from one type to another.

Comments