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
Clouds
Cloud layers and vertical visibility.
public IReadOnlyList<CloudLayer> Clouds { get; init; }
Property Value
ColorCodes
Military colour states outside the trend (for example BLU BLU).
public IReadOnlyList<ColorCode> ColorCodes { get; init; }
Property Value
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
FlightCategory
Flight category from the observed visibility and ceiling; null when neither is known.
public FlightCategory? FlightCategory { get; }
Property Value
HasErrors
True when at least one diagnostic is an error.
public bool HasErrors { get; }
Property Value
IsAuto
True for a fully automated report (AUTO).
public bool IsAuto { get; init; }
Property Value
IsCavok
True for CAVOK.
public bool IsCavok { get; init; }
Property Value
IsCorrected
True for a corrected report (COR).
public bool IsCorrected { get; init; }
Property Value
IsNil
True for a missing report (NIL).
public bool IsNil { get; init; }
Property Value
Pressure
QNH; null when missing (Q////) or not reported.
public Pressure? Pressure { get; init; }
Property Value
Raw
The report exactly as given to the parser.
public string Raw { get; init; }
Property Value
RecentWeather
Recent weather (RE groups).
public IReadOnlyList<WeatherPhenomenon> RecentWeather { get; init; }
Property Value
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
RunwayStates
Runway state groups.
public IReadOnlyList<RunwayState> RunwayStates { get; init; }
Property Value
RunwayVisualRanges
Runway visual ranges.
public IReadOnlyList<RunwayVisualRange> RunwayVisualRanges { get; init; }
Property Value
Sea
Sea-surface temperature and state of the sea or wave height.
public SeaCondition? Sea { get; init; }
Property Value
Station
ICAO location indicator, for example EHAM; null when missing or invalid.
public string? Station { get; init; }
Property Value
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
Trends
Trend forecasts (NOSIG, BECMG, TEMPO).
public IReadOnlyList<Trend> Trends { get; init; }
Property Value
Type
METAR or SPECI. Reports without a type word are METARs.
public ReportType Type { get; init; }
Property Value
Visibility
Prevailing visibility (not set when IsCavok).
public Visibility? Visibility { get; init; }
Property Value
Weather
Present weather.
public IReadOnlyList<WeatherPhenomenon> Weather { get; init; }
Property Value
Wind
Surface wind.
public Wind? Wind { get; init; }
Property Value
WindShear
Wind shear groups.
public IReadOnlyList<WindShear> WindShear { get; init; }
Property Value
Methods
Describe(Language)
Describes the report in plain language, one element per line.
public string Describe(Language language = Language.English)
Parameters
languageLanguageThe 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
rawstringThe report, with or without the
METAR/SPECIprefix.
Returns
- Metar
The parsed report.
Exceptions
- ArgumentNullException
rawisnull.
ParseStrict(string)
Parses a METAR or SPECI and throws when it contains errors; warnings are allowed.
public static Metar ParseStrict(string raw)
Parameters
rawstringThe report, with or without the
METAR/SPECIprefix.
Returns
- Metar
The parsed report.
Exceptions
- ArgumentNullException
rawisnull.- CavokParseException
The report contains at least one error.