Skip to content

Commit

Permalink
* Fixed some bugs found by hiphop-php
Browse files Browse the repository at this point in the history
* Modified Predict_Time::daynum2readable() to be hiphop-php compliant (5.2)
* Updated default iss.tle
  • Loading branch information
shupp committed Sep 7, 2011
1 parent 2338bb5 commit e03c0a6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 0 additions & 3 deletions Predict.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,12 @@ public function get_pass(Predict_Sat $sat_in, Predict_QTH $qth, $start, $maxdt)
$dt = 0.0; /* time diff */
$step = 0.0; /* time step */
$t0 = $start;
$t; /* current time counter */
$tres = 0.0; /* required time resolution */
$max_el = 0.0; /* maximum elevation */
$pass = null;
$detail = null;
$done = false;
$iter = 0; /* number of iterations */
$sat;
$sat_working;
/* FIXME: watchdog */

/*copy sat_in to a working structure*/
Expand Down
4 changes: 2 additions & 2 deletions Predict/SGPSDP.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ public function Deep($ientry, Predict_Sat $sat)
$sat->deep_arg->eosq + 3651.957 * $eoc;
$g422 = -3581.69 + 16178.11 * $eq - 24462.77 *
$sat->deep_arg->eosq+ 12422.52 * $eoc;
if (eq <= 0.715) {
if ($eq <= 0.715) {
$g520 = 1464.74 - 4664.75 * $eq + 3763.64 * $sat->deep_arg->eosq;
} else {
$g520 = -5149.66 + 29936.92 * $eq - 54087.36 *
Expand Down Expand Up @@ -922,7 +922,7 @@ public function Deep($ientry, Predict_Sat $sat)
+ $sat->dps->d5232 * sin(-$xomi + $sat->dps->xli- Predict::g52)
+ $sat->dps->d5421 * sin($xomi + $x2li - Predict::g54)
+ $sat->dps->d5433 * sin(-$xomi + $x2li - Predict::g54);
$xnddt = $sat->dps->d2201 * cos(x2omi + $sat->dps->xli- Predict::g22)
$xnddt = $sat->dps->d2201 * cos($x2omi + $sat->dps->xli- Predict::g22)
+ $sat->dps->d2211 * cos($sat->dps->xli - Predict::g22)
+ $sat->dps->d3210 * cos($xomi + $sat->dps->xli - Predict::g32)
+ $sat->dps->d3222 * cos(-$xomi + $sat->dps->xli - Predict::g32)
Expand Down
3 changes: 1 addition & 2 deletions Predict/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,7 @@ public static function daynum2unix($dn) {
public static function daynum2readable($dn, $zone = 'America/Los_Angeles', $format = 'm-d-Y H:i:s')
{
$unix = self::daynum2unix($dn);
$date = new DateTime();
$date->setTimestamp($unix);
$date = new DateTime("@" . round($unix));
$dateTimezone = new DateTimezone($zone);
$date->setTimezone($dateTimezone);
return $date->format($format);
Expand Down
4 changes: 2 additions & 2 deletions examples/iss.tle
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
ISS (ZARYA)
1 25544U 98067A 11232.40353973 .00006612 00000-0 84822-4 0 9211
2 25544 51.6402 197.5377 0012945 97.1493 41.3648 15.60444279730933
1 25544U 98067A 11249.89327546 .00012461 00000-0 15180-3 0 220
2 25544 51.6396 109.4958 0012500 161.0087 24.8413 15.60852157733666

0 comments on commit e03c0a6

Please sign in to comment.