masked_array¶
-
metpy.units.masked_array(data, data_units=None, **kwargs)[source]¶ Create a
numpy.ma.MaskedArraywith units attached.This is a thin wrapper around
numpy.ma.masked_array()that ensures that units are properly attached to the result (otherwise units are silently lost). Units are taken from theunitsargument, or if this isNone, the units ondataare used.Parameters: - data (array_like) – The source data. If
unitsis None, this should be a pint.Quantity with the desired units. - data_units (str or pint.Unit) – The units for the resulting pint.Quantity
- **kwargs (Arbitrary keyword arguments passed to
numpy.ma.masked_array) –
Returns: pint.Quantity
- data (array_like) – The source data. If