Functions#

This is a list of general functions used in the PIA software

SPDX-FileCopyrightText: 2021 IMKAAF/KIT

SPDX-License-Identifier: GPL-3.0-or-later

pia.functions.Saturation(T_0, T, p_0, p)#

Calculates the saturation ratio with respect to Liquid water, assuming ice saturated conditions at T_0, p_0.

Parameters:
  • T_0 (float) – Temperature at start point in Kelvin

  • T (float) – Temperature for calculations in Kelvin

  • p_0 (float) – Pressure at start point

  • p (float) – Pressure for calculations

Returns:

S

Return type:

float

pia.functions.T_adiabatic(T_0, p_0, p)#

Calculates the temperature for an adiabatic cooling.

Parameters:
  • T_0 (float) – start temperature in Kelvin

  • p_0 (float) – start pressure

  • p (float) – pressure during cooling

Returns:

T_ad

Return type:

float

pia.functions.calculate_concentration(flow, count, time_del)#

Concentration in stdL-1

Parameters:
  • flow (float)

  • count (int) – particle count

  • time_del (float) – time interval

Returns:

count / (flow * time_del / 60)

Return type:

float

pia.functions.choose_time_interval(data_frame, start, stop)#

slices a time interval of a dataframe

Parameters:
  • data_frame (pd.DataFrame) – needed column: “date”

  • start (date)

  • stop (date)

Returns:

df – sliced dataframe

Return type:

pd.DataFrame

pia.functions.make_df_grid_log(num_bins, min_d, max_d)#

Creates a logarithmic grid

Parameters:
  • num_bins (int) – number of bins

  • min_d (float) – smallest bin

  • max_d (float) – biggest bin

Returns:

  • grid (pd.DataFrame) – DataFrame with bin sizes

  • distribution_bins (list) – list with bin names

pia.functions.make_time_grid(run_t, dt)#

Creates a time grid for a time interval of length run_t with bin sizes dt

Parameters:
  • run_t (float)

  • dt (int)

Returns:

t_grid

Return type:

np.array

pia.functions.saturation_pressure_ice(T)#

Calculates the saturation vapour pressure over ice for temperature T in Kelvin.

Parameters:

T (float)

Returns:

p_ice

Return type:

float

pia.functions.saturation_pressure_liquid(T)#

Calculates the saturation vapour pressure over supercooled water for temperature in Kelvin.

Parameters:

T (float)

Returns:

p_liq

Return type:

float