konrad.ozone.OzoneHeight.create_variable

OzoneHeight.create_variable(name, data=None, dims=None)

Create a variable in the model component.

Parameters
  • name (str) – Variable name.

  • data (np.ndarray) – Data array with a shape matching the

  • dimensions (variable) –

  • dims (tuple[str]) – Tuple of strings specifying the dimension names.

Example

>>> c = Component()
>>> arr = np.arange(5)
>>> c.create_variable('foo', data=arr, dims=('index',))
>>> c['foo']
array([0, 1, 2, 3, 4])