Physical constants

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 (without the .json extension). If not given, only general physical constants are returned.

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

Returns

Return type

Dataclass with constants as iris cubes.

Examples

>>> c = init_const('earth')
>>> c
EarthConstants(gravity [m s-2], radius [m], day [s], solar_constant [W m-2], ...)
>>> c.gravity
<iris 'Cube' of gravity / (m s-2) (scalar cube)>
class aeolus.const.const.ConstContainer[source]

Bases: object

Base class for creating dataclasses and storing planetary constants.

class aeolus.const.const.ScalarCube(data, standard_name=None, long_name=None, var_name=None, units=None, attributes=None, cell_methods=None, dim_coords_and_dims=None, aux_coords_and_dims=None, aux_factories=None, cell_measures_and_dims=None)[source]

Bases: iris.cube.Cube

Cube without coordinates.

property asc

Convert cube to AuxCoord for math ops.

classmethod from_cube(cube)[source]

Convert iris cube to ScalarCube.