Table of Contents

Class WeatherHelper

Namespace
Iot.Device.Common
Assembly
Iot.Device.Common.WeatherHelper.dll

Helpers for weather.

public static class WeatherHelper
Inheritance
WeatherHelper

Fields

MeanSeaLevel

The mean sea-level pressure (MSLP) is the average atmospheric pressure at mean sea level.

public static readonly Pressure MeanSeaLevel

Field Value

Pressure

Methods

CalculateActualVaporPressure(Temperature, RelativeHumidity)

Calculates the actual vapor pressure.

public static Pressure CalculateActualVaporPressure(Temperature airTemperature, RelativeHumidity relativeHumidity)

Parameters

airTemperature Temperature

The dry air temperature.

relativeHumidity RelativeHumidity

The relative humidity (RH).

Returns

Pressure

The actual vapor pressure.

CalculateAltitude(Pressure)

Calculates the altitude in meters from the given pressure. Assumes mean sea-level pressure and temperature of 15C.

public static Length CalculateAltitude(Pressure pressure)

Parameters

pressure Pressure

The pressure at the point for which altitude is being calculated.

Returns

Length

The altitude.

CalculateAltitude(Pressure, Pressure)

Calculates the altitude in meters from the given pressure and sea-level pressure. Assumes temperature of 15C.

public static Length CalculateAltitude(Pressure pressure, Pressure seaLevelPressure)

Parameters

pressure Pressure

The pressure at the point for which altitude is being calculated.

seaLevelPressure Pressure

The sea-level pressure.

Returns

Length

The altitude.

CalculateAltitude(Pressure, Pressure, Temperature)

Calculates the altitude in meters from the given pressure, sea-level pressure and air temperature.

public static Length CalculateAltitude(Pressure pressure, Pressure seaLevelPressure, Temperature airTemperature)

Parameters

pressure Pressure

The pressure at the point for which altitude is being calculated.

seaLevelPressure Pressure

The sea-level pressure.

airTemperature Temperature

The dry air temperature at the point for which altitude is being calculated.

Returns

Length

The altitude.

CalculateAltitude(Pressure, Temperature)

Calculates the altitude in meters from the given pressure and air temperature. Assumes mean sea-level pressure.

public static Length CalculateAltitude(Pressure pressure, Temperature airTemperature)

Parameters

pressure Pressure

The pressure at the point for which altitude is being calculated.

airTemperature Temperature

The dry air temperature at the point for which altitude is being calculated.

Returns

Length

The altitude.

CalculateBarometricPressure(Pressure, Temperature, Length)

Calculates the barometric pressure from a raw reading, using the reduction formula from the german met service. This is a more complex variant of CalculateSeaLevelPressure(Pressure, Length, Temperature). It gives the value that a weather station gives for a particular area and is also used in meteorological charts. You are at 650m over sea and measure a pressure of 948.7 hPa and a temperature of 24.0°C. The met service will show that you are within a high-pressure area of around 1020 hPa.

public static Pressure CalculateBarometricPressure(Pressure measuredPressure, Temperature measuredTemperature, Length measurementAltitude)

Parameters

measuredPressure Pressure

Measured pressure at the observation point.

measuredTemperature Temperature

Measured temperature at the observation point.

measurementAltitude Length

Height over sea level of the observation point (to be really precise, geopotential heights have to be used above ~750m). Do not use the height obtained by calling CalculateAltitude(Pressure) or any of its overloads, since what would use redundant data.

Returns

Pressure

The barometric pressure at the point of observation.

Remarks

CalculateBarometricPressure(Pressure, Temperature, Length, RelativeHumidity)

Calculates the barometric pressure from a raw reading, using the reduction formula from the german met service. This is a more complex variant of CalculateSeaLevelPressure(Pressure, Length, Temperature). It gives the value that a weather station gives for a particular area and is also used in meteorological charts. Use this method if you also have the relative humidity.

public static Pressure CalculateBarometricPressure(Pressure measuredPressure, Temperature measuredTemperature, Length measurementAltitude, RelativeHumidity relativeHumidity)

Parameters

measuredPressure Pressure

Measured pressure at the observation point.

measuredTemperature Temperature

Measured temperature at the observation point.

measurementAltitude Length

Height over sea level of the observation point (to be really precise, geopotential heights have to be used above ~750m).

relativeHumidity RelativeHumidity

Relative humidity at point of measurement.

Returns

Pressure

The barometric pressure at the point of observation.

