vtkmodules.util.xarray_support#

Module Contents#

Classes#

Functions#

cftime_toordinal

get_nc_type

Returns a nc_type given a numpy array.

Data#

API#

vtkmodules.util.xarray_support.cftime_toordinal(o)#
vtkmodules.util.xarray_support.ndarray_cftime_toordinal#

‘frompyfunc(…)’

vtkmodules.util.xarray_support.get_nc_type(numpy_array_type)#

Returns a nc_type given a numpy array.

class vtkmodules.util.xarray_support.VtkAccessor(xarray_obj)#

Initialization

reader()#

Returns a vtkNetCDFCFReader that reads data from the XArray (using zero-copy when possible). At the moment data is copied for coordinates (because they are converted to double in the reader) and for certain data that is subset either in XArray or in VTK. WARNING: the XArray has to be kept in memory while using the reader, otherwise you’ll get a segfault. Time is passed to VTK either as an int64 for datetime64 or timedelta64, or as a double (using cftime.toordinal) for cftime.

get_accessor()#