Class WeatherScope
- Namespace
- EncDotNet.S100.Collections.Library
- Assembly
- EncDotNet.S100.Collections.dll
A scope of a weather service (#1075; design note weather-sources.md §6.3): for a GRIB2 model, its parameters and forecast days; for ERDDAP, its datasets and forecast days; for alerts, nothing to choose. The area is the map view when the source is added (the GRIB filter and ERDDAP cut to it, alerts are its marine zones'); NOAA's whole-grid files on AWS take the whole globe. Reading the "catalogue" finds the service's latest run (or the alerts in force), so a service that can't be reached says so before the source is added. The service's defaults start ticked, and only the ticked choices are included.
public sealed class WeatherScope : LibraryCatalogueScope
- Inheritance
-
WeatherScope
- Inherited Members
Constructors
WeatherScope(KnownCatalogueSource, Func<WeatherFeedSource, CancellationToken, Task<WeatherServiceSummary>>, Func<GeoBounds?>?, Func<GeoBounds, IReadOnlyList<string>>?)
Creates a scope of the weather service known describes.
public WeatherScope(KnownCatalogueSource known, Func<WeatherFeedSource, CancellationToken, Task<WeatherServiceSummary>> describe, Func<GeoBounds?>? currentView = null, Func<GeoBounds, IReadOnlyList<string>>? marineZones = null)
Parameters
knownKnownCatalogueSourceThe known source; its Weather must be set.
describeFunc<WeatherFeedSource, CancellationToken, Task<WeatherServiceSummary>>Reads what the service has now (its latest run).
currentViewFunc<GeoBounds?>The map view the area is taken from; the whole globe without one.
marineZonesFunc<GeoBounds, IReadOnlyList<string>>The NWS marine zone codes in an area, for alerts; every marine alert without.
Properties
Area
The area the source covers (the map view when it was read), or null for the whole globe.
public GeoBounds? Area { get; }
Property Value
AreaText
"Area 32°N–40°N, 76°W–68°W", "Whole globe", or the marine zones.
public string AreaText { get; }
Property Value
CurrentSelection
The selection the ticks make.
public WeatherSelection CurrentSelection { get; }
Property Value
EverythingSummary
"12,345 cells · 1.2 GB" for the whole catalogue.
public override string EverythingSummary { get; }
Property Value
Groups
The choice groups, once the catalogue has been read.
public override IReadOnlyList<LibraryChoiceGroup> Groups { get; }
Property Value
IsEverything
The name stays the service's: what is chosen is said by the selection summary.
public override bool IsEverything { get; }
Property Value
IsLoaded
True once the catalogue has been read.
public override bool IsLoaded { get; }
Property Value
LatestRun
The service's latest run, once read (a model service).
public DateTimeOffset? LatestRun { get; }
Property Value
RunNote
"Latest run 2026-10-28 00Z · area 32°N–40°N, 76°W–68°W" once read; null before.
public string? RunNote { get; }
Property Value
SelectionSummary
"3 parameters · 17 forecast hours" (or "1 dataset · …", or the alerts in force).
public override string SelectionSummary { get; }
Property Value
Service
What the service offers.
public WeatherService Service { get; }
Property Value
SingleEntry
The catalogue's only download, when it lists just one (there is nothing to choose); otherwise null.
public override LibraryChoice? SingleEntry { get; }
Property Value
Remarks
Alerts have nothing to choose: the one download is the alerts in force.
Methods
Build(Guid, string?)
The source the scope describes.
public override CollectionSource Build(Guid id, string? name)
Parameters
idGuidThe new source's id.
namestringThe source's name when everything is included (the catalogue's name); a selection names it after the selection. A manifest source always takes it.
Returns
DescribeSelection()
The ticked parameters ("Significant wave height, Peak wave period"), or null when none.
public override string? DescribeSelection()
Returns
FormatArea(GeoBounds)
"32°N–40°N, 76°W–68°W".
public static string FormatArea(GeoBounds area)
Parameters
areaGeoBounds
Returns
LoadAsync(CancellationToken)
Reads the catalogue and creates its choices.
public override Task<string?> LoadAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels the read.