Clapsode.DataLayerTS.WeatherDataLoader
0.9.45
See the version list below for details.
dotnet add package Clapsode.DataLayerTS.WeatherDataLoader --version 0.9.45
NuGet\Install-Package Clapsode.DataLayerTS.WeatherDataLoader -Version 0.9.45
<PackageReference Include="Clapsode.DataLayerTS.WeatherDataLoader" Version="0.9.45" />
paket add Clapsode.DataLayerTS.WeatherDataLoader --version 0.9.45
#r "nuget: Clapsode.DataLayerTS.WeatherDataLoader, 0.9.45"
// Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Addin #addin nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.9.45 // Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Tool #tool nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.9.45
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 | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Clapsode.DataLayerTS.Client (>= 2.1.14)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.0)
- NGrib (>= 0.10.0)
- SharpZipLib (>= 1.4.2)
- System.Drawing.Common (>= 8.0.4)
-
net8.0
- Clapsode.DataLayerTS.Client (>= 2.1.14)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.0)
- NGrib (>= 0.10.0)
- SharpZipLib (>= 1.4.2)
- System.Drawing.Common (>= 8.0.4)
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.9.74 | 40 | 11/18/2024 |
0.9.73 | 112 | 10/23/2024 |
0.9.72 | 80 | 10/23/2024 |
0.9.71 | 122 | 10/18/2024 |
0.9.70 | 81 | 10/17/2024 |
0.9.69 | 284 | 8/1/2024 |
0.9.68 | 220 | 7/7/2024 |
0.9.67 | 103 | 7/5/2024 |
0.9.66 | 102 | 7/4/2024 |
0.9.65 | 238 | 6/5/2024 |
0.9.64 | 126 | 5/27/2024 |
0.9.63 | 108 | 5/25/2024 |
0.9.62 | 103 | 5/25/2024 |
0.9.61 | 202 | 5/14/2024 |
0.9.60 | 95 | 5/13/2024 |
0.9.59 | 89 | 5/13/2024 |
0.9.58 | 102 | 5/11/2024 |
0.9.57 | 100 | 5/10/2024 |
0.9.56 | 88 | 5/10/2024 |
0.9.55 | 121 | 5/7/2024 |
0.9.54 | 106 | 5/7/2024 |
0.9.53 | 103 | 5/7/2024 |
0.9.52 | 148 | 5/7/2024 |
0.9.51 | 128 | 5/6/2024 |
0.9.50 | 111 | 5/6/2024 |
0.9.49 | 124 | 4/25/2024 |
0.9.48 | 103 | 4/24/2024 |
0.9.47 | 133 | 4/23/2024 |
0.9.46 | 143 | 4/17/2024 |
0.9.45 | 110 | 4/17/2024 |
0.9.44 | 116 | 4/16/2024 |
0.9.43 | 153 | 4/15/2024 |
0.9.42 | 121 | 4/15/2024 |
0.9.41 | 115 | 4/15/2024 |
0.9.40 | 104 | 4/15/2024 |
0.9.39 | 114 | 4/15/2024 |
0.9.38 | 436 | 4/14/2024 |
0.9.37 | 109 | 4/13/2024 |
0.9.36 | 647 | 4/12/2024 |
0.9.35 | 121 | 4/12/2024 |
0.9.34 | 104 | 4/11/2024 |
0.9.33 | 109 | 4/11/2024 |
0.9.32 | 122 | 4/11/2024 |
0.9.31 | 111 | 4/11/2024 |
0.9.30 | 111 | 4/10/2024 |
0.9.29 | 122 | 4/9/2024 |
0.9.28 | 109 | 4/8/2024 |
0.9.27 | 111 | 4/8/2024 |
0.9.26 | 177 | 3/25/2024 |
0.9.25 | 140 | 3/19/2024 |
0.9.24 | 353 | 2/6/2024 |
0.9.23 | 120 | 2/2/2024 |
0.9.22 | 112 | 2/2/2024 |
0.9.21 | 111 | 1/31/2024 |
0.9.20 | 105 | 1/30/2024 |
0.9.19 | 103 | 1/30/2024 |
0.9.18 | 107 | 1/29/2024 |
0.9.17 | 104 | 1/29/2024 |
0.9.16 | 101 | 1/29/2024 |
0.9.15 | 111 | 1/29/2024 |
0.9.14 | 117 | 1/29/2024 |
0.9.13 | 106 | 1/26/2024 |
0.9.12 | 103 | 1/26/2024 |
0.9.11 | 103 | 1/26/2024 |
0.9.10 | 117 | 1/23/2024 |
0.9.9 | 111 | 1/23/2024 |
0.9.8 | 147 | 1/21/2024 |
0.9.7 | 104 | 1/19/2024 |
0.9.6 | 109 | 1/19/2024 |
0.9.5 | 103 | 1/18/2024 |
0.9.4 | 106 | 1/18/2024 |
0.9.3 | 107 | 1/18/2024 |
0.9.2 | 126 | 1/17/2024 |
0.9.1 | 125 | 1/16/2024 |
0.9.0 | 114 | 1/15/2024 |