'Return a transform from data to the specified frame'

def _get_transform_no_transdata(self, frame):

    if ((self.wcs is None) and (frame != 'pixel')):
        raise ValueError('No    WCS    specified,    so    only    pixel    coordinates    are    available')
    if isinstance(frame, WCS):
        coord_in = wcs_to_celestial_frame(self.wcs)
        coord_out = wcs_to_celestial_frame(frame)
        if (coord_in == coord_out):
            return (WCSPixel2WorldTransform(self.wcs, slice=self.slices) + WCSWorld2PixelTransform(frame))
        else:
            return ((WCSPixel2WorldTransform(self.wcs, slice=self.slices) + CoordinateTransform(self.wcs, frame)) + WCSWorld2PixelTransform(frame))
    elif (frame == 'pixel'):
        return Affine2D()
    elif isinstance(frame, Transform):
        pixel2world = WCSPixel2WorldTransform(self.wcs, slice=self.slices)
        return (pixel2world + frame)
    else:
        pixel2world = WCSPixel2WorldTransform(self.wcs, slice=self.slices)
        if (frame == 'world'):
            return pixel2world
        else:
            coordinate_transform = CoordinateTransform(self.wcs, frame)
            if coordinate_transform.same_frames:
                return pixel2world
            else:
                return (pixel2world + CoordinateTransform(self.wcs, frame))
