tobac.utils.general.get_spacings#

tobac.utils.general.get_spacings(field_in, grid_spacing=None, time_spacing=None, average_method='arithmetic')#

Determine spatial and temporal grid spacing of the input data.

Parameters:
  • field_in (iris.cube.Cube) – Input field where to get spacings.

  • grid_spacing (float, optional) – Manually sets the grid spacing if specified. Default is None.

  • time_spacing (float, optional) – Manually sets the time spacing if specified. Default is None.

  • average_method (string, optional) –

    Defines how spacings in x- and y-direction are combined.

    • ’arithmetic’ : standard arithmetic mean like (dx+dy)/2

    • ’geometric’ : geometric mean; conserves gridbox area

    Default is ‘arithmetic’.

Returns:

  • dxy (float) – Grid spacing in metres.

  • dt (float) – Time resolution in seconds.

Raises:

ValueError – If input_cube does not contain projection_x_coord and projection_y_coord or keyword argument grid_spacing.