## Description

Calculate altitude by integrating the hypsometric equation. The altitude is integrated over time. The starting altitude depends upon the direction of integration and the type of sounding:

Type | Direction | Initial Altitude |
---|---|---|

Upsonde | Up | Station elevation |

Dropsonde | Up | 0, or a user provided starting elevation |

Dropsonde | Down | Aircraft provided launch altitude |

The dropsonde downward integration is always performed. It is useful when:

- it is not known if the dropsonde reached the surface,
- for cases where the surface elevation is unknown (i.e. over land),
- and as a data sanity check through comparison with the upward integration.

The downward height integration requires both a starting altitude and a starting pressure. If the pressure at launch time for a dropsonde is not available (a common situation on many aircraft), the first raw pressure point from the dropsonde is used as the launch pressure, but only for the purpose of height computation. This unwarranted assumption can lead to significant height errors if the raw sonde pressure data is late or inaccurate.

## Formula

Altitude is integrated from the initial point, for the points in the pressure time series. Incremental thickneses are caclulated using deltaZ(\(P_1\), \(P_2\), \(T_1\), \(T_2\), \(rh_1\), \(rh_2\)).

\(P_1\), \(P_2\), \(T_1\), \(T_2\), \(rh_1\), and \(rh_2\) are the pressure, temperature and relative humidity at the boundaries of each layer.

Temperature and relative humidity are interplated at the pressure times. If humidity is not available, a value of 50% is used. An interpolated temperature must be interpolatable within 60 seconds of the pressure time, otherwise the integration will terminate.

## Source

*Edit me*