helikite.processing.post.altitude
Functions
|
Calculate dry and wet air density using the ideal gas law. |
|
Calculate the partial pressure of water vapor. |
|
Calculate water saturation vapor pressure for moist air. |
|
Estimate the altitude difference using a barometric formula. |
|
Calculate altitude using a simplified hypsometric equation. |
Calculate altitude from a data row of meteorological measurements. |
|
|
Interpolates pressure and temperature between takeoff and landing times, |
|
Averages pressure and temperature 60 seconds before takeoff and after landing, |
|
Calculates altitude using barometric formula based on ground pressure/temperature interpolation |
|
Calculates altitude using the hypsometric formula, based on ground pressure/temperature interpolation |
Module Contents
- helikite.processing.post.altitude.Air_density(T, P, RH=0)
Calculate dry and wet air density using the ideal gas law.
This function computes the dry air density from the ideal gas law based on a reference state and adjusts for moisture content using the water vapor pressure to yield the wet air density.
- Parameters:
T (float) – Temperature in Kelvin.
P (float) – Pressure in hPa.
RH (float, optional) – Relative humidity in percent (default is 0).
- Returns:
- A tuple containing:
dry air density in kg/m³
wet air density in kg/m³
- Return type:
tuple of float
Notes
The calculation uses standard reference conditions (rho0 = 1.29 kg/m³, P0 = 1013.25 hPa, T0 = 273.15 K) and applies an adjustment based on water vapor pressure.
- helikite.processing.post.altitude.waterpressure(RH, T, P)
Calculate the partial pressure of water vapor.
This function determines the water vapor pressure given the relative humidity, temperature, and pressure. It computes the saturation vapor pressure and then scales it by the relative humidity.
- Parameters:
RH (float) – Relative humidity in percent.
T (float) – Temperature in Kelvin.
P (float) – Pressure in hPa.
- Returns:
Partial pressure of water vapor in hPa.
- Return type:
float
- helikite.processing.post.altitude.Watersatpress(press, temp)
Calculate water saturation vapor pressure for moist air.
This function computes the saturation vapor pressure for water based on the WMO CIMO guide, valid for temperatures between -45°C and 60°C. The temperature is first converted from Kelvin to Celsius before applying the empirical formula.
- Parameters:
press (float) – Pressure in hPa.
temp (float) – Temperature in Kelvin.
- Returns:
Saturation vapor pressure of water (H₂O) in hPa.
- Return type:
float
References
- helikite.processing.post.altitude.EstimateAltitude(P0, Pb, T0)
Estimate the altitude difference using a barometric formula.
This function calculates the altitude based on the reference pressure, the observed barometric pressure, and the reference temperature. A standard relative humidity of 50% is assumed to compute the wet air density used in the calculation.
- Parameters:
P0 (float) – Reference pressure in hPa.
Pb (float) – Observed barometric pressure in hPa.
T0 (float) – Reference temperature in Kelvin.
- Returns:
Estimated altitude in meters.
- Return type:
float
- helikite.processing.post.altitude.calculate_altitude_hypsometric_simple(p0, p, t)
Calculate altitude using a simplified hypsometric equation.
This function estimates altitude based on the hypsometric formula. It uses the reference pressure (p0), observed pressure (p), and temperature in Celsius (t) to compute the altitude.
- Parameters:
p0 (float) – Reference pressure in hPa.
p (float) – Observed pressure in hPa.
t (float) – Temperature in Celsius.
- Returns:
Estimated altitude in meters.
- Return type:
float
- helikite.processing.post.altitude.calculate_altitude_for_row(row)
Calculate altitude from a data row of meteorological measurements.
This function extracts pressure and temperature data from a dictionary-like object and computes the altitude using a simplified hypsometric formula.
- Parameters:
row (dict-like) –
- Data structure containing the following keys:
”Pref”: reference pressure in hPa.
”P_baro”: observed barometric pressure in hPa.
”TEMP1”: temperature in Celsius.
- Returns:
Estimated altitude in meters.
- Return type:
float
- helikite.processing.post.altitude.calculate_ground(df, takeoff_time, landing_time, time_col, pressure_col, temp_col)
Interpolates pressure and temperature between takeoff and landing times, filling NaN values before takeoff and after landing.
- Parameters:
df (pd.DataFrame) – DataFrame containing flight data.
takeoff_time (datetime) – Timestamp of takeoff.
landing_time (datetime) – Timestamp of landing.
time_col (str) – Column name containing timestamps.
pressure_col (str) – Column name containing pressure data.
temp_col (str) – Column name containing temperature data.
- Returns:
DataFrame with ‘Pressure_ground’ and ‘Temperature_ground’ columns.
- Return type:
pd.DataFrame
- helikite.processing.post.altitude.calculate_ground_average(df, takeoff_time, landing_time, time_col, pressure_col, temp_col)
Averages pressure and temperature 60 seconds before takeoff and after landing, then interpolates between them across the flight duration.
- Parameters:
df (pd.DataFrame) – DataFrame containing flight data.
takeoff_time (datetime) – Timestamp of takeoff.
landing_time (datetime) – Timestamp of landing.
time_col (str) – Column name containing timestamps.
pressure_col (str) – Column name containing pressure data.
temp_col (str) – Column name containing temperature data.
- Returns:
DataFrame with ‘Pressure_ground’ and ‘Temperature_ground’ columns.
- Return type:
pd.DataFrame
- helikite.processing.post.altitude.altitude_calculation_barometric(df, metadata) pandas.DataFrame
Calculates altitude using barometric formula based on ground pressure/temperature interpolation and pressure readings during flight.
- Parameters:
df (pd.DataFrame) – DataFrame containing flight data.
metadata – Metadata object containing takeoff_time and landing_time.
- Returns:
Updated DataFrame with ‘Pressure_ground’, ‘Temperature_ground’, and ‘Altitude’ columns.
- Return type:
pd.DataFrame
- helikite.processing.post.altitude.altitude_calculation_hypsometric(df, metadata)
Calculates altitude using the hypsometric formula, based on ground pressure/temperature interpolation and pressure readings during flight.
- Parameters:
df (pd.DataFrame) – DataFrame containing flight data.
metadata – Metadata object containing takeoff_time and landing_time.
- Returns:
Updated DataFrame with ‘Pressure_ground’, ‘Temperature_ground’, and ‘Altitude’ columns.
- Return type:
pd.DataFrame