Table of Contents

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

Kind WeatherServiceKind

How the service is read.

Model string

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).

ModelName string

The model's display name ("GFS-Wave"), if any.

DataRoot Uri

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.

File string

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.

CadenceHours int

How often the model runs (6 for GFS); 0 for a service without runs.

StepHours int

The forecast hours offered are every StepHours hours.

MaxHours int

The last forecast hour offered.

DefaultHours int

The forecast hours chosen by default: up to this hour.

GridDegrees double

The grid spacing, for rounding an area out to whole cells (0.25 for GFS 0.25°); 0 for none.

Parameters IReadOnlyList<WeatherServiceParameter>

For a GRIB2 service, the parameters offered.

Datasets IReadOnlyList<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

int

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

Uri

Datasets

For ERDDAP, the datasets offered.

public IReadOnlyList<WeatherServiceDataset> Datasets { get; init; }

Property Value

IReadOnlyList<WeatherServiceDataset>

DefaultHours

The forecast hours chosen by default: up to this hour.

public int DefaultHours { get; init; }

Property Value

int

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

string

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

double

IsGrib

True for a GRIB2 model service (GribFilter or GribIndex).

[JsonIgnore]
public bool IsGrib { get; }

Property Value

bool

IsUsable

True when the description can be used: its kind's required fields are set.

[JsonIgnore]
public bool IsUsable { get; }

Property Value

bool

Kind

How the service is read.

public WeatherServiceKind Kind { get; init; }

Property Value

WeatherServiceKind

MaxHours

The last forecast hour offered.

public int MaxHours { get; init; }

Property Value

int

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

string

ModelName

The model's display name ("GFS-Wave"), if any.

public string? ModelName { get; init; }

Property Value

string

OfferedHours

The forecast hours offered: 0, StepHours, … up to MaxHours.

[JsonIgnore]
public IReadOnlyList<int> OfferedHours { get; }

Property Value

IReadOnlyList<int>

Parameters

For a GRIB2 service, the parameters offered.

public IReadOnlyList<WeatherServiceParameter> Parameters { get; init; }

Property Value

IReadOnlyList<WeatherServiceParameter>

StepHours

The forecast hours offered are every StepHours hours.

public int StepHours { get; init; }

Property Value

int