def ring_to_sky(Xr, Yr, i_deg, phi_deg):

    i = np.pi * i_deg / 180.
    phi = np.pi * phi_deg / 180.

    Xs = (np.cos(phi) * Xr) + (np.sin(phi) * np.sin(i) * Yr)
    Ys = (np.sin(phi) * Xr) - (np.cos(phi) * np.sin(i) * Yr)
    Rs = np.sqrt((Xs*Xs) + (Ys*Ys))

    return(Xs, Ys, Rs)
go from ring coordinate frame to the sky coordinate frame
dataset/ETHPy150Open mkenworthy/exorings/exorings.py/ring_to_sky