Table of Contents

Class Metar

Namespace
Cavok
Assembly
Cavok.dll

A parsed METAR or SPECI report. Use Parse(string) to parse leniently or ParseStrict(string) to throw on errors.

public sealed record Metar : IEquatable<Metar>
Inheritance
Metar
Implements
Inherited Members

Properties

CloudCondition

NSC, NCD, SKC or CLR, if reported.

public CloudCondition? CloudCondition { get; init; }

Property Value

CloudCondition?

Clouds

Cloud layers and vertical visibility.

public IReadOnlyList<CloudLayer> Clouds { get; init; }

Property Value

IReadOnlyList<CloudLayer>

ColorCodes

Military colour states outside the trend (for example BLU BLU).

public IReadOnlyList<ColorCode> ColorCodes { get; init; }

Property Value

IReadOnlyList<ColorCode>

DewPoint

Dew point in °C.

public int? DewPoint { get; init; }

Property Value

int?

Diagnostics

Problems found while parsing.

public IReadOnlyList<Diagnostic> Diagnostics { get; init; }

Property Value

IReadOnlyList<Diagnostic>

FlightCategory

Flight category from the observed visibility and ceiling; null when neither is known.

public FlightCategory? FlightCategory { get; }

Property Value

FlightCategory?

HasErrors

True when at least one diagnostic is an error.

public bool HasErrors { get; }

Property Value

bool

IsAuto

True for a fully automated report (AUTO).

public bool IsAuto { get; init; }

Property Value

bool

IsCavok

True for CAVOK.

public bool IsCavok { get; init; }

Property Value

bool

IsCorrected

True for a corrected report (COR).

public bool IsCorrected { get; init; }

Property Value

bool

IsNil

True for a missing report (NIL).

public bool IsNil { get; init; }

Property Value

bool

Pressure

QNH; null when missing (Q////) or not reported.

public Pressure? Pressure { get; init; }

Property Value

Pressure?

Raw

The report exactly as given to the parser.

public string Raw { get; init; }

Property Value

string

RecentWeather

Recent weather (RE groups).

public IReadOnlyList<WeatherPhenomenon> RecentWeather { get; init; }

Property Value

IReadOnlyList<WeatherPhenomenon>

Remarks

Everything after RMK as text, not decoded: runs of whitespace (including line breaks) become one space and a trailing = is removed; null when there are no remarks.

public string? Remarks { get; init; }

Property Value

string

RunwayStates

Runway state groups.

public IReadOnlyList<RunwayState> RunwayStates { get; init; }

Property Value

IReadOnlyList<RunwayState>

RunwayVisualRanges

Runway visual ranges.

public IReadOnlyList<RunwayVisualRange> RunwayVisualRanges { get; init; }

Property Value

IReadOnlyList<RunwayVisualRange>

Sea

Sea-surface temperature and state of the sea or wave height.

public SeaCondition? Sea { get; init; }

Property Value

SeaCondition

Station

ICAO location indicator, for example EHAM; null when missing or invalid.

public string? Station { get; init; }

Property Value

string

Temperature

Air temperature in °C.

public int? Temperature { get; init; }

Property Value

int?

Time

Observation day and time (UTC).

public DayTime? Time { get; init; }

Property Value

DayTime?

Trend forecasts (NOSIG, BECMG, TEMPO).

public IReadOnlyList<Trend> Trends { get; init; }

Property Value

IReadOnlyList<Trend>

Type

METAR or SPECI. Reports without a type word are METARs.

public ReportType Type { get; init; }

Property Value

ReportType

Visibility

Prevailing visibility (not set when IsCavok).

public Visibility? Visibility { get; init; }

Property Value

Visibility

Weather

Present weather.

public IReadOnlyList<WeatherPhenomenon> Weather { get; init; }

Property Value

IReadOnlyList<WeatherPhenomenon>

Wind

Surface wind.

public Wind? Wind { get; init; }

Property Value

Wind

WindShear

Wind shear groups.

public IReadOnlyList<WindShear> WindShear { get; init; }

Property Value

IReadOnlyList<WindShear>

Methods

Describe(Language)

Describes the report in plain language, one element per line.

public string Describe(Language language = Language.English)

Parameters

language Language

The language of the description.

Returns

string

The description; lines are separated by \n.

Parse(string)

Parses a METAR or SPECI. Never throws for bad content: whatever is understood is returned and every problem is listed in Diagnostics.

public static Metar Parse(string raw)

Parameters

raw string

The report, with or without the METAR/SPECI prefix.

Returns

Metar

The parsed report.

Exceptions

ArgumentNullException

raw is null.

ParseStrict(string)

Parses a METAR or SPECI and throws when it contains errors; warnings are allowed.

public static Metar ParseStrict(string raw)

Parameters

raw string

The report, with or without the METAR/SPECI prefix.

Returns

Metar

The parsed report.

Exceptions

ArgumentNullException

raw is null.

CavokParseException

The report contains at least one error.