Table of Contents

Struct WindBarb

Namespace
EncDotNet.S100.Datasets.Weather
Assembly
EncDotNet.S100.Datasets.Weather.dll

The feathers of a WMO wind barb for one speed: pennants (50 kn), full barbs (10 kn) and half barbs (5 kn), with the speed rounded to the nearest 5 kn.

public readonly record struct WindBarb : IEquatable<WindBarb>
Implements
Inherited Members

Remarks

A barb's staff points into the wind, from the station toward the direction the wind blows from. Its feathers sit at the outer end, largest first: pennants, then full barbs, then at most one half barb. A half barb on its own (5 kn) is drawn one feather spacing in from the end, so it isn't read as a full barb. Below 2.5 kn the wind is calm and drawn as a circle with no staff (WMO Manual on Codes; WMO-No. 485).

WindBarbStyle draws one symbol per 5 kn band, named by SymbolName; the symbols are generated from this decomposition by tools/GenerateWeatherSymbols.

Constructors

WindBarb(int, int, int, int)

The feathers of a WMO wind barb for one speed: pennants (50 kn), full barbs (10 kn) and half barbs (5 kn), with the speed rounded to the nearest 5 kn.

public WindBarb(int Knots, int Pennants, int FullBarbs, int HalfBarbs)

Parameters

Knots int

The speed the barb stands for: a multiple of 5 kn from 0 (calm) to MaxKnots.

Pennants int

The number of pennants (flags), 50 kn each.

FullBarbs int

The number of full barbs, 10 kn each.

HalfBarbs int

The number of half barbs (0 or 1), 5 kn each.

Remarks

A barb's staff points into the wind, from the station toward the direction the wind blows from. Its feathers sit at the outer end, largest first: pennants, then full barbs, then at most one half barb. A half barb on its own (5 kn) is drawn one feather spacing in from the end, so it isn't read as a full barb. Below 2.5 kn the wind is calm and drawn as a circle with no staff (WMO Manual on Codes; WMO-No. 485).

WindBarbStyle draws one symbol per 5 kn band, named by SymbolName; the symbols are generated from this decomposition by tools/GenerateWeatherSymbols.

Fields

CalmBelowKnots

The speed below which the wind is calm, in knots: 2.5.

public const double CalmBelowKnots = 2.5

Field Value

double

CalmSymbol

The symbol name of the calm circle.

public const string CalmSymbol = "WXCALM"

Field Value

string

MaxKnots

The highest barb, in knots: 200. Faster winds are drawn with it.

public const int MaxKnots = 200

Field Value

int

NorthernSymbolPrefix

The symbol name prefix of the northern-hemisphere barbs, followed by the speed in knots to three digits: WXBARBN005 to WXBARBN200.

public const string NorthernSymbolPrefix = "WXBARBN"

Field Value

string

SouthernSymbolPrefix

The symbol name prefix of the southern-hemisphere barbs, followed by the speed in knots to three digits: WXBARBS005 to WXBARBS200. Each is the mirror image of its northern barb, with the feathers on the anticlockwise side of the staff.

public const string SouthernSymbolPrefix = "WXBARBS"

Field Value

string

StepKnots

The speed step between barbs, in knots: 5.

public const int StepKnots = 5

Field Value

int

Properties

All

Every barb from calm to MaxKnots, in steps of StepKnots: 41 barbs, the first of them calm.

public static IReadOnlyList<WindBarb> All { get; }

Property Value

IReadOnlyList<WindBarb>

FullBarbs

The number of full barbs, 10 kn each.

public int FullBarbs { get; init; }

Property Value

int

HalfBarbs

The number of half barbs (0 or 1), 5 kn each.

public int HalfBarbs { get; init; }

Property Value

int

IsCalm

Whether this is the calm symbol (0 kn): no staff and no feathers.

public bool IsCalm { get; }

Property Value

bool

Knots

The speed the barb stands for: a multiple of 5 kn from 0 (calm) to MaxKnots.

public int Knots { get; init; }

Property Value

int

Pennants

The number of pennants (flags), 50 kn each.

public int Pennants { get; init; }

Property Value

int

SouthernSymbolName

The southern-hemisphere symbol name: CalmSymbol (calm has no side), or SouthernSymbolPrefix and the speed, e.g. WXBARBS065.

public string SouthernSymbolName { get; }

Property Value

string

SymbolName

The northern-hemisphere symbol name: CalmSymbol, or NorthernSymbolPrefix and the speed, e.g. WXBARBN065.

public string SymbolName { get; }

Property Value

string

Methods

FromKnots(double)

The barb for a wind speed in knots: rounded to the nearest StepKnots (halves round up, so 2.5 kn is a 5 kn barb), calm below CalmBelowKnots, and the MaxKnots barb for anything faster.

public static WindBarb FromKnots(double knots)

Parameters

knots double

The speed in knots; zero or more.

Returns

WindBarb

Exceptions

ArgumentOutOfRangeException

knots is negative or NaN.

FromSpeed(Speed)

The barb for a wind speed; see FromKnots(double).

public static WindBarb FromSpeed(Speed speed)

Parameters

speed Speed

The speed; zero or more.

Returns

WindBarb

SymbolNameAt(double)

The symbol name for a station at latitude: SouthernSymbolName south of the equator (IsSouthern(double)), SymbolName otherwise.

public string SymbolNameAt(double latitude)

Parameters

latitude double

The station's latitude in degrees.

Returns

string