pyarts3.recipe

Various recipes to simplify common tasks using ARTS.

class pyarts3.recipe.AtmosphericFlux(visible_surf_reflectivity: float = 0.3, thermal_surf_reflectivity: float = 0.05, atmospheric_altitude: float = 50000.0, surf_temperature: float = 300.0, max_level_step: float = 1000.0, NQuad: int = 16, atm_latitude: float = 0.0, atm_longitude: float = 0.0, solar_latitude: float = 0.0, solar_longitude: float = 0.0, species: list = ['H2O-161', 'O2-66', 'N2-44', 'CO2-626', 'O3-XFIT'], remove_lines_percentile: dict[SpeciesEnum, float] | float | None = None)[source]

Creates a Disort clearsky flux operator using the Czarnecki-scheme.

__call__(atm_profile: dict = {}, surf_temperature: float = None)[source]

Get the total flux profile

Parameters:
  • atm_profile (dict, optional) – A dictionary of atmospheric data. Defaults to {}.

  • surf_temperature (float, optional) – A surface temperature. Defaults to None.

Returns:

The solar and thermal fluxes and the center altitudes of the layers.

Return type:

Flux, Flux, numpy.ndarray

__init__(visible_surf_reflectivity: float = 0.3, thermal_surf_reflectivity: float = 0.05, atmospheric_altitude: float = 50000.0, surf_temperature: float = 300.0, max_level_step: float = 1000.0, NQuad: int = 16, atm_latitude: float = 0.0, atm_longitude: float = 0.0, solar_latitude: float = 0.0, solar_longitude: float = 0.0, species: list = ['H2O-161', 'O2-66', 'N2-44', 'CO2-626', 'O3-XFIT'], remove_lines_percentile: dict[SpeciesEnum, float] | float | None = None)[source]

Compute the total flux for a given atmospheric profile and surface temperature

The operator allows you to change the

Parameters:
  • visible_surf_reflectivity (float, optional) – The surface reflectivity constant for Disort in visible. Defaults to 0.3.

  • thermal_surf_reflectivity (float, optional) – The surface reflectivity constant for Disort in thermal. Defaults to 0.05.

  • atmospheric_altitude (float, optional) – The top-of-the-atmosphere altitude [m]. Defaults to 50e3.

  • surf_temperature (float, optional) – The surface temperature [K]. Defaults to 300.0.

  • max_level_step (float, optional) – The maximum thickness of layers [m]. Defaults to 1e3.

  • NQuad (int, optional) – The number of quadratures used by Disort. Defaults to 16.

  • atm_latitude (float, optional) – Latitude of profile [degrees]. Defaults to 0.0.

  • atm_longitude (float, optional) – Longitude of profile [degrees]. Defaults to 0.0.

  • solar_latitude (float, optional) – Latitude of sun [degrees]. Defaults to 0.0.

  • solar_longitude (float, optional) – Longitude of sun [degrees]. Defaults to 0.0.

  • species (list, optional) – The list of absorption species. Defaults to [ “H2O-161”, “O2-66”, “N2-44”, “CO2-626”, “O3-XFIT”, ].

  • remove_lines_percentile (dict | float | None, optional) – The percentile of lines to remove [0, 100]. Per species if dict. Defaults to None.

get_atmosphere(core=True, specs=True, nlte=False, ssprops=False, isots=False)[source]

Return the atmospheric field as a dictionary of python types.

