// You can modify some preferences in Predict(), the defaults are below // // $predict->minEle = 10; // Minimum elevation for a pass // $predict->timeRes = 10; // Pass details: time resolution in seconds // $predict->numEntries = 20; // Pass details: number of entries per pass // $predict->threshold = -6; // Twilight threshold (sun must be at this lat or lower) // Get the passes and filter visible only, takes about 4 seconds for 10 days $results = $predict->get_passes($sat, $qth, $now, 10); $filtered = $predict->filterVisiblePasses($results); $zone = 'America/Los_Angeles'; // Pacific time zone $format = 'm-d-Y H:i:s'; // Time format from PHP's date() function // Format the output similar to the heavens-above.com website foreach ($filtered as $pass) { echo "AOS Daynum: " . $pass->visible_aos . "\n"; echo "AOS Time: " . Predict_Time::daynum2readable($pass->visible_aos, $zone, $format) . "\n"; echo "AOS Az: " . $predict->azDegreesToDirection($pass->visible_aos_az) . "\n"; echo "AOS El: " . round($pass->visible_aos_el) . "\n"; echo "Max Time: " . Predict_Time::daynum2readable($pass->visible_tca, $zone, $format) . "\n"; echo "Max Az: " . $predict->azDegreesToDirection($pass->visible_max_el_az) . "\n"; echo "Max El: " . round($pass->visible_max_el) . "\n"; echo "LOS Time: " . Predict_Time::daynum2readable($pass->visible_los, $zone, $format) . "\n"; echo "LOS Az: " . $predict->azDegreesToDirection($pass->visible_los_az) . "\n"; echo "LOS El: " . round($pass->visible_los_el) . "\n"; echo "Magnitude: " . number_format($pass->max_apparent_magnitude, 1) . "\n"; echo "\n"; } // How long did this take? echo "Execution time: " . number_format((microtime(true) - $start) * 1000, 2) . "ms\n"; exit;