Clapsode.DataLayerTS.WeatherDataLoader
0.9.60
See the version list below for details.
dotnet add package Clapsode.DataLayerTS.WeatherDataLoader --version 0.9.60
NuGet\Install-Package Clapsode.DataLayerTS.WeatherDataLoader -Version 0.9.60
<PackageReference Include="Clapsode.DataLayerTS.WeatherDataLoader" Version="0.9.60" />
paket add Clapsode.DataLayerTS.WeatherDataLoader --version 0.9.60
#r "nuget: Clapsode.DataLayerTS.WeatherDataLoader, 0.9.60"
// Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Addin #addin nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.9.60 // Install Clapsode.DataLayerTS.WeatherDataLoader as a Cake Tool #tool nuget:?package=Clapsode.DataLayerTS.WeatherDataLoader&version=0.9.60
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.0)
- NGrib (>= 0.11.0)
- SharpZipLib (>= 1.4.2)
- System.Drawing.Common (>= 8.0.4)
-
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.0)
- NGrib (>= 0.11.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.73 | 101 | 10/23/2024 |
0.9.72 | 77 | 10/23/2024 |
0.9.71 | 121 | 10/18/2024 |
0.9.70 | 80 | 10/17/2024 |
0.9.69 | 274 | 8/1/2024 |
0.9.68 | 219 | 7/7/2024 |
0.9.67 | 102 | 7/5/2024 |
0.9.66 | 101 | 7/4/2024 |
0.9.65 | 237 | 6/5/2024 |
0.9.64 | 125 | 5/27/2024 |
0.9.63 | 107 | 5/25/2024 |
0.9.62 | 102 | 5/25/2024 |
0.9.61 | 201 | 5/14/2024 |
0.9.60 | 94 | 5/13/2024 |
0.9.59 | 88 | 5/13/2024 |
0.9.58 | 101 | 5/11/2024 |
0.9.57 | 99 | 5/10/2024 |
0.9.56 | 87 | 5/10/2024 |
0.9.55 | 120 | 5/7/2024 |
0.9.54 | 105 | 5/7/2024 |
0.9.53 | 102 | 5/7/2024 |
0.9.52 | 147 | 5/7/2024 |
0.9.51 | 127 | 5/6/2024 |
0.9.50 | 110 | 5/6/2024 |
0.9.49 | 123 | 4/25/2024 |
0.9.48 | 102 | 4/24/2024 |
0.9.47 | 130 | 4/23/2024 |
0.9.46 | 142 | 4/17/2024 |
0.9.45 | 109 | 4/17/2024 |
0.9.44 | 113 | 4/16/2024 |
0.9.43 | 152 | 4/15/2024 |
0.9.42 | 120 | 4/15/2024 |
0.9.41 | 114 | 4/15/2024 |
0.9.40 | 103 | 4/15/2024 |
0.9.39 | 111 | 4/15/2024 |
0.9.38 | 433 | 4/14/2024 |
0.9.37 | 106 | 4/13/2024 |
0.9.36 | 646 | 4/12/2024 |
0.9.35 | 120 | 4/12/2024 |
0.9.34 | 103 | 4/11/2024 |
0.9.33 | 108 | 4/11/2024 |
0.9.32 | 119 | 4/11/2024 |
0.9.31 | 110 | 4/11/2024 |
0.9.30 | 110 | 4/10/2024 |
0.9.29 | 121 | 4/9/2024 |
0.9.28 | 108 | 4/8/2024 |
0.9.27 | 110 | 4/8/2024 |
0.9.26 | 176 | 3/25/2024 |
0.9.25 | 139 | 3/19/2024 |
0.9.24 | 352 | 2/6/2024 |
0.9.23 | 119 | 2/2/2024 |
0.9.22 | 111 | 2/2/2024 |
0.9.21 | 110 | 1/31/2024 |
0.9.20 | 104 | 1/30/2024 |
0.9.19 | 102 | 1/30/2024 |
0.9.18 | 106 | 1/29/2024 |
0.9.17 | 103 | 1/29/2024 |
0.9.16 | 98 | 1/29/2024 |
0.9.15 | 108 | 1/29/2024 |
0.9.14 | 114 | 1/29/2024 |
0.9.13 | 105 | 1/26/2024 |
0.9.12 | 102 | 1/26/2024 |
0.9.11 | 102 | 1/26/2024 |
0.9.10 | 116 | 1/23/2024 |
0.9.9 | 108 | 1/23/2024 |
0.9.8 | 146 | 1/21/2024 |
0.9.7 | 103 | 1/19/2024 |
0.9.6 | 108 | 1/19/2024 |
0.9.5 | 102 | 1/18/2024 |
0.9.4 | 105 | 1/18/2024 |
0.9.3 | 106 | 1/18/2024 |
0.9.2 | 123 | 1/17/2024 |
0.9.1 | 124 | 1/16/2024 |
0.9.0 | 113 | 1/15/2024 |