Synthetic observations

Functions for calculating synthetic observations.

aeolus.synthobs.calc_geom_mean_mirrored(cube_a, cube_b, add_shift=0, model=Model [99 fields])[source]

Calculate geometric mean of 2 cubes, one of them flipped along the x-axis.

This function can be used to get an average transmission flux calculated separately from the day- and night-side perspective.

cube_a: iris.cube.Cube

Cube with an x-coordinate.

cube_b: iris.cube.Cube

Another cube, to be flipped before being averaged with cube A.

add_shift: int

Additional shift for the data along the x-coordinate.

model: aeolus.model.Model, optional

Model class with relevant variable names.

aeolus.synthobs.calc_stellar_flux(spectral_file, stellar_constant_at_1_au)[source]

Calculate the stellar flux per spectral band.

Parameters:
  • spectral_file (pathlib.Path) – Path to the location of a SOCRATES spectral file.

  • stellar_constant_at_1_au (float or iris.cube.Cube) – Stellar constant at 1 AU [W m-2].

Returns:

Stellar flux per spectral band [W m-2].

Return type:

iris.cube.Cube

aeolus.synthobs.calc_transmission_spectrum(trans_flux, spectral_file=None, stellar_constant_at_1_au=None, stellar_radius=None, planet_top_of_atmosphere=None, model=Model [99 fields])[source]

Convert the transmission flux to a planetary-stellar radius ratio.

Parameters:
  • trans_flux (iris.cube.Cube) – Transmission flux on spectral bands and optionally lats and lons. In the Met Office Unified Model this is STASH items 555, 556, 755, 756 in section 1.

  • spectral_file (pathlib.Path) – Path to the location of a SOCRATES spectral file.

  • stellar_constant_at_1_au (float or iris.cube.Cube) – Stellar constant at 1 AU [W m-2].

  • stellar_radius (float or iris.cube.Cube) – Stellar radius [m].

  • planet_top_of_atmosphere (float or iris.cube.Cube) – The extent of the planetary atmosphere [m].

  • model (aeolus.model.Model, optional) – Model class with relevant variable names.

Returns:

The ratio of the effective planetary radius to the stellar radius per spectral band [1]. Spectral band centres [m] is attached as an auxiliary coordinate.

Return type:

iris.cube.Cube

Notes

The transmission spectrum is the ratio of the effective planetary radius to the stellar radius calculated per spectral band:

\[\frac{R_p (\nu)}{R_s} = \sqrt{(\frac{R_{p,TOA}}{R_s})^2 - \frac{\sum_{lat,lon}^{}F_{trans} (\nu)}{F_{stellar} (\nu)}}\]

where \(R_p(\nu)\) is the effective planetary radius, \(R_s\) is the stellar radius, \(R_{p,TOA}\) is the extent of the planetary atmosphere (i.e. the sum of the planetary radius and the height of the model domain), \(\sum_{lat,lon}^{}F_{trans}(\nu)\) is the total transmitted flux, \(F_{stellar}(\nu)\) is the stellar flux.

Smaller gas abundance leads to the corresponding limb to be “more transmissive”, which leads it having smaller transit depth.

aeolus.synthobs.calc_transmission_spectrum_day_night_average(trans_flux_day, trans_flux_night, add_shift=0, spectral_file=None, stellar_constant_at_1_au=None, stellar_radius=None, planet_top_of_atmosphere=None, model=Model [99 fields])[source]

Convert the transmission flux to a planetary-stellar radius ratio.

For UM output, this function averages the flux calculated from the day-side and the night-side of the planet. Why does it use a geometric mean? The reason to use a geometric average instead of an arithmetic average is that the optical depths are added. The flux decreases via Beer’s law (i.e., it’s proportional to \(exp[-optical depth]\)) so when you multiply the dayside fluxes and nightside fluxes together and take a square root, you end up with \(exp[-( optical depth 1 + optical depth 2)/2]\). Since each optical depth is double the optical depth for it’s respective side, the factors of two cancel and you end up with \(exp[-(true optical depth)]\).

Parameters:
  • trans_flux_day (iris.cube.Cube) – Transmission flux on spectral bands and optionally lats and lons. Day-side perspective. In the Met Office Unified Model this is STASH items 555, 556, 755, 756 in section 1.

  • trans_flux_night (iris.cube.Cube) – Samea as day, but for the night-side calculation.

  • add_shift (int, optional) – Additional shift of data along the x-coordinate.

aeolus.synthobs.read_normalized_stellar_flux(spectral_file)[source]

Read the normalized stellar flux per band from a SOCRATES spectral file.

Parameters:

spectral_file (pathlib.Path) – Path to the location of the SOCRATES spectral file.

Returns:

Normalized stellar flux per spectral band [1].

Return type:

iris.cube.Cube

aeolus.synthobs.read_spectral_bands(spectral_file)[source]

Read spectral bands from a SOCRATES spectral file.

Parameters:

spectral_file (pathlib.Path) – Path to the location of a SOCRATES spectral file.

Returns:

An array with a list of tuples describing spectral bands. Tuple structure: (spectral_band_index, lower_wavelength_limit, upper_wavelength_limit). Units [m] as stated in a spectral file but not checked directly.

Return type:

numpy.ndarray