argopy.utils.is_box

Contents

argopy.utils.is_box#

is_box(box: list, errors: str = 'raise')[source]#

Check if this array matches a 3d or 4d data box definition

Argopy expects one of the following 2 format to define a box:

  • box = [lon_min, lon_max, lat_min, lat_max, pres_min, pres_max]

  • box = [lon_min, lon_max, lat_min, lat_max, pres_min, pres_max, datim_min, datim_max]

This function check for this format compliance.

Parameters:
  • box (list)

  • errors (str, default: raise) –

    Define how to handle box format non-compliance:
    • raise: Raise ValueError message

    • warn: Return False and issue warning

    • ignore: Return False and issue warning in logging console

    • silent: Return False

Return type:

bool