Clapsode.DataLayerTS.WeatherDataLoader 0.10.3

dotnet add package Clapsode.DataLayerTS.WeatherDataLoader --version 0.10.3                
NuGet\Install-Package Clapsode.DataLayerTS.WeatherDataLoader -Version 0.10.3                
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="0.10.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Clapsode.DataLayerTS.WeatherDataLoader --version 0.10.3                
#r "nuget: Clapsode.DataLayerTS.WeatherDataLoader, 0.10.3"                
#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.
// Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Addin
#addin nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.10.3

// Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Tool
#tool nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.10.3                

Ingestion Manager for Loading Weather Forecasts from the DWD into Data Layer TS

This library can be used to ingest weather forecasts from the DWD into a Data Layer TS instance. The data can be used for forecasting any time series, which is dependent on the local weather (e.g. photovoltaic panel or wind turbine power production).

Purpose

The DWD (Deutscher Wetterdienst - german national weather forecasting service) offers weather forecasts for free (fully commercial use allowed), but overwrites the data every 24 hours. The scheduler currently supports loading data from the ICON-D2 (scope Germany) and the ICON-EU (scope Europe) grids of the ICON model. The ICON-D2 and the ICON-EU grid/model forecasts are estimated and published every 3 hours. There are more than one hundred different weather variables available and some of them are available on different vertical levels. The data is stored in a way where each (GRIB2) file contains all available grid-points (hundreds of thousands of grid-points) and only 1 hour of time steps. If the data should be used to train models, run forecasts or analyze historical data, the data is needed in different form - many time steps (also more than 24 hours) are needed for just one or a few grid-points. Data Layer TS is a high-performance time-series database technology which enables storing this data and making it available in the right form using a simple RESTful HTTP API. Currently it is available in the Microsoft Azure Marketplace exclusively.

Requirements

The library needs .Net 7 or .Net 8 to work and the license only grants use, if the library is used with an own Data Layer TS instance.

Configuration

The IngestionScheduler needs a SchedulerConfiguration to be initialized. The most important part of this configuration is the target Data Layer TS instance URL and credentials. The IngestionScheduler can either load continuously until it is canceled or just load data until no more data can be found and then stop (although new data is available every three hours). It can be started using a SchedulingRequest with two main parameters: The weather variables (ContentConfiguration), which should be loaded and the coordinates that should be extracted from the weather variable files. Instead of giving this information to the IngestionScheduler directly, it can also be configured to load all the stored variables and coordinates from the configured ILoadingConfigurationRepository, which is the target Data Layer TS instance per default and extend the configuration to continue loading these series. It will then load all the coordinates for all the variables - if any new variable is created in the target Data Layer TS instance, a background job will pick up the changes and start to load the data without any restart. The state of the processing scheduler is stored using the IProcessingHistoryRepository, which per default uses local files on disk, but since Data Layer TS write operations do not really depend on the number of time steps ingested, but rather on the number of time series ingested, a cold-start (no state stored) is not very expensive. The target Data Layer TS instance IOPS will most likely be the bottleneck and the scheduler should be configured to run as few parallel ingestions as possible while keeping the Data Layer TS IOPS at nearly 100%. This ensures maximum ingestion-throughput while keeping the read-throughput capability high.

Example Usage

In this usage example an ILogger and a TraceProvider is added and one example coordinate is loaded from both the ICON-EU and the ICON-D2 model:

using ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
{
	builder.AddFilter("Microsoft", LogLevel.Warning)
			.AddFilter("System", LogLevel.Warning)
			.AddFilter("IconLoaderDLTS", LogLevel.Information)
			.AddSimpleConsole(c => c.TimestampFormat = "[HH:mm:ss]");
});
ILogger logger = loggerFactory.CreateLogger("IconLoaderDLTS");

using TracerProvider tracerProvider = Sdk.CreateTracerProviderBuilder()
			.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("IconLoaderDLTS"))
			.AddSource("Clapsode.DataLayerTS.WeatherDataLoader")
			.AddConsoleExporter()
			.Build();

await using IngestionScheduler ingestionScheduler = new(baseConfiguration, logger);

