ppcpy.misc.molecular#
Functions
Calculate the refractive index of air. |
|
Cacluate the extinction coefficient for Rayleigh scattering. Inputs: wavelength : float or array of floats Wavelegnth [nm] pressure : float or array of floats Atmospheric pressure [hPa] temperature : float Atmospheric temperature [K] C : float CO2 concentration [ppmv]. rh : float Relative humidity from 0 to 100 [%] Returns: alpha: float The molecular scattering coefficient [m-1]. |
|
Calculates the total Rayleigh backscatter coefficient. Inputs: wavelength: float Wavelength [nm] pressure: float The atmospheric pressure [hPa] temperature: float The atmospheric temperature [K] C: float CO2 concentration [ppmv]. rh: float Relative humidity from 0 to 100 [%] Returns beta_pi: array molecule backscatter coefficient. [m^{-1}Sr^{-1}]. |
|
for a list of xarray averaged meteorology profiles, calculate the rayleigh scattering |
|
Compressibility of moist air. |
|
Calculates the angular rayleigh scattering cross section per molecule. Inputs: theta: float Scattering angle [rads] wavelength: float Wavelength [nm] pressure: float The atmospheric pressure [hPa] temperature: float The atmospheric temperature [K] C: float CO2 concentration [ppmv]. rh: float Relative humidity from 0 to 100 [%] Returns: dsigma: float rayleigh-scattering cross section [m2sr-1]. |
|
Enhancement factor. Inputs: pressure: float Atmospheric pressure [hPa] temperature: float Atmospehric temperature [K]. |
|
approximates the King's correction factor for a specific wavenumber. |
|
calculate the king factor. Usage: k = king_factor_atmosphere(wavelength, C, p_e, p_t) Inputs: wavelength: float Unit: nm C: float CO2 concentration in ppmv p_e: float water vapor pressure in hPa p_t: float total air pressure in hPa :returns:. |
|
Calculate the density of moist air. |
|
Molar fraction of water vapor. Inputs: pressure: float Total pressure [hPa] temperature: float Atmospehric temperature [K] relative_humidity: Relative humidity from 0 to 100 [%]. |
|
Molar mass of dry air as a function of CO2 concentration. |
|
Calculate the refractive index of standard air at a given wavelength. |
|
Calculate the refractive index of air at a specific wavelength with CO2 concentration. |
|
Calculate the refractive index of water vapor. |
|
Calculate the number density for a given temperature and pressure, taking into account the compressibility of air. Inputs: pressure: float or array Pressure in hPa temperature: float or array Temperature in K relative_humidity: float or array (?) ? The relative humidity of air (Check) ideal: boolean If False, the compressibility of air is considered. If True, the compressibility is set to 1. Returns: n: array or array Number density of the atmosphere [m^{-3}]. |
|
Calculates the phase function at an angle theta for a specific wavelegth. Inputs: theta: float Scattering angle [rads] wavelength: float Wavelength [nm] pressure: float The atmospheric pressure [hPa] temperature: float The atmospheric temperature [K] C: float CO2 concentration [ppmv]. rh: float Relative humidity from 0 to 100 [%] Returns: p: float Scattering phase function. |
|
Convert water vapour partial pressure to relative humidity. |
|
Calculate the molecular volume backscatter coefficient and extinction coefficient. |
|
Convert relative humidity to water vapour partial pressure. |
|
Calculate the depolarization factor of the atmosphere. |
|
Saturation vapor pressure of water of moist air. |
|
Calculates the Rayleigh-scattering cross section per molecule. |
- ppcpy.misc.molecular.air_refractive_index(wavelength, pressure, temperature, C, relative_humidity)[source]#
Calculate the refractive index of air. wavelength: Wavelength [nm] pressure: Atmospheric pressure [hPa] temperature: Atmospheric temperature [K] C: CO2 concentration [ppmv] relative_humidity: Relative humidity [%] Returns: Refractive index of air.
- ppcpy.misc.molecular.moist_air_density(pressure, temperature, C, Xw)[source]#
Calculate the density of moist air. pressure: Total pressure [hPa] temperature: Temperature [K] C: CO2 concentration [ppmv] Xw: Molar fraction of water vapor
- ppcpy.misc.molecular.molar_mass_dry_air(C)[source]#
Molar mass of dry air as a function of CO2 concentration. C: CO2 concentration [ppmv] Returns: Molar mass of dry air [kg/mol]
- ppcpy.misc.molecular.compressibility_of_moist_air(pressure, temperature, molar_fraction)[source]#
Compressibility of moist air. pressure: Total pressure [hPa] temperature: Temperature [K] molar_fraction: Molar fraction of water vapor
- ppcpy.misc.molecular.n_standard_air(wavelength)[source]#
Calculate the refractive index of standard air at a given wavelength.
- Parameters:
wavelength (float) – Wavelength [nm].
- Returns:
Refractive index of standard air.
- Return type:
float
- ppcpy.misc.molecular.n_standard_air_with_CO2(wavelength, C)[source]#
Calculate the refractive index of air at a specific wavelength with CO2 concentration.
- Parameters:
wavelength (float) – Wavelength [nm].
C (float) – CO2 concentration [ppmv].
- Returns:
Refractive index of air for the given CO2 concentration.
- Return type:
float
- ppcpy.misc.molecular.n_water_vapor(wavelength)[source]#
Calculate the refractive index of water vapor.
- Parameters:
wavelength (float) – Wavelength [nm].
- Returns:
Refractive index of water vapor.
- Return type:
float
- ppcpy.misc.molecular.alpha_rayleigh(wavelength, pressure, temperature, C, rh)[source]#
Cacluate the extinction coefficient for Rayleigh scattering. Inputs: wavelength : float or array of floats
Wavelegnth [nm]
- pressurefloat or array of floats
Atmospheric pressure [hPa]
- temperaturefloat
Atmospheric temperature [K]
- Cfloat
CO2 concentration [ppmv].
- rhfloat
Relative humidity from 0 to 100 [%]
Returns: alpha: float
The molecular scattering coefficient [m-1]
- ppcpy.misc.molecular.beta_pi_rayleigh(wavelength, pressure, temperature, C, rh)[source]#
Calculates the total Rayleigh backscatter coefficient. Inputs: wavelength: float
Wavelength [nm]
- pressure: float
The atmospheric pressure [hPa]
- temperature: float
The atmospheric temperature [K]
- C: float
CO2 concentration [ppmv].
- rh: float
Relative humidity from 0 to 100 [%]
Returns beta_pi: array
molecule backscatter coefficient. [m^{-1}Sr^{-1}]
- ppcpy.misc.molecular.dsigma_phi_rayleigh(theta, wavelength, pressure, temperature, C, rh)[source]#
Calculates the angular rayleigh scattering cross section per molecule. Inputs: theta: float
Scattering angle [rads]
- wavelength: float
Wavelength [nm]
- pressure: float
The atmospheric pressure [hPa]
- temperature: float
The atmospheric temperature [K]
- C: float
CO2 concentration [ppmv].
- rh: float
Relative humidity from 0 to 100 [%]
Returns: dsigma: float
rayleigh-scattering cross section [m2sr-1]
- ppcpy.misc.molecular.enhancement_factor_f(pressure, temperature)[source]#
Enhancement factor. Inputs: pressure: float
Atmospheric pressure [hPa]
- temperature: float
Atmospehric temperature [K]
- ppcpy.misc.molecular.kings_factor_atmosphere(wavelength, C, p_e, p_t)[source]#
calculate the king factor. Usage:
k = king_factor_atmosphere(wavelength, C, p_e, p_t)
- Inputs:
- wavelength: float
Unit: nm
- C: float
CO2 concentration in ppmv
- p_e: float
water vapor pressure in hPa
- p_t: float
total air pressure in hPa
- Returns:
- float
total atmospheric King’s factor
- Return type:
k
References
- ppcpy.misc.molecular.kings_factor_N2(wavenumber)[source]#
approximates the King’s correction factor for a specific wavenumber. According to Bates, the agreement with experimental values is “rather better than 1 per cent.”
Inputs: wavenumber : float Wavenumber (defined as 1/lamda) in cm-1 Returns: Fk : float Kings factor for N2 Notes: The King’s factor is estimated as: .. math:: F_{N_2} = 1.034 + 3.17 cdot 10^{-4} cdot lambda^{-2} where \(\lambda\) is the wavelength in micrometers. References: Tomasi, C., Vitale, V., Petkov, B., Lupi, A. & Cacciari, A. Improved algorithm for calculations of Rayleigh-scattering optical depth in standard atmospheres. Applied Optics 44, 3320 (2005). Bates, D. R.: Rayleigh scattering by air, Planetary and Space Science, 32(6), 785-790, doi:10.1016/0032-0633(84)90102-8, 1984.
- ppcpy.misc.molecular.molar_fraction_water_vapour(pressure, temperature, relative_humidity)[source]#
Molar fraction of water vapor. Inputs: pressure: float
Total pressure [hPa]
- temperature: float
Atmospehric temperature [K]
- relative_humidity:
Relative humidity from 0 to 100 [%]
- ppcpy.misc.molecular.number_density_at_pt(pressure, temperature, relative_humidity, ideal)[source]#
Calculate the number density for a given temperature and pressure, taking into account the compressibility of air. Inputs: pressure: float or array
Pressure in hPa
- temperature: float or array
Temperature in K
- relative_humidity: float or array (?)
? The relative humidity of air (Check)
- ideal: boolean
If False, the compressibility of air is considered. If True, the compressibility is set to 1.
Returns: n: array or array
Number density of the atmosphere [m^{-3}]
- ppcpy.misc.molecular.phase_function(theta, wavelength, pressure, temperature, C, rh)[source]#
Calculates the phase function at an angle theta for a specific wavelegth. Inputs: theta: float
Scattering angle [rads]
- wavelength: float
Wavelength [nm]
- pressure: float
The atmospheric pressure [hPa]
- temperature: float
The atmospheric temperature [K]
- C: float
CO2 concentration [ppmv].
- rh: float
Relative humidity from 0 to 100 [%]
Returns: p: float
Scattering phase function
Notes: The formula is derived from Bucholtz (1995). A different formula is given in Miles (2001).
The use of this formula insetad of the wavelenght independent 3/4(1+cos(th)**2) improves the results for back and forward scatterring by ~1.5%
Anthony Bucholtz, “Rayleigh-scattering calculations for the terrestrial atmosphere”, Applied Optics 34, no. 15 (May 20, 1995): 2765-2773.
R. B Miles, W. R Lempert, and J. N Forkey, “Laser Rayleigh scattering”, Measurement Science and Technology 12 (2001): R33-R51
- ppcpy.misc.molecular.pressure_to_rh(partial_pressure, temperature)[source]#
Convert water vapour partial pressure to relative humidity.
- Parameters:
partial_pressure (float) – Water vapour partial pressure [hPa]
temperature (float) – Temperature [K]
- Returns:
Relative humidity from 0 to 100 [%]
- Return type:
float
- ppcpy.misc.molecular.rh_to_pressure(rh, temperature)[source]#
Convert relative humidity to water vapour partial pressure.
- Parameters:
rh (float) – Relative humidity from 0 to 100 [%]
temperature (float) – Temperature [K]
- Returns:
Water vapour pressure [hPa]
- Return type:
float
- ppcpy.misc.molecular.rho_atmosphere(wavelength, C, p_e, p_t)[source]#
Calculate the depolarization factor of the atmosphere.
- Parameters:
wavelength (float or array) – Wavelength in nm
C (float) – CO2 concentration in ppmv
p_e (float) – water-vapor pressure [hPa]
p_t (float) – total air pressure [hPa]
- Returns:
Depolarization factor
- Return type:
float or array
- ppcpy.misc.molecular.saturation_vapor_pressure(temperature)[source]#
Saturation vapor pressure of water of moist air.
- Parameters:
temperature (float) – Atmospheric temperature [K]
- Returns:
Saturation vapor pressure [hPa]
- Return type:
float
- ppcpy.misc.molecular.sigma_rayleigh(wavelength, pressure, temperature, C, rh)[source]#
Calculates the Rayleigh-scattering cross section per molecule.
- Parameters:
wavelength (float) – Wavelength [nm]
pressure (float) – The atmospheric pressure [hPa]
temperature (float) – The atmospheric temperature [K]
C (float) – CO2 concentration [ppmv]
rh (float) – Relative humidity from 0 to 100 [%]
- Returns:
Rayleigh-scattering cross section [m2]
- Return type:
float
- ppcpy.misc.molecular.rayleigh_scattering(wavelength, pressure, temperature, C, rh)[source]#
Calculate the molecular volume backscatter coefficient and extinction coefficient.
Parameters:#
- wavelengthfloat
Wavelength in nanometers [nm].
- pressurefloat
Atmospheric pressure [hPa].
- temperaturefloat
Atmospheric temperature [K].
- Cfloat
CO2 concentration [ppmv].
- rhfloat
Relative humidity as a percentage (0 to 100).
Returns:#
- beta_molfloat
Molecular backscatter coefficient [m^{-1}*sr^{-1}].
- alpha_molfloat
Molecular extinction coefficient [m^{-1}].
References:#
Bucholtz, A.: Rayleigh-scattering calculations for the terrestrial atmosphere, Appl. Opt. 34, 2765-2773 (1995). A. Behrendt and T. Nakamura, “Calculation of the calibration constant of polarization lidar and its dependency on atmospheric temperature,” Opt. Express, vol. 10, no. 16, pp. 805-817, 2002.
History:#
First edition by Zhenping, 2017-12-16. Based on the Python source code of Ioannis Binietoglou’s [repo](https://bitbucket.org/iannis_b/lidar_molecular). AI-Translated, 2024-12-03