'Create a Quantity view of some array-like input, and set the unit
By default, return a view of ``obj`` of the same class as ``self`` and
with the same unit.  Subclasses can override the type of class for a
given unit using ``__quantity_subclass__``, and can ensure properties
other than the unit are copied using ``__array_finalize__``.
If the given unit defines a ``_quantity_class`` of which ``self``
is not an instance, a view using this class is taken.
Parameters
obj : ndarray or scalar, optional
The array to create a view of.  If obj is a numpy or python scalar,
it will be converted to an array scalar.  By default, ``self``
is converted.
unit : `UnitBase`, or anything convertible to a :class:`~astropy.units.Unit`, optional
The unit of the resulting object.  It is used to select a
subclass, and explicitly assigned to the view if given.
If not given, the subclass and unit will be that of ``self``.
Returns
view : Quantity subclass'

def _new_view(self, obj=None, unit=None):

    if (unit is None):
        unit = self.unit
        quantity_subclass = self.__class__
    else:
        unit = Unit(unit)
        quantity_subclass = getattr(unit, u'_quantity_class', Quantity)
        if isinstance(self, quantity_subclass):
            (quantity_subclass, subok) = self.__quantity_subclass__(unit)
            if subok:
                quantity_subclass = self.__class__
    if (obj is None):
        obj = self.view(np.ndarray)
    else:
        obj = np.array(obj, copy=False)
    view = obj.view(quantity_subclass)
    view._set_unit(unit)
    view.__array_finalize__(self)
    return view
