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