Atmosphere
Main functions
- class SignalCreation.Read.Atmosphere.Atmosphere(path_file=None, type_file=None, station_name=None, month=None, latitude=-9999, order=0, size_min=1, size_max=None)
Class storing the temperature, pressure and density of the atmosphere according to the altitude
- Parameters:
path_file (str | list | None)
type_file (str | None)
station_name (str | None)
month (str | None)
latitude (int | float | None)
order (int)
size_min (int | float | None)
size_max (int | float | None)
- _collect_data_from_MAP85(filepath, month, latitude)
Reading method used in _fill_with_map85 because of the repetition of operation for temperature and pressure files :param filepath: Path to the file to read (pressure or temperature map85 file) :param month: The first 3-character of the corresponding month (JAN, FEB, MAR, …) :param latitude: latitude of the station :return: data (temperature or pressure) and altitude as list
- Parameters:
filepath (str)
month (str)
latitude (DataArray)
- _fill_data_set()
” Fill the data array storing the atmospheric profile
- _fill_radiosounding()
Fill the dataset from Radiosounding
- Returns:
- _fill_with_arletty()
Fill the dataset from Arletty files.
- _fill_with_ceti()
Fill the dataset from CETI files.
- _fill_with_map85(month, latitude)
Fill the dataset from MAP 85 files. :param month: Month to select in file :param latitude: Latitude to select in file :return:
- Parameters:
month (str)
latitude (int | float)
- _fill_with_ncep()
Fill the dataset from Ncep files. The atmosphere density being absent from the files, its calculated from the temperature and pressure for it to still be present in the main data set
- _fuse_data()
Fusion of altitude, temperature, pressure and density
- _fuse_data_total(value_prefix, altitude=None, log_interp=False, unit_value=None, fill_value='nan', range_altitude_glue=None)
Fuse data from different altitude profiles into a single data array.
This function combines data from multiple altitude profiles into a single data array. The profiles are selected based on a prefix, and the data is fused together considering altitude ranges and optional logarithmic interpolation.
- Parameters:
value_prefix (str) – The prefix of the data variables to be fused.
altitude (xr.DataArray or None, optional) – The altitude data to be used in the fusion process. If not provided, default altitude will be used.
log_interp (bool, optional) – Whether to apply logarithmic interpolation during the fusion process.
unit_value (str, pint.Unit, or None, optional) – The unit to which the data should be converted before fusing. This can be a string, a Pint unit, or None.
range_altitude_glue (int, float, pint.Quantity, or None, optional) – The altitude range to be used for merging the data. This can be specified as an integer, a float, or a Pint quantity. If None, a default of 1 km will be used.
fill_value (str, optional) – The value to be used for filling missing data. Default is “nan”.
- Returns:
A fused data array with altitude as the main coordinate
- Return type:
xr.DataArray
- _tropopause_altitude_calculation()
Calculation of the altitude of the tropopause, with the condition of the gradient must be higher than -2K/km over 1 km :return:
- add_model(path_file=None, type_file=None, station_name=None, month=None, latitude=-9999, order=0, fill_value=None)
Add model into the class
- Parameters:
path_file (str | list | None) – path of the file to read (default: None)
type_file (str | None) – type of the file (default: None
station_name (str | None) – name of the station (default: None)
month (str | None) – name of the month (default: None)
latitude (int | float | Quantity | None) – latitude of the station (default: -9999)
order (int) – order (when more than one model) (default: 0)
fill_value (str | list | None) – fill value (default: None)
- calc_density()
Compute density instead of reading it according to formula : N = P / (k * T) with k = 1.380649e-23 m2 kg s-2 K-1
- extinction_profile(wavelength, altitude)
Compute the evolution of the extinction profile and returns it in a pandas series
- Parameters:
wavelength (Quantity) – pint.Quantity Wavelength in the form of a pint object
altitude (Quantity) – pint.Quantity The list of altitudes in the form of Pint objects
- Returns:
pd.Series A pandas series giving the extinction profile in m^-1 with the altitude in km as index
- Return type:
Dataset
- get_absorption_coefficient_over_altitude(altitude, wavelength, method=None)
Calculation of atmopsheric obsorption coefficient
- Parameters:
altitude (DataArray) – altitude vector
wavelength (Quantity | float | int) – wavelength for the cross-section
method (str | None) – method for the cross-section
- Returns:
absorption coefficient with altitude as dimension
- Return type:
xr.DataArray
- get_altitude()
Get altitude vector :return:
- get_cross_section(wavelength, method='Nicolet', unit_cross_section=None)
Compute the atmospheric cross-section using Nicolet, Bucholtz or Eberhard’s formula :
Equation de Nicolet (1984) : https://doi.org/10.1016/0032-0633(84)90089-8 Equation de Bucholtz (1995) : https://doi.org/10.1364/AO.34.002765
Anthony Bucholtz, “Rayleigh-scattering calculations for the terrestrial atmosphere,” Appl. Opt. 34, 2765-2773 (1995)
Wynn L. Eberhard, “Correct equations and common approximations for calculating Rayleigh scatter in pure gases and mixtures and evaluation of differences,” Appl. Opt. 49, 1116-1130 (2010)
- Parameters:
wavelength (Quantity | float | int) – Union[pint.Quantity, float, int] The wavelength at which to compute the cross-section and its unit. If wavelength is given as a float or int, value must be given in nanometer
method – str Calculation method : should be one of [‘Bushlotz’, ‘Eberhard’] (default : ‘Bucholtz’)
unit_cross_section – str The desired unit for the output
- Returns:
The cross-section
- Return type:
Quantity
- get_density(altitude=None, unit_density=None, from_temp_dens=False)
- Get the density at a given altitude.
If the altitude is outside the model’s altitude range, the method returns None
- Parameters:
altitude (Quantity | None) – pint.Quantity The altitude at which the temperature must be returned, it can be a single value or an array
unit_density (str | None) – str The unit of the density
from_temp_dens (bool)
- Returns:
xr.DataArray The requested information
- get_diffusion_coefficient_over_altitude(altitude, wavelength, method=None)
Get the diffusion coefficient over altitude
- Parameters:
altitude (DataArray) – altitude vector
wavelength (Quantity | float | int) – wavelength for the cross-section
method (str | None) – method for the cross-section
- Returns:
diffusion coefficient with altitude as dimension
- Return type:
xr.DataArray
- get_pressure(altitude=None, unit_pressure=None, interp_each_modeles=True, range_altitude_glue=None)
Get the temperature at a given altitude.
If the altitude is outside the model’s altitude range, the method returns None
- Parameters:
altitude (Quantity | None) – pint.Quantity The altitude at which the temperature must be returned, it can be a single value or an array
unit_pressure – str The unit of the altitude
interp_each_modeles (bool)
range_altitude_glue (int | float | Quantity | None)
- Returns:
xr.DataArray The requested information
- Return type:
DataArray
- get_temperature(altitude, unit_temperature=None, interp_each_model=True, range_altitude_glue=None)
Get the temperature at a given altitude.
If the altitude is outside the model’s altitude range, the method returns None
- Parameters:
altitude (xr.DataArray) – The altitude at which the temperature must be returned, it can be a single value or an array
unit_temperature (str) – The unit of the temperature
interp_each_model (bool) – True if interpolation of each model (default: True)
range_altitude_glue (float, int, pint.Quantity or None) – altitude of gluing data (default: None)
- Returns:
The temperature at the requested altitude
- Return type:
xr.DataArray