Remarks

CalculateBarometricPressure(Pressure, Temperature, Pressure, Length)

Calculates the barometric pressure from a raw reading, using the reduction formula from the german met service. This is a more complex variant of CalculateSeaLevelPressure(Pressure, Length, Temperature). It gives the value that a weather station gives for a particular area and is also used in meteorological charts. You are at 650m over sea and measure a pressure of 948.7 hPa and a temperature of 24.0°C. The met service will show that you are within a high-pressure area of around 1020 hPa.

public static Pressure CalculateBarometricPressure(Pressure measuredPressure, Temperature measuredTemperature, Pressure vaporPressure, Length measurementAltitude)

Parameters

measuredPressure Pressure

Measured pressure at the observation point.

measuredTemperature Temperature

Measured temperature at the observation point.

vaporPressure Pressure

Vapor pressure, meteorologic definition.

measurementAltitude Length

Height over sea level of the observation point (to be really precise, geopotential heights have to be used above ~750m).

Returns

Pressure

The barometric pressure at the point of observation.

Remarks

CalculateDewPoint(Temperature, RelativeHumidity)

Calculates the dew point.

public static Temperature CalculateDewPoint(Temperature airTemperature, RelativeHumidity relativeHumidity)

Parameters

airTemperature Temperature

The dry air temperature.

relativeHumidity RelativeHumidity

The relative humidity (RH).

Returns

Temperature

The dew point.

Remarks

CalculateHeatIndex(Temperature, RelativeHumidity)

The heat index (or apparent temperature) is used to measure the amount of discomfort during the summer months when heat and humidity often combine to make it feel hotter than it actually is. The heat index is usually used for afternoon high temperatures.

public static Temperature CalculateHeatIndex(Temperature airTemperature, RelativeHumidity relativeHumidity)

Parameters

airTemperature Temperature

The dry air temperature.

relativeHumidity RelativeHumidity

The relative humidity (RH).

Returns

Temperature

The heat index, also known as the apparent temperature.

CalculatePressure(Pressure, Length, Temperature)

Calculates the approximate absolute pressure from given sea-level pressure, altitude and air temperature.

public static Pressure CalculatePressure(Pressure seaLevelPressure, Length altitude, Temperature airTemperature)

Parameters

seaLevelPressure Pressure

The sea-level pressure.

altitude Length

The altitude in meters at the point for which pressure is being calculated.

airTemperature Temperature

The air temperature at the point for which pressure is being calculated.

Returns

Pressure

The estimated absolute pressure at the given altitude.

CalculateSaturatedVaporPressureOverIce(Temperature)

Calculates the saturated vapor pressure for a given air temperature over ice. The formula used is valid for temperatures between -100°C and +0°C.

public static Pressure CalculateSaturatedVaporPressureOverIce(Temperature airTemperature)

Parameters

airTemperature Temperature

The dry air temperature.

Returns

Pressure

The saturated vapor pressure.

Remarks

CalculateSaturatedVaporPressureOverWater(Temperature)

Calculates the saturated vapor pressure for a given air temperature over water. The formula used is valid for temperatures between -100°C and +100°C.

public static Pressure CalculateSaturatedVaporPressureOverWater(Temperature airTemperature)

Parameters

airTemperature Temperature

The dry air temperature.

Returns

Pressure

The saturated vapor pressure.

Remarks

CalculateSeaLevelPressure(Pressure, Length, Temperature)

Calculates the approximate sea-level pressure from given absolute pressure, altitude and air temperature.

public static Pressure CalculateSeaLevelPressure(Pressure pressure, Length altitude, Temperature airTemperature)

Parameters

pressure Pressure

The air pressure at the point of measurement.

altitude Length

The altitude at the point of the measurement.

airTemperature Temperature

The air temperature.

Returns

Pressure

The estimated absolute sea-level pressure.

Remarks

CalculatePressure(Pressure, Length, Temperature) solved for sea level pressure.

CalculateTemperature(Pressure, Pressure, Length)

Calculates the temperature gradient for the given pressure difference.

public static Temperature CalculateTemperature(Pressure pressure, Pressure seaLevelPressure, Length altitude)

Parameters

pressure Pressure

The air pressure at the point for which temperature is being calculated.

seaLevelPressure Pressure

The sea-level pressure.

altitude Length

The altitude in meters at the point for which temperature is being calculated.

Returns

Temperature

The standard temperature at the given altitude, when the given pressure difference is known.

Remarks