Tools
Advanced statistics¶
Auto-correlation¶
Item | Description |
---|---|
Description | This tool calculates the auto-correlation value of a time series. |
Input items | A single time series. |
Tool properties | The tool has no properties. |
Output items | The tool has a time series output. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AdvancedStatistics. AutoCorrelationTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Auto-correlation‘) |
Technical reference and usage tips |
Coverage¶
Item | Description |
---|---|
Description | This tool calculates coverage of time series. |
Input items | A single time series. |
Tool properties | The tool has no properties. |
Output items | One or more time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AdvancedStatistics. TimeSeriesCoverageTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Coverage‘) |
Technical reference and usage tips |
Data quantile¶
Item | Description |
---|---|
Description | The Data quantile tool calculates the data quantile. The data quantile is the value that a specified fraction of all raw data are less than. For a fraction of 0.5 the data quantile equals the median. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A table containing two columns: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.DataQuantileTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Data quantile‘) |
Technical reference and usage tips |
Drought duration and volume¶
Item | Description |
---|---|
Description | Drought duration and volume tool. |
Input items | A single time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One or more time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AdvancedStatistics.DroughtTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Drought Duration and Volume‘) |
Technical reference and usage tips |
Duration curve¶
Item | Description |
---|---|
Description | A duration curve is based on the calculated exceedence probability for the range of values found in the time series being analyzed. A duration curve shows the range of data values found in the time series as a function of the exceedence probability. An exceedence probability of zero means that the value is exceeded at all times and a value of one indicates that the value is not exceeded in the time span covered by the time series. |
Input items | The Duration curve tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One duration curve will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AdvancedStatistics.DurationCurveTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Duration curve‘) |
Technical reference and usage tips |
Exceedance duration and volume¶
Item | Description |
---|---|
Description | Exceedance duration and volume. |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One ordinary time series will be returned for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AdvancedStatistics. ExceedanceTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Exceedance Duration and Volume‘) |
Technical reference and usage tips |
BasicLMoments¶
Item | Description |
---|---|
Description | L-moments are statistics used to summarize the shape of a probability distribution. They are analogous to ordinary moments in that they can be used to calculate quantities analogous to standard deviation, skewness and kurtosis, termed the L-scale, L-skewness and L-kurtosis respectively (the L-mean is identical to the conventional mean). L-moments differ from conventional moments in that they are calculated using linear combinations of the ordered data; the "l" in "linear" is what leads to the name being "L-moments". Just as for conventional moments, a theoretical distribution has a set of population L-moments. |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | A table containing five columns: |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicLMomentsTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘BasicLMoments‘) |
MannKendall¶
Item | Description |
---|---|
Description | The Mann-Kendall test is used for testing monotonic trend of a time series. |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool has no properties. |
Output items | The tool returns the test statistics and significance level for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.MannKendallTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘MannKendall‘) |
Technical reference and usage tips | The Mann-Kendall test is used for testing monotonic trend of a time series {xi, i = 1,2,..,n}. The test statistic reads where A positive value of z indicates an upward trend, whereas a negative value indicates a downward trend. The test statistic is asymptotically normally distributed with zero mean (µz = 0) and variance given by For evaluating the H0 hypothesis: no trend in the series, the standardised test statistic calculated from is compared to the quantiles of a standard normal distribution. |
Mann-Whitney test¶
Item | Description |
---|---|
Description | The Mann-Whitney test is used for testing shift in the mean between two sub-samples defined from a time series. |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | The tool returns the test statistics and significance level for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.MannWhitneyTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘MannWhitney‘) |
Technical reference and usage tips | The Mann-Whitney test is used for testing shift in the mean between two sub-samples defined from a time series {xi, i = 1,2,..,n}. For the time series ranks Ri are assigned from Ri = 1 for the smallest to Ri = n for the largest observation. Time series of ranks for the two-subsamples are then defined by {Ri, i = 1,2,..,n1} and {Ri, i = 1,2,..,n2} where n = n1 + n2. The test statistic is given as the sum of ranks of the smaller sub-series, i.e. The test statistic is asymptotically normally distributed with mean and variance For evaluating the H0 hypothesis: same mean value in the two sub-series, the standardised test statistic is compared to the quantiles of a standard normal distribution. |
Mode¶
Item | Description |
---|---|
Description | The Mode tool calculates the mode of the input series. The Mode is the value that occurs the most fequently in a sample. The mode is not necessarily unique, since the same maximum frequency may be attained at different values. The most ambiguous case occurs in uniform distributions, wherein all values are equally likely, and for samples drawn from continious distributions where all values tend to occur only once. Since the latter is a very common, the Mode tool has been extended such that the user can specify a tolerance within which two values can be considered equal. In the case where the tolerance is set to low when mode is calculated for samples drawn from continious distribution, the number of mode values will approach the number of values in the sample. When this happens, the concept becomes useless. To indicate when this happens, the user may set a limit to the number of values the tool can return. If this value is exceeded, the tool returns a single double.NaN. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A table containing two columns for each mode value: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ModeValueTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Mode‘) |
Period statistics charts¶
Item | Description |
---|---|
Description | The Period statistics charts tool presents a range of different period statistics for the selected input time series. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | The type of the input is defined by the tool selected in “Tool to apply”. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Apps. PeriodStatisticsChartsTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Period Statistics Charts‘) |
Residual mass¶
Item | Description |
---|---|
Description | Returns the calculated residual mass for the provided input time series. The residual mass for a given time step is defined as the accumulated deviations from the average value of the entire time series. |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | The tool returns a time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AdvancedStatistics.ResidualMassTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Residual mass‘) |
RunTest¶
Item | Description |
---|---|
Description | The run test is used for general testing of independence and homogeneity of a time series. |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool has no properties. |
Output items | The tool returns the test statistics and significance level for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.RunTestTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘RunTest ‘) |
Technical reference and usage tips | From the time series {xi, i = 1,2,…,n} the sample median xmed is calculated and a shifted series {si = xi−xmed, i = 1,2,…,n} is constructed. From the shifted series a run is defined as a set of successive elements having the same sign. The test statistic is given as the number of runs of the shifted series, i.e. The test statistic is asymptotically normally distributed with mean µz and variance σz2 given by Thus, the standardised test statistic is evaluated against the quantiles of a standard normal distribution. That is, the H0 hypothesis of independent and homogeneous data is rejected at significance level α if z* > Φ-1(1−α/2) where Φ-1(1−α/2) is the (1−α/2)-quantile in the standard normal distribution. |
StatisticsMap¶
Item | Description |
---|---|
Description | The Statistics map tool calculates a selected time series statistics, and plots the result on a map. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | The type of the input is defined by the tool selected in “Tool to apply”. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Apps.StatisticsMapTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘StatisticsMap‘) |
TimeSeriesIndex¶
Item | Description |
---|---|
Description | Calculates the Stream flow index for the selected time series. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | N/A |
API reference | DHI.Solutions.TimeseriesManager.Tools.Apps.TimeSeriesIndexTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘TimeSeriesIndex‘) |
TimeSeriesThreshold¶
Item | Description |
---|---|
Description | Calculates the time series index for the selected time series. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | N/A |
API reference | DHI.Solutions.TimeseriesManager.Tools.Apps.TimeSeriesThresholdTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘TimeSeriesThreshold‘) |
Within year statistics¶
Item | Description |
---|---|
Description | The Within-year statistics tool calculates the specified statics for a relative time period (Analysis time step). The output is a time series that covers a single year with the statistics calculated on the specified time step. The tool can be used to calculate e.g. the average flow for Jan, feb, ... Dec based on a time series that spans several years. The calculation starts on the specified date - for instance monthly averages with a start date of 01-01 calculates the averages for the month, starting with the 1st. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | Returns a time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AdvancedStatistics.WithinYearStatsTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Within Year Statistic‘) |
Basic statistics¶
Accumulation¶
Item | Description |
---|---|
Description | This tool calculates the accumulation of all values in a time series. Note this is not the same as summing the values. For rates and instantaneous values, accumulation is calculated by multiplying the values by the time period they are applicable. |
Input items | One or more timeseries. |
Tool properties | This tool has no properties. |
Output items | Returns a list for each input timeseries or a table with a row for each input timeseries. |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicStatistics.AccumulationTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('Accumulation') |
Annual maximum series (seasonal)¶
Item | Description |
---|---|
Description | In the annual maximum series (AMS) method the maximum value in each year of the record are extracted for the extreme value analysis. |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | The tool one time series containing annual maximum values for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.AnnualMaximumTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Annual Maximum‘) |
Technical reference and usage tips | The analysis year should preferably be defined from a period of the year where extreme events never or very seldomly occur in order to ensure that a season with extreme events is not split in two. |
Average¶
Item | Description |
---|---|
Description | The Average tool is used to calculate the simple mean and/or time weighted average of one or more time series. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property to get a description in the property control- The default value of “Time weighted average” is false, which will return the average of a time series. If this property value is true, the tool will weight the time series values with the duration. |
Output items | A table containing two columns: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.TimeWeightedAverageTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Time weighted average value‘) |
Technical reference and usage tips |
Count¶
Item | Description |
---|---|
Description | The Count tool returns the number of time steps that contains values in a time series. |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | A table containing one column: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicSampleSizeTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘BasicSampleSize‘) |
Count per year (average)¶
Item | Description |
---|---|
Description | The Count per year (average) tool returns the average number of time steps per year that contains values. |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | A table containing one column: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicAveNumEventTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘BasicAvgNumEvent‘) |
Distribution¶
Item | Description |
---|---|
Description | A distribution curve relates the magnitude of an observed variable to its frequency of occurrence. Integrating the distribution curve between two values yields the probability, P, of a given value, X, being inside that interval. This tool plots the probability distribution of the values in a time series. The time axis of the input time series is not taken into consideration |
Input items | The Distribution tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One distribution will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.DistributionTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Distribution‘) |
Technical reference and usage tips | The algorithm used to produce the distribution plots uses a kernel-based Fourier transformation method. A complete description is given by Tarter and Lock (1994), Model-Free Curve Estimation, ISBN 0-412-04251-7-5. |
Maximum value¶
Item | Description |
---|---|
Description | The Maximum tool is used to get the maximum value of one or more time series. |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | A table containing two columns: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.MaximumValueTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Maximum value‘) |
Technical reference and usage tips |
Minimum value¶
Item | Description |
---|---|
Description | The Minimum tool is used to get the minimum value of one or more time series. |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | A table containing two columns: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.MinimumValueTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Minimum value‘) |
Technical reference and usage tips |
Monthly statistics¶
Item | Description |
---|---|
Description | This tool calculates statistics for each specified month. This can be a single month or a range of months. For a timeseries containing several years, a calculation is made for each month in each year. In addition to the chosen statistic, it is possible to get monthly and yearly mean, maximum, and minimum. Note that these values are also based on the chosen time series. |
Input items | One or more timeseries. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One table or list for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicStatistics.MonthlyStatisticsTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Monthly Statistics‘) |
BasicOrdinaryMoments¶
Item | Description |
---|---|
Description | The Ordinary moments tool calculates the ordinary moments of one or more time series. The ordinary moments are: |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | A table containing five columns: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicOrdinaryMomentsTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘BasicOrdinaryMoments‘) |
Period statistics¶
Item | Description |
---|---|
Description | This tool calculates statistics for a specified period (daily, monthly etc.). |
Input items | One or more timeseries. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A list for each output item or a chart or table containing a graph/column for each input timeseries. |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicStatistics.PeriodStatisticsTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Period Statistics‘) |
Standard deviation¶
Item | Description |
---|---|
Description | The Standard deviation tool calculates the standard deviation of one or more timeseries. |
Input items | One or more timeseries. |
Tool properties | The tool has no properties. |
Output items | A table containing two columns: and one row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.StdDevTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Standard deviation‘) |
Technical reference and usage tips |
Sum¶
Item | Description |
---|---|
Description | This tool calculates the sum of all the values in a timeseries. |
Input items | One or more timeseries. |
Tool properties | The tool has no properties. |
Output items | A list for each input item or a table with a row for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.BasicStatistics.SumTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Sum‘) |
Downscaling¶
There are three downscaling tools implemented that are described briefly below: Delta change factors, Quantile Perturbation and Quantile Quantile. The tools work on temperature, precipitation, evaporation and potential evapotranspiration data. The following value types are allowed for observation data:
- Temperature can be recorded mean step accumulated or instantaneous
- Precipitation and potential evapotranspiration can be recorded mean step accumulated or step accumulated
Additionally, the tools check whether the value type that is derived for the climate data provided in NetCDF files matches the value type specified for the observation data (exception: if delta change factors are provided, value types are not compared. It is assumed that the user specifying the calculated delta change factors is aware of the value type they have been produced in.)
The list below specifies the supported NetCDF data variables and the value type that get assigned to them:
Variable | Value Type |
---|---|
DHI_CF_Rainfall | |
DHI_CF_PrecipitationRate | |
DHI_CF_Evaporation | |
DHI_CF_ETRate | |
DHI_CF_Temperature | |
precipitation_amount | Step_accumulated |
precipitation_rate | Mean_step_accumulated |
precipitation_flux | Mean_step_accumulated |
air_temperature | Instantaneous |
surface_upward_water_vapour_mass_flux_amount | Instantaneous |
total_precipitation_rate | Mean_step_accumulated |
Total precipitation rate | Mean_step_accumulated |
Temperature T | Mean_step_accumulated |
evaporation | Step_accumulated |
Evaporation | Step_accumulated |
ETRate | Mean_step_accumulated |
pr | Mean_step_accumulated |
tas | Instantaneous |
The tool logic compares this list of variable names against the attribute “standard_name” or “long_name”. If both attributes do not exist in the NetCDF data variables then the variable name itself is compared against the list above.
The downscaling tools support standard Gregorian calendar, 365-day calendar as well as 360-day calendar. For identifying the calendar type, the time axis variable in the NetCDF file needs to contain a “calendar” attribute with one of the following values:
Time Axis Attribute | Description |
---|---|
calendar = “standard” | Standard calendar with 365 days per year and leap years |
calendar = “gregorian” | Standard calendar with 365 days per year and leap years |
calendar = “360_days” or “360_day” | Calendar with 30 days in every month |
calendar = “365_days” or “365_day” | Calendar without leap years |
Delta change factors¶
Item | Description |
---|---|
Description | The Delta Change Factor tool downscales one or multiple climate parameter time series (precipitation, temperature, evaporation or potential evapotranspiration) using monthly delta change factors (CFs) given in NetCDF format. The tool can either generate delta change factors from control and scenario climate data or be given the delta change factors directly. Delta change factors are relative (precipitation, potential evapotranspiration) or absolute (temperature) changes of monthly averages derived from the comparison between scenario and control period: The monthly CFs are multiplied (added) by every value in the respective month of the observation time series in order to derive the downscaled and projected timeseries. Climate data is given in NetCDF format for the control and scenario period. If the periods span across several NetCDF files then a CSV file can be used as input that lists the files in chronological order. |
Input items | One or more precipitation, temperature, evaporation or potential evapotranspiration time series. Each time series must be associated with a point shape feature in the GIS Manager. The tool cannot handle a mix of climate data input, e.g. a batch of both precipitation and temperature time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One time series will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.UI.Tools.DeltaChangeDownscalingTool.DeltaChangeDownscalingTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Delta Change Factors’) |
Quantile perturbation¶
Item | Description |
---|---|
Description | The Quantile Perturbation tool downscales one or multiple climate parameter time series (precipitation, temperature, evaporation or potential evapotranspiration) using change factor quantile mapping for a more detailed description). The change factor quantile mapping approach derives monthly, empirical cumulative distribution functions (CDF) for control and scenario climate data. Observations are projected, bias corrected and downscaled by mapping the probability of the observed value, determined from the CDF of the control period, to the scenario probability and corresponding value. This approach is also referred to as empirical quantile mapping. The graph under the “Quantile Quantile” tool illustrates the principle of quantile mapping. While the central part of the CDF is typically well described empirically, the extreme tail of the distribution is not. If the data in the observed record and the control data allow, i. e. there are at least 20 data points above the 95th percentile, then the tail of the distribution is parameterized using a Gamma/Pearson Type 3 distribution. This parametrization is also used to extrapolate projected values falling outside the range of the control data. Climate data is given in NetCDF format for the control and scenario period. If the periods span across several NetCDF files then a CSV file can be used as input that lists the files in chronological order. |
Input items | One or more precipitation, temperature, evaporation or potential evapotranspiration time series. Each time series must be associated with a point shape feature in the GIS Manager. The tool cannot handle a mix of climate data input, e.g. a batch of both precipitation and temperature time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One time series will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.UI.Tools.QuantilePerturbationDownscalingTool.QuantilePerturbationDownscalingTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Quantile Perturbation’) |
Quantile Quantile¶
Item | Description |
---|---|
Description | The Quantile Quantile tool downscales one or multiple climate parameter time series (precipitation, temperature, evaporation or potential evapotranspiration) using bias correction quantile mapping for a more detailed description). The bias correction quantile mapping approach derives monthly, empirical cumulative distribution functions (CDF) for observations and control climate data. Scenario climate data are bias corrected and downscaled by mapping the probability of the scenario value, determined from the CDF of the control period, to the observed probability and corresponding value. This approach is also referred to as empirical quantile mapping. The graph below illustrates the principle of quantile mapping. Visualisation of quantile mapping. xf is the raw climate model data value, CDF CTRL Run is the CDF of the climate model control period, CDF Obs. is the CDF of the observations and xfcorr is the downscaled scenario climate data value While the central part of the CDF is typically well described empirically, the extreme tail of the distribution is not. If the data in the observed record andthe control data allow, i. e. there are at least 15 data points above the 50th percentile, then the tail of the distribution is parameterized using aGamma/Pearson Type 3 distribution. This parametrization is also used to extrapolate projected values falling outside the range of the control data. In case of precipitation, the quantile mapping is applied only to wet days. For each month, a dry day threshold is derived that matches the number of dry daysbetween observations and control data. All projected values below that threshold are set to zero. Climate data is given in NetCDF format for the control and scenario period. If the periods span across several NetCDF files then a CSV file can be used as input that lists the files in chronological order. |
Input items | One or more precipitation, temperature, evaporation or potential evapotranspiration time series. Each time series must be associated with a point shape feature in the GIS Manager. The tool cannot handle a mix of climate data input, e.g. a batch of both precipitation and temperature time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One time series will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.UI.Tools.QuantileQuantileDownscalingTool.QuantileQuantileDownscalingTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Quantile Quantile’) |
Ensemble¶
EnsembleStatisticsTool¶
Item | Description |
---|---|
Description | The ensemble statistics tool calculates a user specified statics for each input ensemble time series. The tool will return the calculated result as an ordinary time series with one value for each time step in the input ensemble time series. The tool calculates the statistics of the remaining elements once missing values are removed. |
Input items | The Ensemble statistics tool requires at least one ensemble time series to be selected. |
Tool properties | The Statistics option determines which ensemble statistics that shall be returned when the tool is executed. Some statistics, like the Quantile option, will require additional inputs when selected. Select any property in the property control for a description. |
Output items | One ordinary time series will be returned for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Analysis. EnsembleStatisticsTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘EnsembleStatisticsTool‘) |
Technical reference and usage tips | The tool calculates the statistics of the remaining elements once missing values are removed. For example, given a 3 member ensemble with values at time t = [ 1, 5, blank], the mean at time t = 3.0. |
Extract ensemble members¶
Item | Description |
---|---|
Description | This tool can be used to extract the members of an ensemble as separate time series. The time series can be saved to the database or opened without being saved. |
Input items | An ensemble of time series. |
Tool properties | The tool properties are listed below. Select a property to get a discription in the property control. |
Output items | The members of the ensemble as separate time series. Depending on the user choices, the time series may be saved to the database. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Processing.ExtractEnsembleMembers |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('Extract ensemble members') |
Extreme value extraction¶
Annual Maximum¶
Item | Description |
---|---|
Description | This tool extracts the annual maximum. The start of the year can be set to any day and month. |
Input items | One or more timeseries. The timeseries must cover at least one full hydrological year. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A list or timeseries for each input item or a chart with output for both input items. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ExtremeValues.AnnualMaximumTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Annual Maximum‘) |
Annual N-Day Minimum¶
Item | Description |
---|---|
Description | This tool first calculates a moving average with a window of the size "n" specified, centred around the given timesteps. It then calculates the annual minimum based on the values from the moving average. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A list, time series, or chart for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ExtremeValues.AnnualNDayMinimumTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Annual N-day Minimum‘) |
Partial Duration Series¶
Item | Description |
---|---|
Description | This tool is used to extract extreme events from a time series. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Two of the properties are related to separating events and will be explained here: Inter Event Level: Two successive events are independent if the level is smaller than this criterion times the lower of the two events. The value must be strictly above 0 and strictly below 1. Inter Event Time: Two events are independent if the time between them is bigger than this time. One or both of these criteria can be chosen by setting them true or false. If both are set to true, both criteria must be fulfilled for two successive events to be independent. PDS Parameters There are two methods for extracting the partial duration series. For "Threshold level" all events above a predefined threshold are extracted. For "AvgAnnualNoExceed" the n largest events are extracted. These values can be specified in the properties window. |
Output items | A list or time series for each input item or a chart with a graph for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ExtremeValues.PartialDurationSeriesTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('Partial Duration Series') |
Partial duration series seasonal¶
Item | Description |
---|---|
Description | This tool is used to extract extreme events from a time series on a seasonal basis. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. For more information on the properties, see the description for the Partial Duration Series tool. |
Output items | A list or time series for each input item or a chart with a graph for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ExtremeValues.SeasonalPartialDurationSeriesTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('Partial Duration Series (seasonal)') |
Import Tools¶
Append values¶
Item | Description |
---|---|
Description | This tool is used for appending values on an existing time series in the database. |
Input items | A time series in ASCII or Excel format. |
Tool properties | When opening the tool, click "Run" without filling in the tool properties. This opens the form below where the file can be chosen and the characteristics can be specified. After appending the values, the changes can be saved. |
Output items | There is no output, but if the changes are saved, the original time series will be overwritten with one that has the new values appended. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.AppendValuesTools |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Append Values‘) |
ImportFromASCII¶
Item | Description |
---|---|
Description | This tool is used for loading time series from ASCII format. |
Input items | A time series in ASCII format. There are a few requirements to the format: 1) The first column must have the title "Time" with a capital T and followed by a tab. This does not have to be the first word in the column and does not have to be right above the dates, but no data before this word is included in the time series. 2) There may not be duplicate dates/times. Only data consisting of a date and a value will be read. There may be other text in the file, but it will not be read. The exception is the optional title of the value column, which must be placed next to the Time-column. This willbe the title of the time series. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. |
Output items | The tool will import the selected ASCII file and save it as a time series in the database, but will not produce any output items. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.ImportFromASCIITool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘ImportFromASCII‘) |
ImportFromDfs0¶
Item | Description |
---|---|
Description | The import from Dfs0 tool is used to import the items in one or more Dfs0 files from the disk to a user specified group in the MIKE Workbench. The items in the selected file(s) can either be imported as separate time series, or in a single time series ensemble. It is possible to import a single dfs0 file, or all dfs0 files in a specified folder. |
Input items | The tool requires one time group or the time series root node to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. |
Output items | The tool will import the selected dfs0 files to the database, but will not produce any output items. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.ImportFromDfs0Tool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘ImportFromDfs0‘) |
Technical reference and usage tips |
ImportFromGRIB¶
Item | Description |
---|---|
Description | This tool is used for extracting time series from rasters with the GRIB format. The time series for at single point can be imported or for all points. |
Input items | A GRIB file following the layout of DMI or ECMWF. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. |
Output items | There are no outputs, but the tool will create time series for the selected point(s) in the raster and save them to the database. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.ImportTsFromGRIBTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('ImportFromGRIB') |
ImportFromNetCdf¶
Item | Description |
---|---|
Description | This tool is used for extracting time series from rasters with the NetCDF format. The time series for at single point can be imported or for all points. |
Input items | A NetCDF file with gridded data or data in catchment form. If the data is in catchment form, there must be an attribute called "name" with the name of the catchment. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. |
Output items | There are no outputs, but the tool will create time series for the selected point(s) in the raster and save them to the database. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.ImportTsFromNetCdfTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('ImportFromNetCdf') |
ImportFromUSGS¶
Item | Description |
---|---|
Description | The import from USGS tool is used to import time series data provided by the United States Geological Survey (USGS). Specifically, the tool downloads data from the USGS Daily Values Site Web Service (https://waterservices.usgs.gov/rest/DV-Service.html) and stores them in the selected time series group. The tool is designed to allow repeated execution in order to append more recent data to time series that already exist in the selected time series group. |
Input items | The tool requires one time group or the time series root node to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. Required: ToEquidistant, default is False. If True, missing values are inserted at missing time steps to ensure that the time step is equidistant but no interpolation is performed. |
Output items | The tool will import time series for specified site numbers, parameter code and statistic code to the database, but will not produce any output items. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.ImportFromUSGSTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘ImportFromUSGS‘) |
Technical reference and usage tips | Parameter codes and statistic codes must be specified as defined in the USGS web services and described at https://waterservices.usgs.gov/docs/. For example, in order to download mean daily discharge in cubic feet per second, parameter code 00060 and statitic code 00003 must be specified. Complete list of USGS parameter codes is available at https://help.waterdata.usgs.gov/codes-and-parameters/parameters and complete list of statistic codes is available at https://help.waterdata.usgs.gov/stat_code. Most sites provide only a subest of parameter codes and statistics. Explore sites and availability of data using the Mapper application provided by the US National Water Information System: https://maps.waterdata.usgs.gov The name of the downloaded time series follows a pattern “USGS:\<siteNumber>:\<parameterCode>:\<statisticCode>”. Please note that USGS monitor their web services and the number of requests you can make per amount of time, or the volume of data you can download, may be restricted if your usage is identified as excessive. In order to make time series names more descriptive, the site name is appended to the time series ID. However, only the time series ID is used to establish whether a time series already exists, the site name is ignored. This is important for repeated execution. For example, time series USGS:12345678:00060:00003 will be stored as “USGS:12345678:00060:00003 EXAMPLE SITE” and you then rename it to “USGS:12345678:00060:00003 EXAMPLE SITE from USGS”. Next time you download time series USGS:12345678:00060:00003, it will be stored again as a new time series “USGS:12345678:00060:00003 EXAMPLE SITE”. Note that there is also a job task with similar functionality but the job task performs a few more actions than this tool. Specifically, the job task creates a feature class with point features representing individual USGS sites and it creates associations to the relevant downloaded time series. Use the job task to initialize the feature class and the set of time series, then use this tool to periodically append more recent time series data. |
TimeSeriesImport¶
Item | Description |
---|---|
Description | This tool is used to import time series from a variety of sources, depending on the chosen bridge. |
Input items | A time series in a format that is supported by the tool (see the list of bridges in the property control). An example could be a dfs0 time series. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. For some brides, such as Excel, an additional wizard must be filled out. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.TimeSeriesImportTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘TimeSeriesImport‘) |
Output Tools¶
To chart¶
Item | Description |
---|---|
Description | The "To chart" tool is used to plot one or more time series in a chart. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. |
Output items | A chart with the graphs of the input time series. |
API reference | DHI.Solutions.TimeseriesManager.UI.Tools.ToChart |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘To chart‘) |
To database¶
Item | Description |
---|---|
Description | This tool moves the input time series to another folder in the database. The time series can be renamed or have a suffix added to them. Note that the time series are removed from their original location. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. |
Output items | This tool has no output. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ToDatabaseTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘To database‘) |
To feature class¶
Item | Description |
---|---|
Description | This tool performs calculations on time series associated to a feature and adds the calculated value(s) as a new attribute in the attribute table. Note that the calculation is only carried out on the associated time series and only added for the feature that is associated to this time series. |
Input items | One or more time series that are associated to a feature in at least one feature class. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. The "feature class" field is a dropdown menu with the feature class(es) that the time series is associated to. If the time series is not associated to a feature class, it will be empty and the tool cannot run. |
Output items | The tool can be run either to a list, an attribute table, or to display the feature class. In all cases, the calculated value will be written to the attribute of the feature class or to a copy. NOte that if is written to a copy, it is not automatically saved. Also be aware that if not all features in the feature class have an associated time series, only the features with associated time series will appear in the copied feature class. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ToFeatureClass.ToFeatureClassTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘To feature class‘) |
To file¶
Item | Description |
---|---|
Description | The “To file” tool is used to export one or more time series, ensemble and/or group to files on the disk. |
Input items | The tool requires at least one time series, ensemble or group to be selected. |
Tool properties | The tool properties are: Directory structure option (): If the "Replicate sub-groups" option is selected, only the sub-groups to the group on which the tool is executed are replicated as folders on the disk. If the "Replicate full path" option is selected, a directory structure corresponding to the full group path, starting at the database root shall be replicated as folders on the disk. The root shall be in the Export directory. If "No sub-folders" is selected all selected time series shall be added to the Export directory, regardless of what groups they come from. Export directory: The selected time series and/or ensembles will be exported to the selected directory. Export format: The selected time series and/or ensembles will be exported to the selected format. Three formats are available: Export metadata: If the metadata export is enabled, it will be exported in one xml files per time series. |
Output items | This tool will not produce any output. |
API reference | DHI.Solutions.TimeseriesManager.Tools.TimeseriesExportTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('To feature class') |
To timeseries table¶
Item | Description |
---|---|
Description | This tool writes the input time series to a time series table. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control for a description. |
Output items | A time series table with the data from the input time series. |
API reference | DHI.Solutions.TimeseriesManager.UI.Tools.ToTimeseriesTable |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘To timeseries table‘) |
Probability distribution¶
Empirical CDF¶
Item | Description |
---|---|
Description | This tool derives the empirical cumulative distribution function of a given timeseries using different plotting position formulas to estimate the probabilities. |
Input items | One or more time series. |
Tool properties | The only tool property is the choice of plotting position formula: The different plotting position formulae are defined as shown below. |
Output items | A time series table, list, or table for each input item or a chart with a graph for each input item. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Distribution.Empirical |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.tools.CreateNew('Empirical CDF') |
Fit to distribution¶
Item | Description |
---|---|
Description | This tool aims to fit the chosen probability distribution to the given time series. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. It is necessary to select the distribution type and the method. Note that not all methods work with all distributions. For some tools there is an additional property. This can be "threshold" where all exceedances above this level are extracted. It can also be "Input type", which are different Method of Moments estimation methods. These can be the following (note that they are not all available for the same distributions): Bias correction of skewness I: Correction of the sample skewness using the Ishihara and Takase method. Bias correction of skewness II: Correction of the sample skewness using the Bobée-Robitaille formula. Lower bound quantile method I: Lower bound quantile estimator proposed by Iwai. Lower bound quantile method II: Lower bound quantile estimator proposed by Stedinger. Moments in Log Space: The parameters are estimated using the moments calculated from the logarithmic transformed data values. Moments in Real Space: The parameters are estimated using the moments calculated from the real data values. |
Output items | A list for each input time series containing the distribution parameters. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Distribution.ParameterEstimateTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.tools.CreateNew('Fit to distribution') |
Histogram¶
Item | Description |
---|---|
Description | This tool derives a histogram based on the given times series. The number of bins is derived as int(1.0 + 3.3*Log10(steps)). In principle each bin is equally large ((Ymax – Ymin) / nbins), but the tool attempts to construct a size rounded up based on the two most significant digits. So if bin size based on Ymin and Ymax is 5712,285 the tool will use 5800. Likewise the start of the first bin is based on Ymin, but rounded to fit the bin size. Histogram coordinates presented by the tool are in the middle of the bin. |
Input items | One or more time series. |
Tool properties | The tool has no properties. |
Output items | A list, chart, or table for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Distribution.HistogramTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.tools.CreateNew('Histogram') |
QA-QC¶
Check time series tool¶
Item | Description |
---|---|
Description | The Check time series tool checks the values of one or more time series, according to a specified criterion, and returns a boolean with the result of the check. The following check methods are available: |
Input items | The tool accepts one or more time series as input. |
Tool properties | The tool properties are listed below. Select a property to get a description in the property control and see above for more details on the different methods. |
Output items | For each input time series there will be produced one output boolean that can be viewed in a table or a list. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Hierarchy. ICheckTimeseriesTool |
Scripting | tool = _app.Tools.CreateNew(typeof(CheckTimeseriesTool)); |
Flag outliers¶
Item | Description |
---|---|
Description | This tool adds a user specified flag to the values in a time series that falls within a specified criterion. Flags can be added to the original input time series, or a copy of the series. The available criteria are: |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One time series will produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.FlagOutlierTool |
Scripting | script |
Technical reference and usage tips |
Quality flag filter¶
Item | Description |
---|---|
Description | The quality flag filter tool can be used to process the flagged values of the input time series. Three options are available: |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One time series will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.QualityFlagFilterTool |
Scripting | script |
Soil Erosion¶
Soil Erosion Rainfall Erosivity (R) (extended)¶
Item | Description |
---|---|
Description | This tool is meant for calculating rainfall erosivity for the RUSLE soil erosion equation using "raw" rainfall data, i.e. time series from stations as opposed to the Rainfall Erosivity (R) tool in the GIS manager which requires an input of distributed rainfall in a raster. Brief overview of the tool: 1. Resample time series according to the interval chosen. 2. Identify start and end time step of a rainfall event. The start time step is the first time step with a value different from 0 following a time step with a value equal to 0. The end time step is the last time step with a value different from 0 preceding a time step with a value of 0. 3. The accumulated value for each event is calculated and all events with accumulated rainfall below 12.7 mm are discarded. 4. For the remaining events, the hourly rate is first calculated ([hourly rate] in the energy equation). Then the rainfall value (if the input time series is a rate)([rainfall value] in the energy equation. Finally, the energy for each time step is calculated as E = 0.29 * (1 – 0.72 * exp(-0.05 * [hourly rate])) * [rainfall value]. 5. For each rainfall event the higher 30-minute rainfall period in mm/h is identified. This is the I_30 value. 6. The rainfall erosivity (EI_30) is founds as the sum of of energy for all time steps in the event multiplied by the I_30 value and multiplied by a multiplication factor based on the table below. 7. The RUSLE R-factor is calculated as the sum of all rainfall erosivity values for all events divided by the number of years in the time series. 8. Thiessen polygons for the rainfall stations are intersected with the catchment feature class. The intersection feature class is extended with a attribute R with R-values for the corresponding station. Finally, the feature class is converted to a raster. |
Input items | One or more rainfall time series that are associated with (a) rainfall station(s). Note that the variable for the time series must be rainfall or rainfall rate. A feature class for the catchments and a feature class for the stations (note that this must be the stations to which the time series are associated. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A raster with the R-values. |
API reference | DHI.Solutions.GISManager.Tools.SoilErosionRTool.SoilErosionTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Soil Erosion Rainfall Erosivity (R) (extended)‘) |
Time series processing¶
Append¶
Item | Description |
---|---|
Description | This tool is used for appending values on an existing time series in the database. |
Input items | A time series in ASCII or Excel format. |
Tool properties | When opening the tool, click "Run" without filling in the tool properties. This opens the form below where the file can be chosen and the characteristics can be specified. After appending the values, the changes can be saved. |
Output items | There is no output, but if the changes are saved, the original time series will be overwritten with one that has the new values appended. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ImportTools.AppendValuesTools |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Append Values‘) |
How to use the Append Tool (“Append_timeseries” option)
Advanced statistics¶
Item | Description |
---|---|
Select two time series from the Time series explorer (using the Ctrl key). | |
From the Tools Explorer window, select the ‘Append’ tool (within the group called Time series processing). Make sure that the Append option is set to ‘Append_timeseries’ (default). Select an appropriate date that will form the start period from where the more recent time series will be appended to. Note: make sure there is a date overlap in both the time series, and that the specified date also overlaps both of the time series. |
|
Click on the Run button and select whichever option, i.e., “Run (To chart) | |
Based on the type of run option selected in the previous step, you should now see either a chart or table, with the one time series appended to the master time series. The chart legend or table title will include the word ‘appended’ in brackets. This appended dataset is temporary. | |
To save the appended time series to the database, do the following steps for either option: From chart view: Click on the item in the legend, then right-click and select ‘Save as’. Change the name of the time series (optional) and select the group name (optional). The new appended time series will now be created as a new time series item in the database. |
|
From tabular view: Click on the save dropdown icon and select ‘Save as’. Change the name of the time series (optional) and select the group name (optional). The new appended time series will now be created as a new time series item in the database. |
How to use the Append Tool (“Append_value” option) |Item|Description| |:-|:-| |Select a time series from the Time series explorer. From the Tools Explorer window, select the ‘Append’ tool. Make sure that the Append option is set to ‘Append_value’ Under Tool settings, specify a date and value to append at the end of the selected time series.| |Click on the Run button and select whichever option, i.e., “Run (To timeseries table)”. The value that was specified will now be appended to the specified date. To keep the changes, ensure to ‘Save as’ the newly appended timeseries.||
How to use the Append Tool (“Append_last_value” option) |Item|Description| |:-|:-| |Select a time series from the Time series explorer. From the Tools Explorer window, select the ‘Append’ tool. Make sure that the Append option is set to ‘Append_last_value’ Under Tool settings, specify a date that the last value from the selected time series must be appended to.|| |Click on the Run button and select whichever option, i.e., “Run (To timeseries table)”. The date that was specified will now be appended to using the last value from the selected time series (i.e., the same value from the last time step now shows at the specified date). To keep the changes, ensure to ‘Save as’ the newly appended timeseries.||
Create timeseries¶
Item | Description |
---|---|
Description | The Create time series tool can be used to create a new time series using an existing time series as template. The tool will accept one or more time series as input. For each time series there will be produced one output time series. The name of the output time series will be the same as the name of the corresponging input time series. When the tool is executed, the input time series are processed one at the time. The new time series are exact clones of the input time series, with the exceptions that: |
Input items | One or more time series. |
Tool properties | The tool has the following properties: |
Output items | One output time series will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Hierarchy. ICreateTimeseries |
Scripting | To create a new instance of the tool in the scripting environment use: tool = _app.Tools.CreateNew(typeof(CreateTimeseries)); |
Extract time period¶
Item | Description |
---|---|
Description | Extracts a specified period from the input time series. This is done at the exact start and end dates, implying that if a time series does not have a time step at the start/end times, it will be added. The tool returns the extracted time series. Notice that the input time series will not be modified. |
Input items | The Extract period tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One time series will produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ExtractPeriodTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Extract time period‘) |
Technical reference and usage tips |
Moving Average¶
Item | Description |
---|---|
Description | This tool adds calculates the moving average for a user specified window width. |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One time series will produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.MovingAverageTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Moving Average‘) |
Technical reference and usage tips |
Rate of change¶
Item | Description |
---|---|
Description | This tool computes the rate of change over a given time step (second, minute, hour, or day). |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A time series or list for each input time series or a chart with a graph for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Processing.RateChangeTool |
Scripting | To create a new instance of the tool in a scripting environment use: tool = app.Tools.CreateNew('Rate of change') |
Replace value tool¶
Item | Description |
---|---|
Description | The Replace values tool can be used to replace any given value (“Replace value”) or range of values in a time series by a new value (“Replace with”) (e.g. the user can specify that all values = 5 shall be replaced with the value 2.5). The tool accepts one or more time series as input. For each time series there will be produced one output time series. The name of the output time series shall be the same as the name of the input time series. The following methods are available: |
Input items | The tool will accept one or more time series as input. |
Tool properties | The visible properties for the tool varies with the chosen Replace option. An example for the Replace_range_with_constant option is shown below.Select a property in the grid to get a description. |
Output items | For each input time series there will be produced one output time series. The name of the output time series will be the same as the name of the input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Hierarchy. IReplaceValuesTool |
Scripting | Tool = _app.Tools.CreateNew(typeof(ReplaceValuesTool)); |
Resample¶
Item | Description |
---|---|
Description | The resample tool is used to change the time step of a time series into a user specified time step. It is possible to resample into larger and smaller time steps. |
Input items | The use of the resample tool requires that at least one time series has been selected. If more than one time series are selected, the same user specified options will be applied to all the selected time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One resampled time series for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.ResampleTool |
Scripting | script |
Technical reference and usage tips | If a time series is resampled into a larger time steps, the resulting values will be calculated as:Instantaneous: The values of the larger steps are calculated by linear interpolation between the two nearest small time step values. Accumulated: The time average of the small-step accumulation rate is used to derive the accumulated values for the large time steps. Mean step accumulated time series: The large time step is the time averaged value of the sub-steps. Step accumulated: The temporal average of the small-step accumulation rate is used to derive the step accumulated values for the large time steps. Reverse mean step accumulated: The large time step is the time averaged value of the sub-steps. If the time series are resampled into smaller time steps, the resulting values are calculated as: Instantaneous: The values of the sub-steps are calculated by linear interpolation between the two nearest large time step values. Accumulated: The accumulation rates of the large time steps are used to derive the accumulated values for the small time steps. Mean step accumulated time series: The same values will be used for the sub-steps as for the large time step. If a sub-step is covered by two large time steps, the temporal average is used. Step accumulated: The temporal average of the large-step accumulation rate is used to derive the step accumulated values for the small time steps. Reverse mean step accumulated: The same values will be used for the sub-steps as for the large time step. If a sub-step is covered by two large time steps, the temporal average is used. |
Synchronize¶
Item | Description |
---|---|
Description | The Synchronize tool is used to resample a set of time series into a common time axis. The new common time axis is defined by combining the axes of all input time series. One synchronized time series will be produced for each time series. |
Input items | The Synchronize tool requires at least two time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | One synchronized time series will be produced for each input time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.SynchronizeTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Synchronizer‘) |
Technical reference and usage tips | The value at any new time step is calculated according to the description of the Resample tool. |
Time Shift¶
Item | Description |
---|---|
Description | This tool can be used to shift the values of a time series. The values can be shiftet with a fixed value, or the time can be shifted with a fixed number of hours, minutes, and/or seconds. |
Input items | One or more time series. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A time series or list for each input time series or a chart with a graph for each time series. Note that the time series are not saved automatically, but there is an option to overwrite the original time series. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Processing-ShiftAndLagTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('Time Shift') |
Timeseries Calculator¶
Item | Description |
---|---|
Description | This tool performs Calculation on input timeseries using syntax commonly found in spreadsheet programs. |
Input items | One or more timeseries. |
Tool properties | Formula: The formula to apply to the input timeseries. Use syntax normally found in spreadsheets, but instead of cell references, enter timeseries names as mapped in the Mapping property within square brackets. E.g. “[mytimeseries]” The tool can also produce one output for each input in case “[value]” mapping is used, meaning the current timeseries being iterated. Name Mapping: The mapping of timeseries names used in the formula to the input timeseries. Do not include brackets. |
Output items | A timeseries representing the result of the calculation. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Processing |
Scripting | script |
Technical reference and usage tips | The syntax used for the formula is the same as used in the Spreadsheet Manager. Formulas can be tested in Spreadsheet Manager and then copied into the tool properties, after replacing cell references with the mapped raster names. |
Unit conversion¶
Item | Description |
---|---|
Description | This tool can be used to convert the units of a time series. Note that the units can only be changed within the limits of the variable type (eg. a time series of the type Rainfall can only have units that describe a depth). |
Input items | One or more time series. If there are more time series, the must be the same variable type. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A time series or list for each input time series or a chart with a graph for each input time series. The values will be in the new units. Note that they are not saved automatically and that the original time series is not overwritten. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Processing.UnitConversionTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('Unit conversion') |
Value type conversion¶
Item | Description |
---|---|
Description | This tool converts the value type in the time series, eg. instanteneous to step accumulated. |
Input items | One or more time series. They do not need to have the same original value type. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | A list or time series for each input time series or a chart with a graph for each time series, with the chosen target value type. Note that the time series are not automatically saved and that the original time series is not overwritten. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Processing.ConvertToValueTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew('Value type conversion') |
Differences¶
Item | Description |
---|---|
Description | This tool will calculate the difference between a specified master time series and the remaining input time series. The input time series shall be synchronized before applying the Differences tool. |
Input items | The tool requires at least one time series to be selected. |
Tool properties | The tool properties are listed below. Select a property in the property control to get a description. |
Output items | If the total number of input time series is N, the number of output time series will be N-1. |
API reference | DHI.Solutions.TimeseriesManager.Tools.TSeriesDifferencesTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Differences‘) |
Technical reference and usage tips |
Convert to ensemble¶
Item | Description |
---|---|
Description | The “Convert to ensemble” tool will take two or more time series having the same properties (time step, unit and variable), and convert them to a single ensemble time series. When the tool is executed, it will add the input time series as members to a new ensemble time series according to an index that may (optionally) be appended to the name of the input series. In the example below, the time series appended by “#0” will be added as the first member, the time series appended by “#1” will be added as the second member and so on. If some of the selected time series does not contain the “#” appendix, they will be added in the order of selection, after those that contained an appendix. It is allowed to have holes in the number sequence, such that if e.g. #2 and #4 are missing, the remaining time series will still be converted to an ensemble. |
Input items | The tool requires at least two time series to be selected. |
Tool properties | In the tool properties the user can specify the name of the output ensemble, as well as target group and overwrite option that determines how it is handled if the target group already contains an ensemble with the specified name. |
Output items | This tool will not produce any output. |
API reference | DHI.Solutions.TimeseriesManager.Tools.Processing. ConvertToEnsembleTool |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘Convert to ensemble‘) |
Weather generators¶
Nearest neighbour resampling¶
Item | Description |
---|---|
Description | The “NearestNeighbourResampling” tool is type of weather generator used to generate daily time series ensembles of weather variables based on historical time series. The tool analyses historical time series from one or more locations of different variable types and shuffled the historical record to produce ensembles of time series with consistent spatiotemporal statistics. |
Input items | The tool requires one or more time series with the following conditions: |
Tool properties | The tool properties are: Number of ensemble members: The tool will generate one or more weather time series. The number of ensemble members must be greater than zero. Number of years to generate: The length of the desired generated time series must be an integer greater than zero. Start year for generation: The tool generates time series starting Janary 1st from the year specified. The start year must be an integer. Number of days within search window: The number of days within the moving window, centered on the calendar day of interest to find the best nearest neighbour. A small number preserves seasonality but reduces the amount of shuffle. Number of nearest neighbours in the feature vector (k): Number of most similar days to choose from within the feature vector. A small k leads to duplications of historical runs of successive days in the simulated data. |
Output items | For each input time series there will be produced one output ensemble. Each ensemble output may have one or more members. |
API reference | DHI.Solutions.TimeseriesManager.Tools.NearestNeighbourResampling |
Scripting | To create a new instance of the tool in the scripting environment use: tool = app.Tools.CreateNew(‘INearestNeighbourResampling‘) |
Technical reference and usage tips | The tool follows the implementation outlined in the scientific article: Buishand, A. & Brandsma, T., “Multisite simulation of daily precipitation and temperature in the Rhine basin by nearest-neighbour resampling” , Water Resources Research, Vol 37, No 11, 2001. With the exception that the standardized indices are not approximated using the summary statistic in equation 6 & 7. Instead, the nearest-neighbour is calculated for all precipitation and temperature variables. |
How to use the Weather generator¶
This How To guide will illustrate the use of the weather generator tool, based on the nearest neighbor resampling technique. This function is used to generate ensemble time series to use as weather forcing to run multiple simulations. The result of such simulations has the form of ensemble time series output/s. The tutorial will also show how to run ensemble simulations using the generated weather data and work with the simulation results. Finally it will illustrate how to import external weather time series and work with them as ensemble time series.
Neighbor resampling weather generator tool¶
The weather generation tool creates daily time series ensembles of weather variables based on historical time series. It analyses historical time series from one or more locations of different variable types, shuffles the historical record and produces an ensemble of time series with consistent spatiotemporal statistics.
The algorithm uses a Nearest-Neighbour method to calculate likeness of the weather between days as described in the paper:
Buishand, A. & Brandsma, T., “Multisite simulation of daily precipitation and temperature in the Rhine basin by nearest-neighbor resampling”, Water Resources Research, Vol 37, No 11, 2001.
We will give an example of how the weather generator tool simulates weather by shuffling historical time series data (see following figure). For each day of the year (DOY) to simulate (eg. day 50) a multi-day search window is centred on the preceding day (eg. day 49) for each year in the historical dataset. For example, for a search window of 7 days, the closest weather matches around DOY 49 is searched (between DOY 46 and 52 in all years in the historical record). Once the ‘k’ closest weather matches are selected from all the time windows, one is chosen according to a discrete probability distribution that gives a higher probability to the closest neighbor. The following day’s data is used for DOY 50 in the generated time series. The time series is initialized by randomly selecting the value corresponding to a January 1st from the historical record.
The tool is designed such that the user selects one or more historical time series with the following conditions:
-
At least one of these time series is either precipitation or temperature
-
The time series selected contain at least 1096 overlapping days (3 years)
-
The time series contain daily values without gaps
The user also specifies:
-
The number of ensemble members to generate
-
The number of years to generate
-
The start year for the generated ensembles (which will begin January 1st)
-
The number of the “k” nearest neighbours
-
The number of days within the search window
Illustration of the nearest-neighbour weather generator. To simulate the value of DOY 50 the closest neighbour, e.g. the matching of the value of the previous day, DOY 49, is searched in the historical time series. The value of the following day is assumed to be the value of the day of simulation.
Case study¶
The model setup used in this tutorial is a simple MIKE 11 (M11) rainfall runoff model developed for the city of Aarhus. Three catchments and two river branches are represented in the model. The catchments are those of Aarhus city, Lyngbygård and Skibby; the branches are those of Aarhus Å, in the Skibby catchment, and Lyngbygård Å, in the Lyngbygård catchment. The simulated variables of interest are the discharge at the stations Skibby, along Aarhus Å branch, and Lyngbygård, along Lyngbygård Å branch, against which the model was calibrated.
The default simulation period is a 20-years period running from 2-1-1990 to 31-12-2009.
In this tutorial an ensemble of input time series of temperature, precipitation and evapotranspiration will be generated by the weather generator tool for the three catchments. The produced model output will be an ensemble of river discharge time series at Skibby and Lyngbygård stations.
Import model, create and populate scenario¶
In order to be able to import and work with the Aarhus model using the MC platform, the steps illustrated in the following have to be done. To get help on how to perform the below operations, as well as if you have any doubts on how to use MC, please, refer to the help manual.
-
Register the model
Register the Aarhus model in MC with the name “Aarhus M11”. The Scenario for the model is created during the registration process. You can keep the default names for the model group and the name of the scenario.
Note: remember that before being restarted, the original model must be run with M11 and the results must be generated.
-
Populate the model scenario with the model input and output variables that will be changed in the exercise
These are the input weather time series of temperature, rainfall and evapotranspiration at the three catchments and the M11 output of the discharge time series at Skibby and Lyngbygård stations, all listed in the tables below. Note that the same weather time series are used at the Skibby and Lyngbygård catchments and also that the temperature input is the same in all three catchments.
Input time series
Variable | Time series | Catchment |
---|---|---|
Temperature | DMI_Temperature_Aarhus_Total_RR.dfs0 | Skibby, Lyngbygård, Aarhus by |
Evaporation | DMI_PE_Aarhus_Total_RR_cc_v5.dfs0 | Skibby and Lyngbygård |
DMI_PE_ Aarhus _Total_RR_cc_v3.DFS0 | Aarhus by | |
Rainfall | DMI_rainfall_Aarhus_min_runoff_RR.dfs0 | Skibby and Lyngbygård |
DMI_rainfall_Aarhus_by_RR.DFS0 | Aarhus by |
Output time series
Variable | Time series |
---|---|
Runoff | RunOff, SKIBBY, 119.000 - 1 - SIM_2012_FF_NAM_v9_full.res11 |
RunOff, LYNGBYGÅRD, 131.000 - 2 - SIM_2012_FF_NAM_v9_full.res11 |
Tip: multiple variables can be included in the scenario at the same time. To select more than one variable, hold the ctrl key while selecting the variables.
-
Set hotstart date
The MC adapter for M11 is currently not importing the initial condition of the hotstart file of the original model setup, if the date is different than the start date of the simulation. Therefore this entry has to be set manually. This is done in the scenario properties window. Set the initial condition for reading the hotstart file to the one in the original model, ie. to 1-1-2006 00:00:00.
-
Run the baseline simulation
Run the model once to generate the results for the baseline scenario. These can then be compared to the results of the ensemble simulation.
You should now be able to find the simulation results in the MC time series explorer. You can try to plot them in a chart, for example, or view them in a table.
Generation of weather time series¶
This section illustrates through an example how to create ensembles of weather time series using the weather generator (WG) tool of MC. For this exercise, an ensemble of climate time series will be generated for all the weather input variables included in the model scenario.
-
Select the time series and the WG tool
We want to generate an ensemble of time series for all the 5 weather records included in the input scenario. To do that, first select the input time series for which you want to create the ensemble. Tip: the WG tool can run on multiple time series, so you can select all time series at the same time.
-
Select and configure the WG tool
Select the weather generator (WG) tool from the tools explorer. You can then configure the tool entries in the tool property window.
For this exercise we will generate an ensemble of 10 members for each time series, each 20-years long and starting at the first year of the simulation, 1990. Set the WG entries accordingly and keep the other WG parameters to the recommended values with a search window of 61 days and k=5.
-
Run the tool
When the tool entries are set, you can execute the tool, for example running it to a chart.
This command generates an ensemble of 10 time series for each input time series selected. However, only the mean of the generated ensemble is shown in the generated plot.
Note: remember that it is possible to apply the weather generator tool only to time series containing daily values and without missing values. If the time series are not on daily equidistant time axis, you can use the resampling tool available in the tools explorer to transform them in the required format (Time series processing -> Resampling tool)
-
Save the weather ensemble time series to the database
The generated ensembles should be saved to the database in order to be used as input time series for the ensemble scenario. There are several options to save time series to the database. One of them, which is easy to use when working with few time series, is to save them manually from the generated plot.
First, create a sub-folder in the database and rename it “WG ensemble TS”. Then select a time series from the chart legend, right click on it and choose “save as”. In the window that appears, select as “Group name” the WG ensemble TS subfolder. The time series is added to the subfolder and the postfix “(Generated)” is added to its original name. Note that ensemble time series are indicated in the time series manager by the symbol
.
Repeat this step for each of the 5 weather time series.
Different operations can be performed on ensemble time series. For example, all the members of the ensemble can be added to the same chart or opened in a table, and several statistics can be calculated for the ensemble. We will illustrate all these options when looking at the ensemble simulation results.
Creating a tool sequence in MC¶
Alternatively to performing steps 3 and 4, you could also have created a sequence of commands to both run the WG tool and save the generated time series into the specified folder. In this way, you create a sequence of commands that can be saved in the toolbox and applied in the same way as any other pre-defined tools.
This option can save a lot of time, especially when working with a large number of time series. The following steps illustrate how to work with sequences in MC.
-
As previously done, select the 5 input time series for which you want to generate weather ensembles from the time series explorer.
-
In the tools explorer select the nearest neighbor resampling tool. Check that it is configured as previously described, otherwise change the entries. Right click on the tool and choose the option “Add to sequence”.
-
A new window appears showing the sequence of tools to run. After the “Selected Object“ tool, it contains only the “Nearest neighbour resampling” tool. We need to add the command to save the generated time series to the database.
-
Select from the tools explorer the “To database” tool. In the tool property window specify as “Save to group” entry the folder “WG ensemble TS”, so that the folder is created, if not existing, and the generated time series are saved into it. As previously done, add the tool to the sequence.
-
Now that the sequence is created, we need to save it in the toolbox. Do it by clicking on the save icon on top of the sequence window. The sequence is now saved to the toolbox in the folder “Stored Sequence” with the default name “My sequence_1”. Right click on the sequence name and rename it, for example as “WG_and_save_tool”.
-
You can now select again the 5 input time series and run the tool. You can run it from the sequence window, by clicking the run icon
and then click “Run Entire Sequence”. Alternatively, you can also run the tool from the property window (note that, in this case, it does not matter which run option - to chart/list/time series table - you select. Since only the commands in the sequence are run, no plots, list or time series will be displayed in the data view window).
The ensemble time series are generated and saved into the WG ensemble TS folder.
To open the sequence window, for example if you need to check the entries and edit its tools, right click on the name of the sequence and choose “Edit”.
Ensemble scenario simulation¶
The ensemble weather time series will be the input for the new simulation to execute. In this case, an ensemble of 10 simulation results will be produced. This section will explain how to set up a new scenario and run a simulation using the weather ensemble time series as input.
-
Create a new scenario
The only difference between the baseline scenario and the ensemble scenario is in the weather inputs. All the other parameters are the same, including the scenario inputs and outputs we want to modify or view after running a simulation. To create a copy of the existing scenario with the above properties use the “clone” option.
You can rename the new scenario, e.g. as “Ensembles scenario of Aarhus M11”.
Note: creating a new scenario from the imported model will also create a duplicate of the scenario we have just worked with. The only difference is that, in this case, the scenario is not populated and the model inputs and outputs of interest have to be included again. |
---|
-
Substitute the historical input time series with the ensemble weather time series
The generated weather ensemble time series must be associated to the input variables of the new scenario. To do that, first open the ensemble scenario on the data view and then move to the time series explorer. Drag and drop each time series from the time series explorer to the related scenario input variable in the scenario data view. Do that for all the 5 time series, carefully checking that the names of the time series and variables for which the association is made are the same.
The full path of the time series that has been associated to a variable can be seen in the fly-by text when holding the pointer above the variable. This is useful for checking that the scenario variables contain the correct generated time series.
-
Ensemble simulation execution
After all the inputs variables have been associated to the weather ensemble ones, run a simulation for the ensemble scenario.
When an ensemble simulation is executed, a corresponding number of sub-simulations is run and the resulting output time series are assembled together.
The number of simulations, N_sim, is dependent on the number of ensemble members in the input time series. N_sim is determined as the minimal number of time series members in any input time series having more than 1 member. For any other input time series having only one member, this member is used in all model simulations. If the time series have more than one member, then the members from 1 to N_sim are used.
In this case, since all the time series ensembles have 10 members, 10 different simulations will be executed for the scenario.
Viewing of results and post processing¶
When an ensemble simulation is executed, a corresponding number of model simulations is run and the resulting output time series assembled together in an ensemble time series, which is indicated in the time series explorer by the symbol .
By default the commands “add to new chart”, “add to new table” as well as the tools of the time series explorer, when applied to an ensemble time series, perform operations on a time series that is the mean of the ensemble members. The single ensemble members can be extracted and inspected as well, as explained in the following.
In this tutorial, the generated ensemble outputs to analyze are the discharge at Lyngbygård and Skibby stations. Here we will work with Skibby time series only. You are welcome to inspect the output runoff time series at Lyngbygård as well.
-
Visual inspection of statistical properties of a time series ensemble
You can make a plot of the mean ensemble runoff at Skibby using the command “Add to new chart” “All”. This command opens a chart window showing the mean discharge at Skibby station.
You can perform a visual inspection of some statistical properties of the time series ensemble using the MC chart tools available in the chart toolstrip. These tools allow you to add the max/min range of the ensemble, , and the +/- one standard deviation from the mean of the ensemble, .
To make these tools available, first select the chart time series in the chart legend (left click on it).
First, add the min/max range of the ensemble to the chart. The new series will have the name of the original series appended to the name of the selected statistics.
In the chart the max/min range appears by default as a colored area, which covers the mean of the ensemble. To make the ensemble mean visible again, right click on the Skibby runoff time series line in the chart legend and select “Send to back”.
You can change how the elements in the chart are displayed by selecting them in the chart legend and change their properties in the time series property window. You can, for example, set the primary color of the min/max range area to white and choose red as border color. For the Skibby runoff time series, you can set the line color to a darker blue.
If you move to the “Statistics” time series window, you can check some statistics on the selected time series, such as average, maximum and minimum values, missing values and standard deviation.
After applying the new format settings, zoom into an area of interest of the chart. Tip: to zoom in the chart click and hold on the start time of the period that shall be zoomed in. Hold and drag to the end of the period. When releasing, the chart will zoom in on the selected period. Use the scroll-bar to move the zoom window.)
You can notice how the variability of the discharge in the ensemble increases with larger discharge values and with discharge peaks. To further explore this, you can visually check the standard deviation of the ensemble.
To add the standard deviation range to the chart, select the Skibby runoff time series from the chart legend, then apply the +/- one standard deviation tool. The +/- one standard deviation is calculated and added by default as a new series to the chart as a filled area. You can change its appearance as previously done for the min/max range.
-
Another ensemble statics tool
Another tool is available in the time series toolbox to calculate statistics on ensemble time series, the “Ensemble statistics” tool. Like some of the previously used tools, it can calculate the maximum, minimum, mean and standard deviation of the ensemble. Additionally, it can compute the quartile and the exceedance and non-exceedance probabilities of the ensemble. All these statistics are calculated for each day of the time series and can be added to a chart, as well as opened in a table.
You can try to create some plots with these statistics for the output discharge ensemble time series.
-
Extract ensemble members
So far we have worked with the mean of the ensemble and some statistical properties of the ensemble. We will now learn how to extract the time series of the ensemble and work with them.
In the time series explorer, select the ensemble output of the runoff at Skibby station. In the time series tools explorer select the tool “Extract ensemble members”. This tool extracts the time series from the ensemble and saves them as single time series to the database. Specify the path /Ensemble output/Skibby as destination “Target group” in which the time series will be saved. Run the tool.
A new subfolder called Skibby is created and the time series are saved into it. Each time series name has a suffix in the form #n with n ranging from 0 up to (total number of ensembles -1). You can notice that the symbol of these time series is the one of a single time series: .
Plot all the ensemble members in the same chart (select simultaneously all the time series and select “Add to new chart” “All”).
You can zoom into the plot, to be able to inspect the different patterns of the ensemble members.
As an exercise, you can add to this plot the mean of the ensemble and again, the max/min range of the ensemble. You can format the average and the range in order to make them easily visible in the chart. Check that the range includes all members.
-
Duration curve plots
You can work with the member time series as any kind of single time series and apply to them the tools from the tools explorer. You can, for example, make a duration curve plot for the discharge ensemble.
Select all the ensemble members from the time series explorer. Choose the Duration curve tool from the tools explorer and run it with the option “to chart”.
You can now add the duration curve of the average ensemble time series to this chart. Following the previous steps, run the duration curve tool on the mean ensemble time series with the option “To chart”. A new duration curve plot is added to the same window of the ensemble plot. You can then move the mean duration curve to the plot of the ensemble members curves. To do so, select the time series in the plot legend, right click and choose “Move to existing chart area Legend”.
The duration curve of the average discharge is added to the plot of the ensemble members. You can then format the duration curve of the average discharge, for example choosing a black dash line and increasing its thickness to 2.
Using external data to run climate simulations¶
In the previous part of the tutorial, we showed how to generate weather scenarios using the weather generator built in MC and use them to run a model to create hydrological scenarios. It is also possible to use MC to make ensemble model runs using external climate time series. To illustrate this feature we consider a climate change study that uses climate data from an ensemble of climate model scenarios. The time series of different climate scenarios can be imported in the MC database, grouped an ensemble time series and used as weather forcing for any hydrological model. This section illustrates how to do it.
We continue working with the Aarhus model and we try to run it using some climate change weather time series available as .dfs0 files.
The weather time series used in this tutorial are produced using 15 different combinations of global and regional climate circulation models. The climate projections are based on the emission scenario SRA1B for the prediction year 2080.
The weather data available for the climate change projections have a larger spatial extent than that of the three catchments defined in the model. Therefore, only one precipitation, potential evapotranspiration and temperature time series is available for the area. So, differently than the baseline model we previously worked with, in this scenario the three catchments will have the same weather forcing.
-
Import time series
MC offers several tools to import time series files into the platform, depending on the format of the files containing the data. You can find them in the time series tools explorer, after you have selected any of the folders in the time series explorer. Specific tools are available to import data from ASCII, .dfs0, GRIB, NetCDF files.
When you select one of these tools, you can see the respective property window populated with the entries to specify. You can notice that these tools allow you to import time series from a single file, a folder or a batch file. In the first case, only the selected file is imported; in the second case all the files contained within the selected folder are imported; while, in the last case, the import settings are loaded into the time series import wizard from a comma separated file. You can also notice that the imported files can be saved in a specific folder and also renamed during the importing process.
The generic “Time series import” tool allows to access and import even a larger variety of files, whose type can be read in the selection menu in the property file of the tool. This tool, however, allows to import only one time series at a time.
In our case, the climate data describing precipitation, potential evapotranspiration and temperature are in .dfs0 format and are contained in a folder called CC time series. Therefore we choose to import them using the “IMPORT FROM DFS0” tool and, in the tools properties, we specify “Folder” as “Import from” option. Set the other tool entries as shown in the figure below. Then run the tool.
The “Climate Change data” folder is created in the time series explorer and populated with the imported time series. 15 climate time series are imported for each weather variable. Each time series has the name of the file of origin followed by a postfix of the form![data_type_n] with data_type that is evaporation, temperature or Precip and n, a number ranging from 1 to 15.
-
Group time series as ensemble time series
The time series tool “Convert to ensemble” is used to group a set of time series into an ensemble time series. In order to use it, you need to first select all the time series of a specific weather type that you want to include in the ensemble. In the tool property window specify the name of the ensemble time series and also that of the folder in which you want the variable to be saved (here we use the names CC_Evaporation, CC_temperature and CC_rainfall for the variables and “Climate Change ensembles” for the folder). Then run the tool. Do it for the 3 different climate variables.
-
Ensemble scenario simulation
Once the ensembles are created, they can be used as input time series to run a climate simulation with the Aarhus model. You can proceed as done before when setting up and running a simulation with ensemble time series inputs. Refer to the previous sections of this tutorial or to the MC help manual if you need help or want to know additional details on how to proceed.
-
Create new scenario (remember to use the “Clone model” option)
-
Associate climate ensemble time series to model input variables
-
Run model simulations
Note that you can extend the simulation end date to 31-12-2009 and generate 20 years of results.
-
Check outputs
As previously done for the ensemble results created using the weather generator, you can use the tools available in the time series toolbox to inspect and analyze the climate change simulation results.
-
Data tools¶
Timeseries query¶
Item | Description |
---|---|
Select two time series from the Time series explorer (using the Ctrl key). | |
From the Tools Explorer window, select the ‘Append’ tool (within the group called Time series processing). Make sure that the Append option is set to ‘Append_timeseries’ (default). Select an appropriate date that will form the start period from where the more recent time series will be appended to. Note: make sure there is a date overlap in both the time series, and that the specified date also overlaps both of the time series. |
|
Click on the Run button and select whichever option, i.e., “Run (To chart) | |
Based on the type of run option selected in the previous step, you should now see either a chart or table, with the one time series appended to the master time series. The chart legend or table title will include the word ‘appended’ in brackets. This appended dataset is temporary. | |
To save the appended time series to the database, do the following steps for either option: From chart view: Click on the item in the legend, then right-click and select ‘Save as’. Change the name of the time series (optional) and select the group name (optional). The new appended time series will now be created as a new time series item in the database. |
|
From tabular view: Click on the save dropdown icon and select ‘Save as’. Change the name of the time series (optional) and select the group name (optional). The new appended time series will now be created as a new time series item in the database. |
How to use the Append Tool (“Append_value” option) |Item|Description| |:-|:-| |Select a time series from the Time series explorer. From the Tools Explorer window, select the ‘Append’ tool. Make sure that the Append option is set to ‘Append_value’ Under Tool settings, specify a date and value to append at the end of the selected time series.| |Click on the Run button and select whichever option, i.e., “Run (To timeseries table)”. The value that was specified will now be appended to the specified date. To keep the changes, ensure to ‘Save as’ the newly appended timeseries.||
How to use the Append Tool (“Append_last_value” option) |Item|Description| |:-|:-| |Select a time series from the Time series explorer. From the Tools Explorer window, select the ‘Append’ tool. Make sure that the Append option is set to ‘Append_last_value’ Under Tool settings, specify a date that the last value from the selected time series must be appended to.|| |Click on the Run button and select whichever option, i.e., “Run (To timeseries table)”. The date that was specified will now be appended to using the last value from the selected time series (i.e., the same value from the last time step now shows at the specified date). To keep the changes, ensure to ‘Save as’ the newly appended timeseries.||