def pixtoradec(self, idxs, coords='data'):
        x, y = idxs[:2]

        # account for DATA->FITS coordinate space
        if coords == 'data':
            x, y = x + 1, y + 1

        crpix1, crpix2 = self.get_reference_pixel()
        crval1, crval2 = self.get_physical_reference_pixel()
        cd11, cd12, cd21, cd22 = self.get_pixel_coordinates()

        ra_deg = (cd11 * (x - crpix1) + cd12 *
                 (y - crpix2)) / math.cos(math.radians(crval2)) + crval1
        dec_deg = cd21 * (x - crpix1) + cd22 * (y - crpix2) + crval2

        return ra_deg, dec_deg
Convert a (x, y) pixel coordinate on the image to a (ra, dec)
dataset/ETHPy150Open ejeschke/ginga/ginga/util/wcsmod.py/BareBonesWCS.pixtoradec