# lib.api¶

## Module Contents¶

lib.api.has_cdms = True
lib.api.degrees2radians(data, radianLimit)

Converts data from deg to radians

Example: >>> data = nominal_resolution.degrees2radians(data)  data (cdms2.tvariable.TransientVariable) – array to potentially convert from degrees to radians radianLimit (float_) – If the magnitude of any data value exceeds radianLimit, convert data from deg to rad. The same data converted from degrees to radians cdms2.tvariable.TransientVariable_
lib.api.mean_resolution(cellarea, latitude_bounds, longitude_bounds, convertdeg2rad, returnMaxDistance=False)

Computes mean nominal resolution

formula from: https://en.wikipedia.org/wiki/Great-circle_distance

Example: >>> mean = nominal_resolution.mean_resolution(cellarea, latitude_bounds, longitude_bounds, convertdeg2rad, returnMaxDistance=False)  cellarea (cdms2.tvariable.TransientVariable_) – simple array, python masked array, or cdms2 variable containing area of each cell latitude_bounds (numpy.ndarray_) – 2D numpy-like array containing latitudes vertices (ncell, nvertices). If None is passed and cdms2 is available, will try to obtain from cellarea grid longitude_bounds (numpy.ndarray_) – 2D numpy-like array containing longitudes vertices (ncell, nvertices). If None is passed and cdms2 is available, will try to obtain from cellarea grid convertdeg2rad (bool_) – set to True if lat/lon in degrees; set to false if in radians returnMaxDistance (bool_) – Returns an array representing the maximum distance (in km) between vertices for each cell the mean nominal resolution in km and optionally the maximum distance array float [,cdms2.tvariable.TransientVariable]_
lib.api.nominal_resolution(mean_resolution)

Example: param mean_resolution: >>> nom = nominal_resolution.nominal_resolution(mean_resolution)  The computed mean resolution for the model’s grid float_ The nominal resolution str_