'The numerical value, possibly in a different unit.
Parameters
unit : `~astropy.units.UnitBase` instance or str, optional
The unit in which the value should be given. If not given or `None`,
use the current unit.
equivalencies : list of equivalence pairs, optional
A list of equivalence pairs to try if the units are not directly
convertible (see :ref:`unit_equivalencies`). If not provided or
``[]``, class default equivalencies will be used (none for
`~astropy.units.Quantity`, but may be set for subclasses).
If `None`, no equivalencies will be applied at all, not even any
set globally or within a context.
Returns
value : `~numpy.ndarray` or scalar
The value in the units specified. For arrays, this will be a view
of the data if no unit conversion was necessary.
See also
to : Get a new instance in a different unit.'

def to_value(self, unit=None, equivalencies=[]):

    value = self.view(np.ndarray)
    if (unit is not None):
        unit = Unit(unit)
        if (unit != self.unit):
            value = self._to_value(unit, equivalencies)
    return (value if self.shape else value.item())