Dictionary<NumericalWeatherPredictionModel, HashSet<Coordinate>> coordsToLoad = new();
coordsToLoad.Add(NumericalWeatherPredictionModel.ICON_D2, new HashSet<Coordinate>() { new Coordinate(51.5, 6.75) });
coordsToLoad[NumericalWeatherPredictionModel.ICON_D2].Add(new Coordinate(55, 7.1));
coordsToLoad.Add(NumericalWeatherPredictionModel.ICON_EU, new HashSet<Coordinate>() { new Coordinate(51.5, 6.75) });
coordsToLoad[NumericalWeatherPredictionModel.ICON_EU].Add(new Coordinate(55, 7.1));

HashSet<ContentConfiguration> contentToLoad = new();
contentToLoad.Add(new(NumericalWeatherPredictionModel.ICON_D2, LevelType.MODEL_LEVEL, 60, "p", TimeSpan.FromMinutes(60)));

SchedulingRequest request = new()
{
	RunContinuously = true,
	ConfigurationsToLoad = contentToLoad,
	CoordinatesToLoad = coordsToLoad,
	CoordinateMapping = CoordinateMapping.MAP_TO_SURROUNDING_FOUR,
	ExtendCoordinatesWithRepository = false,
	ExtendConfigurationsWithRepository = false,
};

await ingestionScheduler.RunAsync(request).ConfigureAwait(false);
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
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
0.10.3 86 12/9/2024
0.10.2 78 12/9/2024
0.10.1 82 12/7/2024
0.10.0 86 12/7/2024
0.9.74 95 11/18/2024
0.9.73 126 10/23/2024
0.9.72 91 10/23/2024
0.9.71 138 10/18/2024
0.9.70 94 10/17/2024
0.9.69 301 8/1/2024
0.9.68 234 7/7/2024
0.9.67 110 7/5/2024
0.9.66 112 7/4/2024
0.9.65 246 6/5/2024
0.9.64 135 5/27/2024
0.9.63 116 5/25/2024
0.9.62 112 5/25/2024
0.9.61 212 5/14/2024
0.9.60 105 5/13/2024
0.9.59 96 5/13/2024
0.9.58 111 5/11/2024
0.9.57 107 5/10/2024
0.9.56 95 5/10/2024
0.9.55 133 5/7/2024
0.9.54 117 5/7/2024
0.9.53 112 5/7/2024
0.9.52 159 5/7/2024
0.9.51 137 5/6/2024
0.9.50 120 5/6/2024
0.9.49 130 4/25/2024
0.9.48 111 4/24/2024
0.9.47 140 4/23/2024
0.9.46 148 4/17/2024
0.9.45 116 4/17/2024
0.9.44 121 4/16/2024
0.9.43 160 4/15/2024
0.9.42 127 4/15/2024
0.9.41 121 4/15/2024
0.9.40 114 4/15/2024
0.9.39 121 4/15/2024
0.9.38 442 4/14/2024
0.9.37 117 4/13/2024
0.9.36 654 4/12/2024
0.9.35 127 4/12/2024
0.9.34 113 4/11/2024
0.9.33 116 4/11/2024
0.9.32 126 4/11/2024
0.9.31 116 4/11/2024
0.9.30 115 4/10/2024
0.9.29 128 4/9/2024
0.9.28 117 4/8/2024
0.9.27 116 4/8/2024
0.9.26 183 3/25/2024
0.9.25 145 3/19/2024
0.9.24 356 2/6/2024
0.9.23 127 2/2/2024
0.9.22 119 2/2/2024
0.9.21 117 1/31/2024
0.9.20 111 1/30/2024
0.9.19 110 1/30/2024
0.9.18 113 1/29/2024
0.9.17 109 1/29/2024
0.9.16 106 1/29/2024
0.9.15 117 1/29/2024
0.9.14 124 1/29/2024
0.9.13 111 1/26/2024
0.9.12 110 1/26/2024
0.9.11 110 1/26/2024
0.9.10 122 1/23/2024
0.9.9 116 1/23/2024
0.9.8 154 1/21/2024
0.9.7 111 1/19/2024
0.9.6 116 1/19/2024
0.9.5 110 1/18/2024
0.9.4 111 1/18/2024
0.9.3 113 1/18/2024
0.9.2 135 1/17/2024
0.9.1 131 1/16/2024
0.9.0 120 1/15/2024