Class WeatherService
- Namespace
- EncDotNet.S100.Collections.Weather
- Assembly
- EncDotNet.S100.Collections.dll
What a weather service in the Library offers and how its requests are
made (#1075): the weather block of a known-sources.json
entry. A source made from it keeps a copy, so it never depends on the list.
public sealed record WeatherService : IEquatable<WeatherService>
- Inheritance
-
WeatherService
- Implements
- Inherited Members
Constructors
WeatherService(WeatherServiceKind, string, string?, Uri?, string?, int, int, int, int, double, IReadOnlyList<WeatherServiceParameter>?, IReadOnlyList<WeatherServiceDataset>?)
What a weather service in the Library offers and how its requests are
made (#1075): the weather block of a known-sources.json
entry. A source made from it keeps a copy, so it never depends on the list.
public WeatherService(WeatherServiceKind Kind, string Model, string? ModelName = null, Uri? DataRoot = null, string? File = null, int CadenceHours = 0, int StepHours = 3, int MaxHours = 120, int DefaultHours = 48, double GridDegrees = 0, IReadOnlyList<WeatherServiceParameter>? Parameters = null, IReadOnlyList<WeatherServiceDataset>? Datasets = null)
Parameters
KindWeatherServiceKindHow the service is read.
ModelstringFor a GRIB2 service, the model's id (
gfswave,gfs); it names the download. For other services, a short id of the product (alerts,erddap).ModelNamestringThe model's display name ("GFS-Wave"), if any.
DataRootUriFor a GRIB2 service, the folder runs are published under, ending in
/(NOMADS'…/com/gfs/prod/, or the AWS bucket root). Runs are found by asking for the.idxof their last chosen hour there.FilestringFor a GRIB2 service, the path of one forecast hour's file below
DataRoot, with{date}(yyyyMMdd),{cycle}(HH) and{hour}(three digits) in it, e.g.gfs.{date}/{cycle}/wave/gridded/gfswave.t{cycle}z.global.0p25.f{hour}.grib2.CadenceHoursintHow often the model runs (6 for GFS); 0 for a service without runs.
StepHoursintThe forecast hours offered are every
StepHourshours.MaxHoursintThe last forecast hour offered.
DefaultHoursintThe forecast hours chosen by default: up to this hour.
GridDegreesdoubleThe grid spacing, for rounding an area out to whole cells (0.25 for GFS 0.25°); 0 for none.
ParametersIReadOnlyList<WeatherServiceParameter>For a GRIB2 service, the parameters offered.
DatasetsIReadOnlyList<WeatherServiceDataset>For ERDDAP, the datasets offered.
Properties
CadenceHours
How often the model runs (6 for GFS); 0 for a service without runs.
public int CadenceHours { get; init; }
Property Value
DataRoot
For a GRIB2 service, the folder runs are published under, ending in /
(NOMADS' …/com/gfs/prod/, or the AWS bucket root). Runs are found
by asking for the .idx of their last chosen hour there.
public Uri? DataRoot { get; init; }
Property Value
Datasets
For ERDDAP, the datasets offered.
public IReadOnlyList<WeatherServiceDataset> Datasets { get; init; }
Property Value
DefaultHours
The forecast hours chosen by default: up to this hour.
public int DefaultHours { get; init; }
Property Value
File
For a GRIB2 service, the path of one forecast hour's file below
DataRoot, with {date} (yyyyMMdd),
{cycle} (HH) and {hour} (three digits) in it, e.g.
gfs.{date}/{cycle}/wave/gridded/gfswave.t{cycle}z.global.0p25.f{hour}.grib2.
public string? File { get; init; }
Property Value
GridDegrees
The grid spacing, for rounding an area out to whole cells (0.25 for GFS 0.25°); 0 for none.
public double GridDegrees { get; init; }
Property Value
IsGrib
True for a GRIB2 model service (GribFilter or GribIndex).
[JsonIgnore]
public bool IsGrib { get; }
Property Value
IsUsable
True when the description can be used: its kind's required fields are set.
[JsonIgnore]
public bool IsUsable { get; }
Property Value
Kind
How the service is read.
public WeatherServiceKind Kind { get; init; }
Property Value
MaxHours
The last forecast hour offered.
public int MaxHours { get; init; }
Property Value
Model
For a GRIB2 service, the model's id (gfswave, gfs); it names
the download. For other services, a short id of the product (alerts, erddap).
public string Model { get; init; }
Property Value
ModelName
The model's display name ("GFS-Wave"), if any.
public string? ModelName { get; init; }
Property Value
OfferedHours
[JsonIgnore]
public IReadOnlyList<int> OfferedHours { get; }
Property Value
Parameters
For a GRIB2 service, the parameters offered.
public IReadOnlyList<WeatherServiceParameter> Parameters { get; init; }
Property Value
StepHours
The forecast hours offered are every StepHours hours.
public int StepHours { get; init; }