fields.parse_value#
- fields.parse_value(value, default_units)[source]#
Parse an array of values into the correct units.
- Parameters:
value (
array-like
ortuple
) – The array from which to convert values to correct units. Ifvalue
is aunyt_array
, the unit is simply converted, ifvalue
is a tuple in the form(v_array,v_unit)
, the conversion will be made and will return anunyt_array
. Finally, ifvalue
is an array, it is assumed that thedefault_units
are correct.default_units (
str
) – The default unit for the quantity.
- Returns:
The converted array.
- Return type:
unyt_array