Clapsode.DataLayerTS.WeatherDataLoader 1.0.13

There is a newer version of this package available.
See the version list below for details.
dotnet add package Clapsode.DataLayerTS.WeatherDataLoader --version 1.0.13
                    
NuGet\Install-Package Clapsode.DataLayerTS.WeatherDataLoader -Version 1.0.13
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Clapsode.DataLayerTS.WeatherDataLoader" Version="1.0.13" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Clapsode.DataLayerTS.WeatherDataLoader" Version="1.0.13" />
                    
Directory.Packages.props
<PackageReference Include="Clapsode.DataLayerTS.WeatherDataLoader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Clapsode.DataLayerTS.WeatherDataLoader --version 1.0.13
                    
#r "nuget: Clapsode.DataLayerTS.WeatherDataLoader, 1.0.13"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Clapsode.DataLayerTS.WeatherDataLoader@1.0.13
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=1.0.13
                    
Install as a Cake Addin
#tool nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=1.0.13
                    
Install as a Cake Tool

DWD Weather Ingestion for Data Layer TS

NuGet version

A high-performance .NET library for ingesting weather forecast data from the German Weather Service (DWD) into a Data Layer TS time-series database.

This tool is essential for applications that rely on weather data for forecasting, such as predicting photovoltaic power production or wind turbine output.


The Challenge with DWD Data

The German Weather Service (DWD) provides a wealth of free, commercially-usable weather forecast data. However, using it directly for time-series analysis presents several challenges:

  • Data Volatility: Forecasts are overwritten every 24 hours, making historical analysis impossible without a storage solution.
  • Data Format: The data is provided in GRIB2 files, where each file contains data for hundreds of thousands of grid points but only for a single point in time.
  • Analysis Needs: Effective model training and forecasting require the opposite format: a long series of many time steps for just one or a few grid points.

This library bridges that gap, transforming the DWD's data into a format ready for analysis and storing it in the high-performance Data Layer TS database.


Key Features

  • Continuous Ingestion: Runs as a background service to continuously fetch the latest forecasts as they are published.
  • Broad Model Support: Ingests data from a wide range of DWD models:
    • ICON (Global)
    • ICON-EU (Europe)
    • ICON-D2 (DACH region)
    • ICON-D2-RUC (Rapid Update, DACH)
    • ICON-ART (Aerosols and Reactive Trace gases, Global & EU)
  • Flexible Grid Support: Handles both regular-lat-lon and icosahedral grids.
  • Dynamic Configuration: Can automatically detect new variables and coordinates added to your Data Layer TS instance and begin ingesting them without a restart.
  • Performance Tuning: Allows configuration of parallel ingestion tasks to maximize throughput by matching the IOPS of your target Data Layer TS instance.

Requirements


Installation

Install the package into your .NET project using the NuGet Package Manager or the dotnet CLI.

dotnet add package Clapsode.DataLayerTS.WeatherDataLoader

Quick Start

The following example demonstrates how to configure and run the IngestionScheduler.

Dependencies for Example

To use the console logger as shown in the example, you will also need the Microsoft.Extensions.Logging.Console package.

dotnet add package Microsoft.Extensions.Logging.Console

Example Code

using Clapsode.DataLayerTS.WeatherDataLoader;
using Clapsode.DataLayerTS.WeatherDataLoader.Enumerations;
using Clapsode.DataLayerTS.WeatherDataLoader.Models;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;

// 1. Initialize Logging (Optional but Recommended)
using ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
{
    builder
        .AddFilter("Microsoft", LogLevel.Warning)
        .AddFilter("System", LogLevel.Warning)
        .AddFilter("Clapsode", LogLevel.Information)
        .AddSimpleConsole(c => c.TimestampFormat = "[HH:mm:ss] ");
});

// 2. Create the Scheduler with Base Configuration
// Replace with your Data Layer TS instance URL and auth token.
var schedulerConfig = new SchedulerConfiguration("https://YOUR_[INSTANCE.com/](https://INSTANCE.com/)", "Basic YOUR_TOKEN");
await using var ingestionScheduler = new IngestionScheduler(schedulerConfig, loggerFactory);

