'Overrides getattr to return coordinates that this can be transformed
to, based on the alias attr in the master transform graph.'

def __getattr__(self, attr):

    if (u'_sky_coord_frame' in self.__dict__):
        if (self.frame.name == attr):
            return self
        if (attr in frame_transform_graph.frame_attributes):
            if (attr in self.frame.get_frame_attr_names()):
                return getattr(self.frame, attr)
            else:
                return getattr(self, (u'_' + attr), None)
        if ((not attr.startswith(u'_')) and hasattr(self._sky_coord_frame, attr)):
            return getattr(self._sky_coord_frame, attr)
        frame_cls = frame_transform_graph.lookup_name(attr)
        if ((frame_cls is not None) and self.frame.is_transformable_to(frame_cls)):
            return self.transform_to(attr)
    raise AttributeError(u"'{0}'    object    has    no    attribute    '{1}'".format(self.__class__.__name__, attr))
