<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to(self, unit):
 """ convert between units. Returns a new nparray object with the new units """

        if not _has_astropy:
            raise ImportError("astropy must be installed for unit/quantity support")

        if self.unit is None:
            raise ValueError("no units currently set")

        if not is_unit_or_unitstring(unit)[0]:
            raise ValueError("unit not recognized")

        mult_factor = self.unit.to(unit)
        copy = self.copy() * mult_factor
        copy.unit = unit
        return copy