Table of Contents

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

known KnownCatalogueSource

The known source; its Weather must be set.

describe Func<WeatherFeedSource, CancellationToken, Task<WeatherServiceSummary>>

Reads what the service has now (its latest run).

currentView Func<GeoBounds?>

The map view the area is taken from; the whole globe without one.

marineZones Func<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

GeoBounds?

AreaText

"Area 32°N–40°N, 76°W–68°W", "Whole globe", or the marine zones.

public string AreaText { get; }

Property Value

string

CurrentSelection

The selection the ticks make.

public WeatherSelection CurrentSelection { get; }

Property Value

WeatherSelection

EverythingSummary

"12,345 cells · 1.2 GB" for the whole catalogue.

public override string EverythingSummary { get; }

Property Value

string

Groups

The choice groups, once the catalogue has been read.

public override IReadOnlyList<LibraryChoiceGroup> Groups { get; }

Property Value

IReadOnlyList<LibraryChoiceGroup>

IsEverything

The name stays the service's: what is chosen is said by the selection summary.

public override bool IsEverything { get; }

Property Value

bool

IsLoaded

True once the catalogue has been read.

public override bool IsLoaded { get; }

Property Value

bool

LatestRun

The service's latest run, once read (a model service).

public DateTimeOffset? LatestRun { get; }

Property Value

DateTimeOffset?

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

string

SelectionSummary

"3 parameters · 17 forecast hours" (or "1 dataset · …", or the alerts in force).

public override string SelectionSummary { get; }

Property Value

string

Service

What the service offers.

public WeatherService Service { get; }

Property Value

WeatherService

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

LibraryChoice

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

id Guid

The new source's id.

name string

The 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

CollectionSource

DescribeSelection()

The ticked parameters ("Significant wave height, Peak wave period"), or null when none.

public override string? DescribeSelection()

Returns

string

FormatArea(GeoBounds)

"32°N–40°N, 76°W–68°W".

public static string FormatArea(GeoBounds area)

Parameters

area GeoBounds

Returns

string

LoadAsync(CancellationToken)

Reads the catalogue and creates its choices.

public override Task<string?> LoadAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Cancels the read.

Returns

Task<string>

Why the catalogue could not be read, or null when it was.