Clapsode.DataLayerTS.WeatherDataLoader
0.9.68
See the version list below for details.
dotnet add package Clapsode.DataLayerTS.WeatherDataLoader --version 0.9.68
NuGet\Install-Package Clapsode.DataLayerTS.WeatherDataLoader -Version 0.9.68
<PackageReference Include="Clapsode.DataLayerTS.WeatherDataLoader" Version="0.9.68" />
paket add Clapsode.DataLayerTS.WeatherDataLoader --version 0.9.68
#r "nuget: Clapsode.DataLayerTS.WeatherDataLoader, 0.9.68"
// Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Addin #addin nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.9.68 // Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Tool #tool nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.9.68
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.15)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NGrib (>= 0.11.0)
- SharpZipLib (>= 1.4.2)
-
net8.0
- Clapsode.DataLayerTS.Client (>= 2.1.15)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Logging.Console (>= 8.0.0)
- Microsoft.IO.RecyclableMemoryStream (>= 3.0.1)
- NGrib (>= 0.11.0)
- SharpZipLib (>= 1.4.2)
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 | 82 | 12/9/2024 |
0.10.2 | 76 | 12/9/2024 |
0.10.1 | 80 | 12/7/2024 |
0.10.0 | 84 | 12/7/2024 |
0.9.74 | 93 | 11/18/2024 |
0.9.73 | 125 | 10/23/2024 |
0.9.72 | 90 | 10/23/2024 |
0.9.71 | 137 | 10/18/2024 |
0.9.70 | 93 | 10/17/2024 |
0.9.69 | 300 | 8/1/2024 |
0.9.68 | 233 | 7/7/2024 |
0.9.67 | 109 | 7/5/2024 |
0.9.66 | 109 | 7/4/2024 |
0.9.65 | 245 | 6/5/2024 |
0.9.64 | 134 | 5/27/2024 |
0.9.63 | 115 | 5/25/2024 |
0.9.62 | 111 | 5/25/2024 |
0.9.61 | 209 | 5/14/2024 |
0.9.60 | 104 | 5/13/2024 |
0.9.59 | 95 | 5/13/2024 |
0.9.58 | 110 | 5/11/2024 |
0.9.57 | 106 | 5/10/2024 |
0.9.56 | 94 | 5/10/2024 |
0.9.55 | 132 | 5/7/2024 |
0.9.54 | 116 | 5/7/2024 |
0.9.53 | 111 | 5/7/2024 |
0.9.52 | 158 | 5/7/2024 |
0.9.51 | 136 | 5/6/2024 |
0.9.50 | 119 | 5/6/2024 |
0.9.49 | 129 | 4/25/2024 |
0.9.48 | 110 | 4/24/2024 |
0.9.47 | 139 | 4/23/2024 |
0.9.46 | 147 | 4/17/2024 |
0.9.45 | 115 | 4/17/2024 |
0.9.44 | 120 | 4/16/2024 |
0.9.43 | 157 | 4/15/2024 |
0.9.42 | 126 | 4/15/2024 |
0.9.41 | 120 | 4/15/2024 |
0.9.40 | 113 | 4/15/2024 |
0.9.39 | 120 | 4/15/2024 |
0.9.38 | 441 | 4/14/2024 |
0.9.37 | 116 | 4/13/2024 |
0.9.36 | 653 | 4/12/2024 |
0.9.35 | 126 | 4/12/2024 |
0.9.34 | 112 | 4/11/2024 |
0.9.33 | 115 | 4/11/2024 |
0.9.32 | 125 | 4/11/2024 |
0.9.31 | 115 | 4/11/2024 |
0.9.30 | 114 | 4/10/2024 |
0.9.29 | 127 | 4/9/2024 |
0.9.28 | 116 | 4/8/2024 |
0.9.27 | 115 | 4/8/2024 |
0.9.26 | 182 | 3/25/2024 |
0.9.25 | 144 | 3/19/2024 |
0.9.24 | 355 | 2/6/2024 |
0.9.23 | 126 | 2/2/2024 |
0.9.22 | 118 | 2/2/2024 |
0.9.21 | 116 | 1/31/2024 |
0.9.20 | 110 | 1/30/2024 |
0.9.19 | 109 | 1/30/2024 |
0.9.18 | 112 | 1/29/2024 |
0.9.17 | 108 | 1/29/2024 |
0.9.16 | 105 | 1/29/2024 |
0.9.15 | 116 | 1/29/2024 |
0.9.14 | 123 | 1/29/2024 |
0.9.13 | 110 | 1/26/2024 |
0.9.12 | 109 | 1/26/2024 |
0.9.11 | 109 | 1/26/2024 |
0.9.10 | 121 | 1/23/2024 |
0.9.9 | 115 | 1/23/2024 |
0.9.8 | 153 | 1/21/2024 |
0.9.7 | 110 | 1/19/2024 |
0.9.6 | 115 | 1/19/2024 |
0.9.5 | 109 | 1/18/2024 |
0.9.4 | 110 | 1/18/2024 |
0.9.3 | 112 | 1/18/2024 |
0.9.2 | 134 | 1/17/2024 |
0.9.1 | 130 | 1/16/2024 |
0.9.0 | 119 | 1/15/2024 |