// 3. Define Coordinates to Extract per Model
var coordsToLoad = new Dictionary<NumericalWeatherPredictionModel, Dictionary<GridType, HashSet<Coordinate>>>
{
    [NumericalWeatherPredictionModel.ICON_D2] = new()
    {
        [GridType.REGULAR_LAT_LON] = new HashSet<Coordinate> { new(50.93, 6.95) } // Cologne, DE
    },
    [NumericalWeatherPredictionModel.ICON_EU] = new()
    {
        [GridType.REGULAR_LAT_LON] = new HashSet<Coordinate> { new(48.85, 2.35) } // Paris, FR
    }
};

// 4. Define Weather Variables to Ingest
var contentToLoad = new HashSet<ContentConfiguration>
{
    // Temperature at 2m from ICON-D2
    new(NumericalWeatherPredictionModel.ICON_D2, GridType.REGULAR_LAT_LON, LevelType.SINGLE_LEVEL, level: null, "t_2m", TimeSpan.FromMinutes(60)),
    // Surface Downward Short-Wave Diffuse Radiation (ASWDIFD_S) from ICON-D2
    new(NumericalWeatherPredictionModel.ICON_D2, GridType.REGULAR_LAT_LON, LevelType.SINGLE_LEVEL, level: null, "aswdifd_s", TimeSpan.FromMinutes(15)),
    // Temperature at 2m from ICON-EU
    new(NumericalWeatherPredictionModel.ICON_EU, GridType.REGULAR_LAT_LON, LevelType.SINGLE_LEVEL, level: null, "t_2m", TimeSpan.FromMinutes(60))
};

// 5. Create and Run the Ingestion Request
var request = new SchedulingRequest
{
    RunContinuously = true,
    ConfigurationsToLoad = contentToLoad,
    CoordinatesToLoad = coordsToLoad,
    CoordinateMapping = CoordinateMapping.MAP_TO_NEAREST
};

// This will run indefinitely until the application is shut down or the token is cancelled.
await ingestionScheduler.RunAsync(request, CancellationToken.None);

Advanced Configuration

Dynamic Loading from Data Layer TS

Instead of defining coordinates and variables in code with a SchedulingRequest, you can configure the scheduler to pull its configuration directly from your Data Layer TS instance.

Set UseRepositoryForConfiguration to true in the SchedulingRequest. The scheduler will then:

  1. Query the configured ILoadingConfigurationRepository (which defaults to your Data Layer TS instance).
  2. Continuously ingest all time series it finds.
  3. A background job will periodically check for new time series in the database and automatically start ingesting them.

State Management

The scheduler's state (which files have been processed) is managed via the IProcessingHistoryRepository. By default, this uses local files. A cold start (with no history) is not expensive, as Data Layer TS is optimized for writes based on the number of series, not the number of data points.

Performance Tuning

The main bottleneck will likely be the write IOPS of your Data Layer TS instance. You can control the number of parallel ingestion processes in the SchedulerConfiguration. The optimal setting is the lowest number of parallel tasks that keeps your Data Layer TS instance's IOPS near 100%, ensuring maximum ingestion throughput while preserving read capacity.


License

