wrf.to_np¶
-
wrf.to_np(array)¶ Return the
numpy.ndarraycontained in anxarray.DataArrayinstance.If the
xarray.DataArrayinstance does not contain a _FillValue or missing_value attribute, then this routine simply returns thexarray.DataArray.valuesattribute. If thexarray.DataArrayobject contains a _FillValue or missing_value attribute, then this routine returns anumpy.ma.MaskedArrayinstance, 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.DataArrayinstance, then this routine simply returns the passed in object. This is useful in situations where you do not know if you have anxarray.DataArrayor anumpy.ndarrayand simply want anumpy.ndarrayreturned.Parameters: array ( xarray.DataArray,numpy.ndarray, or any object) – Can be any object type, but is generally used withxarray.DataArrayornumpy.ndarray.Returns: The extracted array or the array object if array is not a xarray.DataArrayobject..Return type: numpy.ndarrayornumpy.ma.MaskedArray