public static function Apio($sp, $theta, $elong, $phi, $hm, $xp, $yp, $refa,
          $refb, iauASTROM &$astrom) {

    $sl;
    $cl;
    $pv = [];

    /* Longitude with adjustment for TIO locator s'. */
    $astrom->along = $elong + $sp;

    /* Polar motion, rotated onto the local meridian. */
    $sl          = sin($astrom->along);
    $cl          = cos($astrom->along);
    $astrom->xpl = $xp * $cl - $yp * $sl;
    $astrom->ypl = $xp * $sl + $yp * $cl;

    /* Functions of latitude. */
    $astrom->sphi = sin($phi);
    $astrom->cphi = cos($phi);

    /* Observer's geocentric position and velocity (m, m/s, CIRS). */
    IAU::Pvtob($elong, $phi, $hm, $xp, $yp, $sp, $theta, $pv);

    /* Magnitude of diurnal aberration vector. */
    $astrom->diurab = sqrt($pv[1][0] * $pv[1][0] + $pv[1][1] * $pv[1][1]) / CMPS;

    /* Refraction constants. */
    $astrom->refa = $refa;
    $astrom->refb = $refb;

    /* Local Earth rotation angle. */
    IAU::Aper($theta, $astrom);

    /* Finished. */
  }