Usage of this library is granted under the condition that it is used in conjunction with a Data Layer TS instance.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.18 97 8/21/2025
1.0.17 95 8/21/2025
1.0.16 97 8/21/2025
1.0.15 98 8/20/2025
1.0.14 112 8/18/2025
1.0.13 113 8/18/2025
1.0.12 118 8/18/2025
1.0.11 87 8/17/2025
1.0.10 443 7/24/2025
1.0.9 444 7/24/2025
1.0.8 440 7/24/2025
1.0.7 120 7/17/2025
1.0.6 114 7/17/2025
1.0.5 102 7/11/2025
1.0.4 98 7/11/2025
1.0.3 135 7/7/2025
1.0.2 137 7/7/2025
1.0.1 138 7/3/2025
0.10.28 176 3/19/2025
0.10.27 157 3/13/2025
0.10.26 183 3/9/2025
0.10.25 226 3/7/2025
0.10.24 223 3/7/2025
0.10.23 212 3/7/2025
0.10.22 112 2/28/2025
0.10.21 117 2/28/2025
0.10.20 104 2/28/2025
0.10.19 114 2/27/2025
0.10.18 100 2/27/2025
0.10.17 117 2/18/2025
0.10.16 107 2/17/2025
0.10.15 109 2/17/2025
0.10.13 126 1/31/2025
0.10.12 96 1/31/2025
0.10.11 113 1/31/2025
0.10.10 115 1/30/2025
0.10.9 116 1/29/2025
0.10.8 118 1/25/2025
0.10.7 115 1/20/2025
0.10.6 104 1/20/2025
0.10.5 106 1/19/2025
0.10.4 122 1/9/2025
0.10.3 125 12/9/2024
0.10.2 113 12/9/2024
0.10.1 118 12/7/2024
0.10.0 121 12/7/2024
0.9.74 125 11/18/2024
0.9.73 153 10/23/2024
0.9.72 118 10/23/2024
0.9.71 161 10/18/2024
0.9.70 117 10/17/2024
0.9.69 323 8/1/2024
0.9.68 255 7/7/2024
0.9.67 139 7/5/2024
0.9.66 133 7/4/2024
0.9.65 269 6/5/2024
0.9.64 157 5/27/2024
0.9.63 135 5/25/2024
0.9.62 136 5/25/2024
0.9.61 234 5/14/2024
0.9.60 125 5/13/2024
0.9.59 117 5/13/2024
0.9.58 131 5/11/2024
0.9.57 129 5/10/2024
0.9.56 118 5/10/2024
0.9.55 153 5/7/2024
0.9.54 139 5/7/2024
0.9.53 131 5/7/2024
0.9.52 182 5/7/2024
0.9.51 159 5/6/2024
0.9.50 139 5/6/2024
0.9.49 153 4/25/2024
0.9.48 131 4/24/2024
0.9.47 160 4/23/2024
0.9.46 173 4/17/2024
0.9.45 139 4/17/2024
0.9.44 146 4/16/2024
0.9.43 184 4/15/2024
0.9.42 145 4/15/2024
0.9.41 141 4/15/2024
0.9.40 132 4/15/2024
0.9.39 143 4/15/2024
0.9.38 461 4/14/2024
0.9.37 137 4/13/2024
0.9.36 672 4/12/2024
0.9.35 150 4/12/2024
0.9.34 135 4/11/2024
0.9.33 135 4/11/2024
0.9.32 145 4/11/2024
0.9.31 135 4/11/2024
0.9.30 135 4/10/2024
0.9.29 147 4/9/2024
0.9.28 134 4/8/2024
0.9.27 140 4/8/2024
0.9.26 203 3/25/2024
0.9.25 162 3/19/2024
0.9.24 375 2/6/2024
0.9.23 141 2/2/2024
0.9.22 137 2/2/2024
0.9.21 133 1/31/2024
0.9.20 127 1/30/2024
0.9.19 128 1/30/2024
0.9.18 131 1/29/2024
0.9.17 123 1/29/2024
0.9.16 120 1/29/2024
0.9.15 138 1/29/2024
0.9.14 138 1/29/2024
0.9.13 126 1/26/2024
0.9.12 125 1/26/2024
0.9.11 126 1/26/2024
0.9.10 147 1/23/2024
0.9.9 138 1/23/2024
0.9.8 176 1/21/2024
0.9.7 125 1/19/2024
0.9.6 135 1/19/2024
0.9.5 129 1/18/2024
0.9.4 127 1/18/2024
0.9.3 130 1/18/2024
0.9.2 156 1/17/2024
0.9.1 149 1/16/2024
0.9.0 138 1/15/2024