geocontour.check module

Functions for checking the properties of various structures utilized by

geocontour

geocontour.check.cdim(dimension, exit_on_error=True)

Check input dimension array for 1-dimensionality and regular spacing

Parameters:
  • dimension (ndarray) – 1D Nx1 array of longitude or latitude points (degrees)

  • exit_on_error (bool, default=True) – flag to exit if an error is encountered

Return type:

None

geocontour.check.cboundary(boundary)

Check array of boundary points for 2-dimensionality and proper ordering

Parameters:

boundary (ndarray) – 2D Nx2 array of latitude/longitude points (degrees) with the last point equal to the first

Return type:

None

Notes

Will check whether columns (lat/lon) are ordered correctly but CAN’T GUARANTEE THIS

geocontour.check.cmask(mask, latitudes=None, longitudes=None)

Check mask array for correct data type and dimensionality, and optionally size

Parameters:
  • mask (ndarray) – 2D MxN bool array where M=len(latitudes) and N=len(longitudes)

  • latitudes (ndarray, optional) – 1D Nx1 array of latitude points (degrees)

  • longitudes (ndarray, optional) – 1D Nx1 array of longitude points (degrees)

Return type:

None

geocontour.check.ccontour(contour, latitudes=None, longitudes=None)

Check contour for repeating cells, closure, and connectivity, and optionally lat/lon range

Parameters:
  • contour (ndarray) – 2D Nx2 array of ordered latitude/longitude points (degrees) describing the edge of a mask

  • latitudes (ndarray, optional) – 1D Nx1 array of latitude points (degrees)

  • longitudes (ndarray, optional) – 1D Nx1 array of longitude points (degrees)

Return type:

None

geocontour.check.cgeocontour(geocontour, latitudes, longitudes)

Check geocontour for latitude/longitude range and dimension

Parameters:
  • geocontour (ndarray) – 3D Nx2x5 array defining a list of N contour cells (column 1), their edge points (columns 2,3), segment lengths (column 4), and outward unit vectors (column 5)

  • latitudes (ndarray) – 1D Nx1 array of latitude points (degrees)

  • longitudes (ndarray) – 1D Nx1 array of longitude points (degrees)

Return type:

None