Physical constants

Physical constants as collections of scalar iris cubes.

aeolus.const.add_planet_conf_to_cubes(cubelist, const)[source]

Add constants container to the cube attributes and adjust its coord system.

Parameters:
  • cubelist (iris.cube.CubeList) – List of cubes containing a cube of zonal velocity (u).

  • const (aeolus.const.const.ConstContainer, optional) – Constainer with the relevant planetary constants.

aeolus.const.get_planet_radius(cube, default=6371229.0)[source]

Get the planet radius in metres from cube attributes.

aeolus.const.init_const(name='general', directory=None)[source]

Create a dataclass with a given set of constants.

Parameters:
  • name (str, optional) – Name of the constants set. Should be identical to the JSON file name (w/o the .json extension). If not given, only general physical constants are returned.

  • directory (pathlib.Path, optional) – Path to a folder with JSON files with constants for a specific planet.

Return type:

Dataclass with constants as iris cubes.

Examples

>>> c = init_const('earth')
>>> c
EarthConstants(gravity [m s-2], radius [m], day [s], ...)
>>> c.gravity
<iris 'Cube' of gravity / (m s-2) (scalar cube)>