pytmosph3r.chemistry.chemistry

Module Contents

class Chemistry(name=None, gases=None)[source]

Bases: pytmosph3r.log.Logger

Base class to inherit from to compute abundances based on atmospheric properties.

Parameters:

gases (list) – List of gases to put in atmosphere

property shape
build(atmosphere)[source]

General function that will be called to compute the chemistry after atmosphere has been initialized. It iterates over gases by calling compute_vmr() on each gas.

Parameters:
  • atmosphere (AltitudeAtmosphere) – Altitude-based atmosphere in which to compute the volume mixing ratios of gases.

  • input_atmosphere (InputAtmosphere, optional) – Input atmosphere if you need it (with input mix_ratios for example).

abstract compute_vmr(gas, mix_ratio)[source]

This function can be overridden to compute the volume mixing ratio of a gas gas using mix_ratio, initialized to an array with the shape of the atmosphere.

Parameters:
  • gas (str) – Name of the gas

  • mix_ratio (array, np.ndarray) – Array full of ones of shape shape. The array is filled with the values in the atmosphere is the gas was already present, or else ones.

inputs()[source]