Ejemplo n.º 1
0
 /**
  * Performs a [IRCS -> observed] coordinate transformation for the parameters
  * of this instance
  * @param  string       $type Coordintate type, 'e' for equat 'h' for horiz
  * @return static|Horiz
  */
 protected function ICRStoObserved($type = 'e', Pressure $pressure = null, Temperature $temp = null, $humidity = null)
 {
     // Instance initial properties
     $rc = $this->ra->toAngle()->rad;
     $dc = $this->dec->rad;
     $date1 = $this->epoch->toDate()->toTDB()->toJD();
     $pr = 0;
     $pd = 0;
     $rv = 0;
     $px = $this->dist->au > 0 ? 8.794 / 3600 / $this->dist->au : 0;
     $utc1 = $this->epoch->toDate()->toUTC()->toJD();
     $dut1 = IERS::jd($utc1)->dut1();
     $elong = $this->topo ? $this->topo->lon->rad : 0;
     $phi = $this->topo ? $this->topo->lat->rad : 0;
     $hm = 0;
     //$this->obsrv->height->m;
     $xp = IERS::jd($utc1)->x() / 3600 * pi() / 180;
     $yp = IERS::jd($utc1)->y() / 3600 * pi() / 180;
     $phpa = $pressure ? $pressure->mbar : 0;
     $tc = $temp ? $temp->c : 0;
     $rh = $humidity ? $humidity : 0;
     $wl = 0.55;
     // ICRS -> CIRS (geocentric observer)
     IAU::Atci13($rc, $dc, $pr, $pd, $px, $rv, $date1, 0, $ri, $di, $eo);
     // CIRS -> ICRS (astrometric)
     //IAU::Atic13($ri, $di, $date1, 0, $rca, $dca, $eo);
     // ICRS (astrometric) -> CIRS (geocentric observer)
     //IAU::Atci13($rca, $dca, $pr, $pd, $px, $rv, $date1, 0, $ri, $di, $eo);
     // Apparent place ?
     //$ri = $ri - $eo;
     //$di = $di;
     //
     // CIRS -> topocentric
     IAU::Atio13($ri, $di, $utc1, 0, $dut1, $elong, $phi, $hm, $xp, $yp, $phpa, $tc, $rh, $wl, $aob, $zob, $hob, $dob, $rob);
     if ($type == 'e') {
         // Copy this instance, and override the apparent RA and Decl
         $topocentric = $this->copy();
         $topocentric->ra = Angle::rad($rob)->toTime();
         $topocentric->dec = Angle::rad($dob);
         $topocentric->apparent = true;
         // Return apparent coordinates
         return $topocentric;
     } else {
         // Prepare new horizontal instance
         $horiz = new Horiz(Angle::rad(deg2rad(90) - $zob), Angle::rad($aob), $this->dist);
         return $horiz;
     }
 }
Ejemplo n.º 2
0
 /**
  * Converts this instance to Universal Time (UT1)
  * @return static
  */
 public function toUT1()
 {
     if ($this->timescale == TimeScale::UT1()) {
         return $this;
     }
     $this->toUTC();
     $utc1 = $this->jd;
     $utc2 = $this->dayFrac;
     $dut1 = IERS::jd($utc1 + $utc2)->dut1();
     IAU::Utcut1($utc1, $utc2, $dut1, $ut11, $ut12);
     $this->jd = $ut11;
     $this->dayFrac = $ut12;
     $this->timescale = TimeScale::UT1();
     return $this;
 }