public static CatalogCoords jauPvstar(double pv[][]) throws JSOFAInternalError
    {
       double x[] = new double[3], vr, ur[] = new double[3], vt, ut[] = new double[3], bett, betr, d, w, del,
              usr[] = new double[3], ust[] = new double[3];


    /* Isolate the radial component of the velocity (AU/day, inertial). */
       NormalizedVector nv = jauPn(pv[0]);
       x = nv.u;
       vr = jauPdp(x, pv[1]);
       ur = jauSxp(vr,x);

    /* Isolate the transverse component of the velocity (AU/day, inertial). */
       ut = jauPmp(pv[1], ur);
       vt = jauPm(ut);

    /* Special-relativity dimensionless parameters. */
       bett = vt / DC;
       betr = vr / DC;

    /* The inertial-to-observed correction terms. */
       d = 1.0 + betr;
       w = 1.0 - betr*betr - bett*bett;
       if (d == 0.0 || w < 0) throw new JSOFAInternalError("Superluminal speed", -1);
       del = sqrt(w) - 1.0;

    /* Apply relativistic correction factor to radial velocity component. */
       w = (betr != 0) ? (betr - del) / (betr * d) : 1.0;
       usr = jauSxp(w,ur);

    /* Apply relativistic correction factor to tangential velocity */
    /* component.                                                  */
       ust = jauSxp(1.0/d, ut);

    /* Combine the two to obtain the observed velocity vector (AU/day). */
       pv[1] = jauPpp(usr, ust);

    /* Cartesian to spherical. */
       SphericalPositionVelocity pvs = jauPv2s(pv);
       if (pvs.pos.r == 0.0) throw new JSOFAInternalError("null position vector", -2);

    /* Return RA in range 0 to 2pi. */
       double ra = jauAnp(pvs.pos.theta);

    /* Return proper motions in radians per year. */
       double pmr = pvs.vel.theta * DJY;
       double pmd = pvs.vel.phi * DJY;

    /* Return parallax in arcsec. */
       double px = DR2AS / pvs.pos.r;

    /* Return radial velocity in km/s. */
       double rv = 1e-3 * pvs.vel.r * DAU / DAYSEC;

    /* OK status. */
       return new CatalogCoords(ra, pvs.pos.phi, pmr, pmd, px, rv);

        }