ytree.data_structures.arbor.Arbor.arr

property Arbor.arr

Create a unyt_array using the Arbor’s unit system.

Parameters:
  • input_array (Iterable) – A tuple, list, or array to attach units to

  • units (String unit specification, unit symbol or astropy object) – The units of the array. Powers must be specified using python syntax (cm**3, not cm^3).

  • dtype (string or NumPy dtype object) – The dtype of the returned array data

Examples

>>> import ytree
>>> a = ytree.load("consistent_trees/tree_0_0_0.dat")
>>> a.arr([1,2,3], "kg")
unyt_array([1, 2, 3], 'kg')