Parameters:
  • core (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to True.

  • specs (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to True.

  • nlte (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to False.

  • ssprops (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to False.

  • isots (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to False.

Returns:

Atmospheric field dictionary

Return type:

dict

class pyarts3.recipe.SingleSpeciesAbsorption(species: str, cutoff: float = None)[source]

Calculates absorption coefficients for a single absorbing species.

__call__(freq_grid: AscendingGrid, atm_point: AtmPoint)[source]

Call operator to return a propagation matrix

Parameters:
  • freq_grid (AscendingGrid) – A list of frequency points.

  • atm_point (AtmPoint) – The state of the atmosphere at the point of interest

Returns:

numpy.ndarray – The propagation matrix at the frequency and point of interest Note that the first dimention is the size of the frequency grid and that the second dimension contains 7 variables, the first of which is unpolarized absorption.

Return type:

spectral_propmat

__init__(species: str, cutoff: float = None)[source]

Initialization

Parameters:
  • species (str) – See abs_speciesSet for details.

  • cutoff (float) – The cutoff value for the absorption bands. Defaults to None for no cutoff.

class pyarts3.recipe.SpectralAtmosphericFlux(visible_surf_reflectivity: float = 0.3, thermal_surf_reflectivity: float = 0.05, atmospheric_altitude: float = 50000.0, surf_temperature: float = 300.0, max_level_step: float = 1000.0, NQuad: int = 16, atm_latitude: float = 0.0, atm_longitude: float = 0.0, solar_latitude: float = 0.0, solar_longitude: float = 0.0, species=['H2O-161', 'O2-66', 'N2-44', 'CO2-626', 'O3-XFIT'], remove_lines_percentile: dict[SpeciesEnum, float] | float | None = None)[source]

Creates a Disort clearsky flux operator using the Czarnecki-scheme.

__call__(freq_grid: AscendingGrid, atm_profile: dict = {}, surf_temperature: float = None)[source]

Get the total flux profile

Parameters:
  • freq_grid (pyarts3.arts.AscendingGrid) – The frequency grid

  • atm_profile (dict, optional) – The atmospheric profile. Defaults to {}.

  • surf_temperature (float, optional) – The surface temperature. Defaults to None.

Returns:

Flux profile and average layer altitudes

Return type:

Flux, numpy.ndarray

__init__(visible_surf_reflectivity: float = 0.3, thermal_surf_reflectivity: float = 0.05, atmospheric_altitude: float = 50000.0, surf_temperature: float = 300.0, max_level_step: float = 1000.0, NQuad: int = 16, atm_latitude: float = 0.0, atm_longitude: float = 0.0, solar_latitude: float = 0.0, solar_longitude: float = 0.0, species=['H2O-161', 'O2-66', 'N2-44', 'CO2-626', 'O3-XFIT'], remove_lines_percentile: dict[SpeciesEnum, float] | float | None = None)[source]

Compute the total flux for a given atmospheric profile and surface temperature

The operator allows you to change the

Parameters:
  • visible_surf_reflectivity (float, optional) – The surface reflectivity constant for Disort in visible. Defaults to 0.3.

  • thermal_surf_reflectivity (float, optional) – The surface reflectivity constant for Disort in thermal. Defaults to 0.05.

  • atmospheric_altitude (float, optional) – The top-of-the-atmosphere altitude [m]. Defaults to 50e3.

  • surf_temperature (float, optional) – The surface temperature [K]. Defaults to 300.0.

  • max_level_step (float, optional) – The maximum thickness of layers [m]. Defaults to 1e3.

  • NQuad (int, optional) – The number of quadratures used by Disort. Defaults to 16.

  • atm_latitude (float, optional) – Latitude of profile [degrees]. Defaults to 0.0.

  • atm_longitude (float, optional) – Longitude of profile [degrees]. Defaults to 0.0.

  • solar_latitude (float, optional) – Latitude of sun [degrees]. Defaults to 0.0.

  • solar_longitude (float, optional) – Longitude of sun [degrees]. Defaults to 0.0.

  • species (list, optional) – The list of absorption species. Defaults to [ “H2O-161”, “O2-66”, “N2-44”, “CO2-626”, “O3-XFIT”, ].

  • remove_lines_percentile (dict | float | None, optional) – The percentile of lines to remove [0, 100]. Per species if dict. Defaults to None.

get_atmosphere(core=True, specs=True, nlte=False, ssprops=False, isots=False)[source]

Return the atmospheric field as a dictionary of python types.

Parameters:
  • core (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to True.

  • specs (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to True.

  • nlte (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to False.

  • ssprops (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to False.

  • isots (bool, optional) – See ArrayOfAtmPoint.to_dict(). Defaults to False.

Returns:

Atmospheric field dictionary

Return type:

dict

Heating-rate diagnostics

See Radiative heating rates for units, sampling locations and examples.

Radiance, flux and heating-rate diagnostics in SI units.

Positive heating warms the gas. Flux is positive upward. These functions accept NumPy-compatible arrays, including ARTS arrays. They do not infer brightness-temperature units, density, gravity or heat capacity.

pyarts3.recipe.heating_rates.flux_from_radiance(radiance, zenith, zenith_weights, *, axis=-1)[source]

Return positive upward and downward hemispheric irradiance.

radiance is Stokes I in W/(m² sr), or W/(m² sr Hz) for spectral data. It must be azimuth independent or already averaged over azimuth. zenith [degrees] uses the ARTS viewing direction: 0 looks upward (downward travelling radiation), 180 looks downward. zenith_weights integrate d(cos(zenith)), e.g. double-Gauss weights summing to two. This is a projected flux integral, with a cosine factor, not actinic flux. The angular axis is removed. Select Stokes I before calling this function.

pyarts3.recipe.heating_rates.from_disort(flux, extinction, density, heat_capacity, *, weights=None)[source]

Return lower-layer-boundary heating [K/s] from an ARTS DisortFlux.

extinction [1/m] broadcasts to flux.dfdt (frequency, layer), while density and heat capacity normally have shape (layer,). Use physical, unscaled extinction for delta-M calculations. Evaluate thermodynamic quantities at flux.alt_grid[1:]. Extinction is the value within the layer immediately above each output boundary. Frequency-dependent extinction is applied before spectral integration. Optional quadrature weights are in Hz.

pyarts3.recipe.heating_rates.from_flux(net_upward_flux, pressure, heat_capacity, gravity, *, axis=-1)[source]

Derive heating [K/s] from upward net flux [W/m²] at pressure levels.

pressure [Pa] is a strictly monotonic vector of at least three levels, in either order. Differentiate with the nonuniform three-point formula, including second-order one-sided boundaries. Heat capacity [J/(kg K)] and gravity [m/s²] broadcast against the result, whose shape is unchanged. For spectral flux, integrate over frequency first, or integrate the resulting spectral heating rates afterwards if g/cp is frequency independent.

pyarts3.recipe.heating_rates.from_flux_divergence(pressure_derivative, heat_capacity, gravity)[source]

Convert d(F_up-F_down)/dp [W m⁻² Pa⁻¹] to heating [K/s].

Hydrostatic balance gives H = g/cp * dF/dp. heat_capacity is mass specific [J/(kg K)] and gravity is positive [m/s²]. Scalar or array inputs follow NumPy broadcasting. No boundary values are suppressed.

pyarts3.recipe.heating_rates.from_optical_depth_derivative(dfdt, extinction, density, heat_capacity)[source]

Convert DISORT/VDISORT DFDT to heating, preserving spectral axes.

DFDT is d(F_up-F_down)/d(tau), with optical depth increasing downward. Multiply by physical extinction [1/m], then divide by density [kg/m³] and mass specific heat capacity [J/(kg K)]. The result is K/s for broadband inputs or K/(s Hz) for spectral inputs. All quantities must refer to the same locations; array inputs follow NumPy broadcasting. Extinction must be total extinction, not absorption (DFDT already contains the single-scattering-albedo factor). If a low-level VDISORT calculation uses externally rescaled optical depths, extinction must correspond to that rescaled coordinate. Scalar DISORT’s internal delta-M treatment returns physical DFDT and requires physical extinction.

pyarts3.recipe.heating_rates.integrate_spectral(values, frequency, *, axis=0, weights=None)[source]

Integrate per-Hz values over frequency [Hz].

Use trapezoidal integration on an increasing frequency grid, or explicit quadrature weights [Hz]. A single frequency requires an explicit weight. The selected axis is removed; all other axes retain their order.