" . $bodies[$i] . "";
}
$sb="";
if (isset($_GET['observer'])) {
if (urldecode($_GET['observer']) != "") {
$sb="\n #epoch { display: none; } \n";
}
}
$htmlis="
Astronomy Helper via Python PyEphem Module
Astronomy Helper via Python PyEphem module
RJM Programming - October, 2018
";
if (isset($_GET['body'])) {
if (urldecode($_GET['body']) != "") {
if (file_exists('py_ephem.xxx')) {
unlink('py_ephem.xxx');
}
if (file_exists('../Python/thisone.py')) {
unlink('../Python/thisone.py');
}
if (isset($_GET['epoch']) || isset($_GET['observer'])) {
if (urldecode($_GET['observer']) != "") {
$more="
";
file_put_contents("../Python/thisone.py", "import ephem\n" . urldecode($_GET['observer']) . "\n");
$htmlis=str_replace("", urldecode($_GET['observer']) . "", $htmlis);
exec("cat .." . '/' . "Python" . '/' . "Jupiter.py | grep -v '==' | grep -v 'import ephem' | sed '" . '/' . ".dec" . '/' . "s" . '/' . "" . '/' . ".az" . '/' . "g' | sed '" . '/' . ".ra" . '/' . "s" . '/' . "" . '/' . ".alt" . '/' . "g' | sed '" . '/' . "Jupiter" . '/' . "s" . '/' . "" . '/' . "" . urldecode($_GET['body']) . "" . '/' . "g' | sed \"" . '/' . "compute()" . '/' . "s" . '/' . "" . '/' . "compute(iam)" . '/' . "g\" | tr '!' '/' >> .." . '/' . "Python" . '/' . "thisone.py");
$htmlis=str_replace(">Right Ascension<", ">Altitude<", $htmlis);
$htmlis=str_replace(">Declination<", ">Azimuth<", $htmlis);
$htmlis=str_replace(">Astrometric geocentric<", ">Horizontal coordinate system<", $htmlis);
$htmlis=str_replace(":none;", ":block;", $htmlis);
$htmlis=str_replace(">Please select a Celestial Body below ...<", ">Celestial Bodies ...<", $htmlis);
} else if (urldecode($_GET['epoch']) != "") {
exec("cat .." . '/' . "Python" . '/' . "Jupiter.py | sed '" . '/' . "Jupiter" . '/' . "s" . '/' . "" . '/' . "" . urldecode($_GET['body']) . "" . '/' . "g' | sed \"" . '/' . "compute()" . '/' . "s" . '/' . "" . '/' . "compute(" . str_replace('/','!',urldecode($_GET['epoch'])) . ")" . '/' . "g\" | tr '!' '/' >> .." . '/' . "Python" . '/' . "thisone.py");
$htmlis=str_replace(" value=''", " value=\"" . urldecode($_GET['epoch']) . "\"", $htmlis);
} else {
exec("cat .." . '/' . "Python" . '/' . "Jupiter.py | sed '" . '/' . "Jupiter" . '/' . "s" . '/' . "" . '/' . "" . urldecode($_GET['body']) . "" . '/' . "g' >> .." . '/' . "Python" . '/' . "thisone.py");
}
} else {
exec("cat .." . '/' . "Python" . '/' . "Jupiter.py | sed '" . '/' . "Jupiter" . '/' . "s" . '/' . "" . '/' . "" . urldecode($_GET['body']) . "" . '/' . "g' >> .." . '/' . "Python" . '/' . "thisone.py");
}
exec("" . '/' . "usr" . '/' . "local" . '/' . "bin" . '/' . "python3.3 .." . '/' . "Python" . '/' . "thisone.py > py_ephem.xxx");
$ar_dec="";
if (file_exists('py_ephem.xxx')) {
$ar_dec=file_get_contents('py_ephem.xxx');
unlink('py_ephem.xxx');
$htmlis=str_replace(">" . urldecode($_GET['body']) . "<", " selected>" . urldecode($_GET['body']) . "<", $htmlis);
$htmlis=str_replace(" | ", " " . explode(" ",$ar_dec)[0] . " | ", $htmlis);
$htmlis=str_replace(" | ", " " . explode(" ",$ar_dec)[1] . $more . " | ", $htmlis);
}
}
}
echo $htmlis;
?>