Wind Reference

Table of contents


Introduction

A Wind instance represents surface wind conditions. The conditions are set using a METAR-style wind direction string (e.g. "180V210") and wind speed string (e.g. "10G15"). These can be set using the setDirection() or setSpeed() methods. These strings can also be retrieved directly from an airport-related page using the setFromPage() method. Other instance methods will return the windo components with respect to a particular runway magnetic heading. Here are some examples:

// create a Wind instance from the departure page settings.
const wind = new Wind('dep');
// find the crosswind on runway 7
const crosswind = wind.crosswind(70);
// find the headwind on runway 7
const headwind = wind.headwind(70);

The computed headwind and crosswind are worst-case: The higher wind gust speed is used, if present and if the winds are variable, the direction that produces the lowest headwind or largest crosswind is used.

Remember that METAR wind directions are always relative to true north and that a local magnetic variance value must be supplied.

Errors

If the Wind instance is set from a METAR-style wind specification string that is invalid, the instance has a dirErrorMsg and a speedErrorMsg property that each contains a message string explaining the reason for the error.


Constructor

Syntax

new Wind()
new Wind(pageId)

Constructs a new Wind instance. If a pageId string is provided, the instance is initialized from the information on the Page specified by pageId. See the setFromPage() method.

Parameters


Instance methods

clone () {

clone()

clone()

Return a new Wind instance that has the same wind settings as this instance.

Return value

A Wind instance.


crosswind()

crosswind(magHeading)

Returns the worst-case (highest) crosswind component for this runway. Positive numbers are from the right, negative numbers are from the left.

Parameters

Return value

A headwind speed in knots.


components()

components(magHeading)

Returns the wind components for this runway magnetic heading. The returned value is an object with min and max properties, each containing an array with four elements, with the following values in clockwise order: headwind, right crosswind, tailwind, and left crosswind. The max property is computed using the gust speed, and the min property is computed using the base wind speed.

If the wind comes from a steady direction, then the headwind and tailwind values will always be the same absolute value but with opposite signs, and similarly, the right and left crosswind will always be the same absolute value but with opposite signs.

If the wind direction is variable ('VRB'), then all min values are the base wind speed value, and all max values are the gust wind speed value.

If the wind is shifting between two directions (e.g., 010V040), then it's a bit more complicated. The min values are the minimum wind speed possible in that quadrant for a wind direction within the angular limits and the base wind speed. The max values are the maximum wind speed possible in that quadrant for a wind direction within the angular limits and the gust wind speed.

Parameters

Return value

An object containing min and max properties. Each property contains an array of four numeric values, ordered clockwise around the four quadrants, as follows:


headwind()

headwind(magHeading)

Returns the worst-case (lowest) headwind component for this runway. Positive numbers are headwinds, and negative numbers are tailwinds. A positive result is computed using the smaller base wind speed, while a negative result uses the equal or higher gust wind speed.

Parameters

Return value

A headwind speed in knots.


isValid()

isValid()

Return true if both the wind speed and direction are valid.

Return value

A Booleans.


setDirection()

setDirection(spec)
setDirection(spec, magVar)

Sets the instance's wind direction from the spec string. The string may be relative to magnetic north (an ATIS value) or true north (a METAR value). If the value is relative to true north, then a local magnetic variance must be provided.

Parameters


setFromPage (pageId) {

setFromPage()

setFromPage(pageId)

Sets the instance's wind direction and speed from an airport page specified by pageId. The values are retrieved from the following page state variables:

Parameters


setSpeed()

setSpeed(spec)
setSpeed(spec, units)

Sets the instance's wind speed from the spec string. If the wind speed is in units other than knots (e.g., "mps") then the units string must be provided and the wind speec value are converted to knots internally.

Parameters


Instance properties

dir1

A wind direction in degrees relative to magnetic north. If the winds are variable without a range, then the value is the string 'VRB'. Read-only.


dir2

A wind direction in degrees relative to magnetic north. If the winds are variable without a range, then the value is the string 'VRB'. If dir2 differs from dir1, then dir2 represents the angle clockwise from dir1 through which the wind varies. Read-only.


dirErrorMsg

An error message string for errors in the wind direction specification string. Read-only.


dirSpec

The wind direction string used to set the direction values. Read-only.


max

The maximum (gust) wind speed in knots. Read-only.


magVar

The magnetic variance in degrees. The magVar value is added to a magnetic north direction to convert to true north. Read-only.


min

The base wind speed in knots. Read-only.


speedErrorMsg

An error message string for errors in the wind speed specification string. Read-only.


speedSpec

The wind speed string used to set the speed values. Read-only.


speedUnits

speedUnits

The wind speed units string for the speedSpec. Read-only.