Documentation page for netcdf4_utils.py

Interfacing netcdf data via netcdf4

Author: guangzhi XU (xugzhi1987@gmail.com; guangzhi.xu@outlook.com) Update time: 2021-01-24 17:30:56.

netcdf4_utils.checkGeomap(var, xarray, yarray)

Check input args suitable for geo plot or not and do some preprocessing

Parameters
  • var (TransientVariable) – input N-d TransientVariable.

  • xarray (ndarray) – 1d array, x-coordinates.

  • yarray (ndarray) – 1d array, y-coordinates.

Returns

isgeo (bool)

True if inputs are suitable for geographical plot, False

otherwise.

var (TransientVariable): input <var> with latitude order reversed if

needed.

xx (ndarray): 1d array, use longitude axis of <var> if possible,

<xarray> otherwise

yy (ndarray): 1d array, use latitude axis of <var> if possible,

<yarray> otherwise

netcdf4_utils.readData(varid)

Read in a variable from an netcdf file

Parameters
  • abpath_in (str) – absolute file path to the netcdf file.

  • varid (str) – id of variable to read.

Returns

ncvarNV (NCVAR) – variable stored as an NCVAR obj.