wrf.to_np¶
-
wrf.
to_np
(array)¶ Return the
numpy.ndarray
contained in anxarray.DataArray
instance.If the
xarray.DataArray
instance does not contain a _FillValue or missing_value attribute, then this routine simply returns thexarray.DataArray.values
attribute. If thexarray.DataArray
object contains a _FillValue or missing_value attribute, then this routine returns anumpy.ma.MaskedArray
instance, where the NaN values (used by xarray to represent missing data) are replaced with the fill value.If the object passed in to this routine is not an
xarray.DataArray
instance, then this routine simply returns the passed in object. This is useful in situations where you do not know if you have anxarray.DataArray
or anumpy.ndarray
and simply want anumpy.ndarray
returned.Parameters: array ( xarray.DataArray
,numpy.ndarray
, or any object) – Can be any object type, but is generally used withxarray.DataArray
ornumpy.ndarray
.Returns: The extracted array or the array object if array is not a xarray.DataArray
object..Return type: numpy.ndarray
ornumpy.ma.MaskedArray