def wcs_coord_transform(ct, x, y):
    """Computes tha WCS corrected pixel coordinates (RA and Dec
    in degrees) given a coordinate transformation and the screen
    coordinates (x and y, in pixels).

    Input:
    ct      coordinate transformation. instance of coord_tran.
    x       x coordinate in pixels.
    y       y coordinate in pixels.

    Returns:
    (RA, Dec) in degrees (as floats).
    """
    x = float(x)
    y = float(y)
    if ct.valid:
        if abs(ct.a) > 0.001:
            ra = ct.a * x + ct.c * y + ct.tx
        if abs(ct.d) > 0.001:
            dec = ct.b * x + ct.d * y + ct.ty
    else:
        ra = x
        dec = y
    return ra, dec
