Source: Innovyze Support Portal
In part 1 we imported rainfall into a TSDB from an existing rainfall event file. In part 2, we will create rainfall in TSDB from scratches.
- prepare the source data
- create a TSDB
- connect to the data source
- add TVD connectors
A great way for new users to learn how TSDB works is to import from an existing model (see part 1), and then study how the import tool sets up the TVD connectors.
In this example, we will recreate the model in part 1 by connecting to a csv file.
Prepare the CSV files
First, let’s copy the rainfall data from the event file to excel and save it as a csv file.
Refer to the help file “Time Series Database” for more information on other formats that can be connected to TSDB.
For simple CSV format,
- there is no header
- the first column is time, and it should be dd/mm/yyyy hh:mm format
- the second column is value
It is important to leave the header out, otherwise, it will be treated as a data point from 1900 and the time series won’t plot correctly.
Prepare the time series data for rg1, rg2 as rg1.csv, rg2.csv
Create the TSDB
Next create a TSDB and setup the data source.
- Create the TSDB
- add a new entry in the data sources tab
- give it a name and choose “Simple CSV”
4. Paste the folder path where the csv file is saved
5. It is important to have time zone set, otherwise it will default to system time zone which can vary when the model is running on a different computer. NOTE: Since some common external data sources such as radar rainfall uses UTC time, also with the complication of daylight saving time, it is important to choose the correct time zone for all data sources.
Populating the observed tab for each data stream is straightforward,
When we load data for each stream, once the data is loaded, it will move data to the loaded folder and empty the rows in the file.
Now if we check the data folder, we’ll see rg1.csv and rg2.csv are now empty, and the loaded data are copied in the “loaded” folder.
The rainfall can be viewed as shown below,
To create TVD connector,
- open the network in GeoPlan
- drag the TSDB into the GeoPlan
- create the TVD connectors for the rain gauges
In this example, we will reference the rain gauges only as rainfall profiles in the subcatchment attributes. All we need to do is to create two TVD connectors so that the network is aware of the source of the rainfall profiles. In the following articles, we’ll introduce spatial rainfall sources.
Create a TVD connector near the sub1 subcatchment, the location doesn’t matter, just for easy access of the connector through the GeoPlan.
- Drag the “from_csv” TSDB to the GeoPlan (should see the target (1) in the title bar)
- Double click on the rg1 TVD connector and populate the information.
Do the same for rg2.
Compare the TSDB values and the simulated values to make sure the rainfall are correctly added.