-
Notifications
You must be signed in to change notification settings - Fork 0
/
omc2.php
73 lines (56 loc) · 2.49 KB
/
omc2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<HTML>
<BODY style = "font-family:georgia;">
<?php include '../header.php';?>
<br>
<font style="font-size: 18pt;"><b>
EURONEAR - Tools - O-C Calculator v.2
</b></font>
<br><br>
Description: Derives observed minus calculated (O-C) residuals for known asteroids (NEAs or others) continuous observation. <br>
Input: Observing report (including header) including asteroid observations, in Minor Planet Centre (MPC) format. <br>
Output: Offset table showing for each object the O-C in right ascension and declination. <br>
Queries: The <a href="http://newton.dm.unipi.it/neodys/">NEODyS</a> and <a href="http://hamilton.dm.unipi.it/astdys/">AstDyS</a>
services (Milani et al., Univ Pisa).
Warning: Processing may take a few minutes for reports including multiple asteroids, or observations more than 3 days apart
<br>
<!----------------------------------------->
<!----- RUXANDRA PHP CODE STARTS HERE ----->
<!----------------------------------------->
<?php
require_once("common/omc_tools.php");
// echo ("\nTest\n");
echo '<br><form method="POST" enctype="multipart/form-data">';
//echo '<label for="file">Observations (file in MPC format - example <a href="'.ROOTURL.'data/MPCReportExample.txt">here</a>): </label>';
echo '<label for="file">Observations (file in MPC format - example <a href="MPCReportExample.txt">here</a>): </label>';
echo '<input type="file" name="omc_file" id="omc_file" /><br><br>';
echo '<input type="hidden" name="_submit_check_omc" value="1"/>';
echo '<input type="submit" name="submit" value="Calculate O-Cs" />';
echo '</form>';
if(isset($_POST["submit"])) {
if ($_FILES["omc_file"]["error"] > 0) {
echo "Upload error: " . $_FILES["omc_file"]["error"] . "<br />";
}
else {
echo "<br>Calculating...<br/>";
$contents = file_get_contents($_FILES["omc_file"]["tmp_name"]);
$oc = omc($contents);
if (is_string($oc)) {
echo "<br>" . $oc . "</br>";
}
//print_r($oc);
echo formatHTMLTable($oc, array_keys(reset($oc))) ;
}
}
?>
<!----------------------------------------->
<!------ RUXANDRA PHP CODE END HERE ------->
<!----------------------------------------->
<!------- TOOL PAGE FOOTER NOW -------->
<br>
Reference: Please include the following acknowledgement in any publication using this service: <br>
- Include in the acknowledgement: "This paper used the EURONEAR O-C Calculator v.2 \footnote{http://www.euronear.org/tools/omc2.php}". <br>
<br>
Author: Ruxandra Valcu (2018)
<br><br>
</BODY>
</HTML>