From 231d61c3f6023fee62e64c2bcf14c9b1cc95701a Mon Sep 17 00:00:00 2001 From: jonsowman Date: Thu, 27 May 2010 21:36:13 +0100 Subject: [PATCH] moved to workingdir --- {gui/css => css}/pred.css | 0 gui/index.php | 293 -------------- gui/new.csv | 176 --------- {gui/images => images}/arrow.png | Bin {gui/images => images}/balloon.png | Bin {gui/images => images}/marker-sm-red.png | Bin {gui/images => images}/pop-marker.png | Bin {gui/images => images}/target-1.png | Bin {gui/images => images}/target-10.png | Bin {gui/images => images}/target-11.png | Bin {gui/images => images}/target-12.png | Bin {gui/images => images}/target-13.png | Bin {gui/images => images}/target-14.png | Bin {gui/images => images}/target-15.png | Bin {gui/images => images}/target-16.png | Bin {gui/images => images}/target-17.png | Bin {gui/images => images}/target-18.png | Bin {gui/images => images}/target-2.png | Bin {gui/images => images}/target-3.png | Bin {gui/images => images}/target-4.png | Bin {gui/images => images}/target-5.png | Bin {gui/images => images}/target-6.png | Bin {gui/images => images}/target-7.png | Bin {gui/images => images}/target-8.png | Bin {gui/images => images}/target-9.png | Bin {gui/images => images}/target-blue.png | Bin {gui/images => images}/target-red.png | Bin {gui/images => images}/target-yellow.png | Bin index.1.php | 208 ++++++++++ index.php.old => index.1.php.old | 0 gui/index.html.old => index.html.old | 0 index.php | 479 +++++++++++++---------- {gui/js => js}/jquery.js | 0 {gui/js => js}/mootools-1.2.4.2-more.js | 0 {gui/js => js}/pred.js | 0 35 files changed, 490 insertions(+), 666 deletions(-) rename {gui/css => css}/pred.css (100%) delete mode 100644 gui/index.php delete mode 100644 gui/new.csv rename {gui/images => images}/arrow.png (100%) rename {gui/images => images}/balloon.png (100%) rename {gui/images => images}/marker-sm-red.png (100%) rename {gui/images => images}/pop-marker.png (100%) rename {gui/images => images}/target-1.png (100%) rename {gui/images => images}/target-10.png (100%) rename {gui/images => images}/target-11.png (100%) rename {gui/images => images}/target-12.png (100%) rename {gui/images => images}/target-13.png (100%) rename {gui/images => images}/target-14.png (100%) rename {gui/images => images}/target-15.png (100%) rename {gui/images => images}/target-16.png (100%) rename {gui/images => images}/target-17.png (100%) rename {gui/images => images}/target-18.png (100%) rename {gui/images => images}/target-2.png (100%) rename {gui/images => images}/target-3.png (100%) rename {gui/images => images}/target-4.png (100%) rename {gui/images => images}/target-5.png (100%) rename {gui/images => images}/target-6.png (100%) rename {gui/images => images}/target-7.png (100%) rename {gui/images => images}/target-8.png (100%) rename {gui/images => images}/target-9.png (100%) rename {gui/images => images}/target-blue.png (100%) rename {gui/images => images}/target-red.png (100%) rename {gui/images => images}/target-yellow.png (100%) create mode 100644 index.1.php rename index.php.old => index.1.php.old (100%) rename gui/index.html.old => index.html.old (100%) rename {gui/js => js}/jquery.js (100%) rename {gui/js => js}/mootools-1.2.4.2-more.js (100%) rename {gui/js => js}/pred.js (100%) diff --git a/gui/css/pred.css b/css/pred.css similarity index 100% rename from gui/css/pred.css rename to css/pred.css diff --git a/gui/index.php b/gui/index.php deleted file mode 100644 index 5fa8dc0..0000000 --- a/gui/index.php +++ /dev/null @@ -1,293 +0,0 @@ - (time() + 180*3600)) { - die("The time was too far in the future, 180 days max"); - } - - // SANITY CHECK ALL POST VARS HERE - - if ( $pred_software == $software_available[0] ) { // using grib - // - } else if ( $pred_software == $software_available[1] ) { // using dap - // - } else { - die("We couldn't find the software you asked for"); - } -} - -?> - - - - CUSF Landing Prediction 2 - GUI test - - - - - - - -
-
-

Debug Window

-No Messages -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Launch Site: - -
Latitude:
Longitude:
Launch altitude (m):
Launch Time: - " maxlength="2" size="2"> : - " maxlength="2" size="2"> -
Launch Date: - - - -
Ascent Rate (m/s):
Descent Rate (sea level m/s):
Burst Altitude (m):
Float time at apogee (s):
Landing prediction software: - -
- -
-
-
- - - - diff --git a/gui/new.csv b/gui/new.csv deleted file mode 100644 index 206ea59..0000000 --- a/gui/new.csv +++ /dev/null @@ -1,176 +0,0 @@ -1274997650,52.2134,0.100343,250 -1274997700,52.2126,0.105933,500 -1274997750,52.2119,0.111818,750 -1274997800,52.2113,0.117999,1000 -1274997850,52.2109,0.124788,1250 -1274997900,52.2104,0.131845,1500 -1274997950,52.2101,0.139078,1750 -1274998000,52.2101,0.146274,2000 -1274998050,52.2102,0.15374,2250 -1274998100,52.2104,0.161393,2500 -1274998150,52.2106,0.169389,2750 -1274998200,52.2107,0.17825,3000 -1274998250,52.2111,0.187804,3250 -1274998300,52.2117,0.198313,3500 -1274998350,52.2125,0.209847,3750 -1274998400,52.2135,0.222338,4000 -1274998450,52.2148,0.235413,4250 -1274998500,52.2164,0.249184,4500 -1274998550,52.218,0.263648,4750 -1274998600,52.2199,0.278888,5000 -1274998650,52.222,0.294957,5250 -1274998700,52.2246,0.312267,5500 -1274998750,52.2273,0.330395,5750 -1274998800,52.2305,0.34978,6000 -1274998850,52.2338,0.370015,6250 -1274998900,52.2372,0.391462,6500 -1274998950,52.2412,0.414484,6750 -1274999000,52.2454,0.438249,7000 -1274999050,52.2499,0.462996,7250 -1274999100,52.2547,0.488868,7500 -1274999150,52.26,0.515799,7750 -1274999200,52.2657,0.54312,8000 -1274999250,52.2715,0.571192,8250 -1274999300,52.2774,0.599848,8500 -1274999350,52.2836,0.629299,8750 -1274999400,52.2897,0.659225,9000 -1274999450,52.2958,0.689587,9250 -1274999500,52.3018,0.719743,9500 -1274999550,52.3075,0.749533,9750 -1274999600,52.3131,0.778285,10000 -1274999650,52.3181,0.80659,10250 -1274999700,52.3229,0.833251,10500 -1274999750,52.3274,0.857854,10750 -1274999800,52.3316,0.881211,11000 -1274999850,52.3352,0.902966,11250 -1274999900,52.3385,0.922042,11500 -1274999950,52.3407,0.940643,11750 -1275000000,52.3428,0.955849,12000 -1275000050,52.3443,0.970143,12250 -1275000100,52.3463,0.98264,12500 -1275000150,52.3481,0.9943,12750 -1275000200,52.3498,1.00519,13000 -1275000250,52.3516,1.01591,13250 -1275000300,52.3533,1.02593,13500 -1275000350,52.3551,1.0358,13750 -1275000400,52.3567,1.0453,14000 -1275000450,52.3582,1.0547,14250 -1275000500,52.3596,1.06371,14500 -1275000550,52.361,1.07234,14750 -1275000600,52.3622,1.08077,15000 -1275000650,52.3635,1.08886,15250 -1275000700,52.3646,1.09691,15500 -1275000750,52.3655,1.10458,15750 -1275000800,52.3663,1.11176,16000 -1275000850,52.3671,1.11863,16250 -1275000900,52.3677,1.1255,16500 -1275000950,52.3684,1.13194,16750 -1275001000,52.3689,1.13854,17000 -1275001050,52.3693,1.14473,17250 -1275001100,52.3698,1.15078,17500 -1275001150,52.3701,1.1565,17750 -1275001200,52.3706,1.16191,18000 -1275001250,52.3708,1.1669,18250 -1275001300,52.371,1.17171,18500 -1275001350,52.3714,1.17622,18750 -1275001400,52.3718,1.18047,19000 -1275001450,52.3722,1.18472,19250 -1275001500,52.3723,1.18831,19500 -1275001550,52.3724,1.19169,19750 -1275001600,52.3727,1.19484,20000 -1275001650,52.3728,1.19777,20250 -1275001700,52.3731,1.20014,20500 -1275001750,52.3729,1.2025,20750 -1275001800,52.3733,1.20423,21000 -1275001850,52.3735,1.20624,21250 -1275001900,52.3736,1.2073,21500 -1275001950,52.3737,1.2084,21750 -1275002000,52.374,1.20915,22000 -1275002050,52.3739,1.20967,22250 -1275002100,52.374,1.20973,22500 -1275002150,52.3741,1.21007,22750 -1275002200,52.3741,1.20987,23000 -1275002250,52.3741,1.20937,23250 -1275002300,52.374,1.20883,23500 -1275002350,52.374,1.20778,23750 -1275002400,52.3741,1.20647,24000 -1275002450,52.3742,1.2049,24250 -1275002500,52.3742,1.20343,24500 -1275002550,52.3741,1.20176,24750 -1275002600,52.3742,1.20008,25000 -1275002650,52.3742,1.19829,25250 -1275002700,52.3741,1.19663,25500 -1275002750,52.3741,1.19485,25750 -1275002800,52.374,1.19285,26000 -1275002850,52.3739,1.19072,26250 -1275002900,52.3737,1.1886,26500 -1275002950,52.3736,1.18649,26750 -1275003000,52.3738,1.18425,27000 -1275003050,52.374,1.18173,27250 -1275003100,52.3741,1.17875,27500 -1275003150,52.3742,1.176,27750 -1275003200,52.3741,1.17298,28000 -1275003250,52.3739,1.16978,28250 -1275003300,52.3742,1.16621,28500 -1275003350,52.3742,1.16269,28750 -1275003400,52.3743,1.15915,29000 -1275003450,52.3743,1.15524,29250 -1275003500,52.3746,1.1508,29500 -1275003550,52.3747,1.14628,29750 -1275003600,52.3748,1.14189,30000 -1275003650,52.3751,1.13834,28066.9 -1275003700,52.375,1.13602,26398.8 -1275003750,52.375,1.13432,24936.2 -1275003800,52.3751,1.13304,23639.3 -1275003850,52.3753,1.1327,22462.4 -1275003900,52.3756,1.13345,21385.1 -1275003950,52.3758,1.13531,20392 -1275004000,52.3759,1.13803,19470.8 -1275004050,52.3761,1.14193,18611.8 -1275004100,52.3763,1.14688,17807 -1275004150,52.3766,1.15271,17050.2 -1275004200,52.3772,1.15921,16335.8 -1275004250,52.3779,1.16636,15659.4 -1275004300,52.3791,1.17433,15017.1 -1275004350,52.3805,1.18257,14405.7 -1275004400,52.3823,1.19183,13822.3 -1275004450,52.3843,1.20161,13264.4 -1275004500,52.3864,1.21215,12730 -1275004550,52.3883,1.22417,12217.1 -1275004600,52.3903,1.23888,11724 -1275004650,52.3936,1.25691,11249.4 -1275004700,52.3978,1.27908,10791.4 -1275004750,52.4033,1.30401,10346.6 -1275004800,52.4096,1.33196,9913.87 -1275004850,52.4164,1.36188,9492.4 -1275004900,52.4236,1.39217,9081.49 -1275004950,52.4309,1.42234,8680.53 -1275005000,52.4382,1.45155,8288.91 -1275005050,52.4451,1.48001,7906.14 -1275005100,52.4516,1.50785,7531.73 -1275005150,52.4574,1.53473,7165.24 -1275005200,52.4629,1.5602,6806.27 -1275005250,52.4677,1.58419,6454.45 -1275005300,52.4725,1.60657,6109.45 -1275005350,52.4769,1.62731,5770.94 -1275005400,52.4808,1.64621,5438.63 -1275005450,52.4842,1.66351,5112.24 -1275005500,52.4873,1.67953,4791.52 -1275005550,52.49,1.69482,4476.25 -1275005600,52.4924,1.70924,4166.18 -1275005650,52.4947,1.72221,3861.12 -1275005700,52.4968,1.73419,3560.86 -1275005750,52.4985,1.74507,3265.24 -1275005800,52.4999,1.75524,2974.07 -1275005850,52.5011,1.7649,2687.19 -1275005900,52.5024,1.77398,2404.45 -1275005950,52.504,1.78264,2125.71 -1275006000,52.5057,1.79036,1850.82 -1275006050,52.507,1.7972,1579.66 -1275006100,52.5078,1.8036,1312.11 -1275006150,52.5083,1.80968,1048.05 -1275006200,52.5083,1.81536,787.371 -1275006250,52.508,1.82069,529.965 -1275006300,52.5077,1.82582,275.734 -1275006350,52.5077,1.83058,24.584 -1275006355,52.5077,1.83095,-0.365139 diff --git a/gui/images/arrow.png b/images/arrow.png similarity index 100% rename from gui/images/arrow.png rename to images/arrow.png diff --git a/gui/images/balloon.png b/images/balloon.png similarity index 100% rename from gui/images/balloon.png rename to images/balloon.png diff --git a/gui/images/marker-sm-red.png b/images/marker-sm-red.png similarity index 100% rename from gui/images/marker-sm-red.png rename to images/marker-sm-red.png diff --git a/gui/images/pop-marker.png b/images/pop-marker.png similarity index 100% rename from gui/images/pop-marker.png rename to images/pop-marker.png diff --git a/gui/images/target-1.png b/images/target-1.png similarity index 100% rename from gui/images/target-1.png rename to images/target-1.png diff --git a/gui/images/target-10.png b/images/target-10.png similarity index 100% rename from gui/images/target-10.png rename to images/target-10.png diff --git a/gui/images/target-11.png b/images/target-11.png similarity index 100% rename from gui/images/target-11.png rename to images/target-11.png diff --git a/gui/images/target-12.png b/images/target-12.png similarity index 100% rename from gui/images/target-12.png rename to images/target-12.png diff --git a/gui/images/target-13.png b/images/target-13.png similarity index 100% rename from gui/images/target-13.png rename to images/target-13.png diff --git a/gui/images/target-14.png b/images/target-14.png similarity index 100% rename from gui/images/target-14.png rename to images/target-14.png diff --git a/gui/images/target-15.png b/images/target-15.png similarity index 100% rename from gui/images/target-15.png rename to images/target-15.png diff --git a/gui/images/target-16.png b/images/target-16.png similarity index 100% rename from gui/images/target-16.png rename to images/target-16.png diff --git a/gui/images/target-17.png b/images/target-17.png similarity index 100% rename from gui/images/target-17.png rename to images/target-17.png diff --git a/gui/images/target-18.png b/images/target-18.png similarity index 100% rename from gui/images/target-18.png rename to images/target-18.png diff --git a/gui/images/target-2.png b/images/target-2.png similarity index 100% rename from gui/images/target-2.png rename to images/target-2.png diff --git a/gui/images/target-3.png b/images/target-3.png similarity index 100% rename from gui/images/target-3.png rename to images/target-3.png diff --git a/gui/images/target-4.png b/images/target-4.png similarity index 100% rename from gui/images/target-4.png rename to images/target-4.png diff --git a/gui/images/target-5.png b/images/target-5.png similarity index 100% rename from gui/images/target-5.png rename to images/target-5.png diff --git a/gui/images/target-6.png b/images/target-6.png similarity index 100% rename from gui/images/target-6.png rename to images/target-6.png diff --git a/gui/images/target-7.png b/images/target-7.png similarity index 100% rename from gui/images/target-7.png rename to images/target-7.png diff --git a/gui/images/target-8.png b/images/target-8.png similarity index 100% rename from gui/images/target-8.png rename to images/target-8.png diff --git a/gui/images/target-9.png b/images/target-9.png similarity index 100% rename from gui/images/target-9.png rename to images/target-9.png diff --git a/gui/images/target-blue.png b/images/target-blue.png similarity index 100% rename from gui/images/target-blue.png rename to images/target-blue.png diff --git a/gui/images/target-red.png b/images/target-red.png similarity index 100% rename from gui/images/target-red.png rename to images/target-red.png diff --git a/gui/images/target-yellow.png b/images/target-yellow.png similarity index 100% rename from gui/images/target-yellow.png rename to images/target-yellow.png diff --git a/index.1.php b/index.1.php new file mode 100644 index 0000000..95c65d8 --- /dev/null +++ b/index.1.php @@ -0,0 +1,208 @@ +"; + } +?> + + + + CU Spaceflight - Landing Prediction (Beta) + + + + + +

CU Spaceflight - Landing Prediction


+ +"; + $land_timestamp = (float)$data[0]; + $land_lat = $data[1]; + $land_lon = $data[2]; + if ((int)$data[3] > $maxalt) { + $maxalt = (int)$data[3]; + $apogee_lat = $data[1]; + $apogee_lon = $data[2]; + $burst_timestamp = (float)$data[0]; + } + } + fclose($file); + + $data = parse_ini_file("example_scenario.ini"); // get the data from the scenario file + + $initial_zoom = "7"; + $initial_lat = $data['latitude']; + $initial_lon = $data['longitude']; + + $timestamp = mktime($data['hour'], $data['minute'], $data['second'], (int)$data['month'] + 1, $data['day'], (int)$data['year'] - 2000); + + $lat1 = deg2rad($initial_lat); + $lat2 = deg2rad($land_lat); + $lon1 = deg2rad($initial_lon); + $lon2 = deg2rad($land_lon); + //$dist = 2*asin(sqrt((sin(($lat1-$lat2)/2))^2 + cos($lat1)*cos($lat2)*(sin(($lon1-$lon2)/2))^2)); + $distkm = 6366.71 * acos(sin($lat1)*sin($lat2)+cos($lat1)*cos($lat2)*cos($lon1-$lon2)); + + $map_lat = ((float)$initial_lat + (float)$land_lat)/2; + $map_lon = ((float)$initial_lon + (float)$land_lon)/2; + + $launchdate = gmstrftime("%b %d %Y %H:%M", $timestamp); + $launchtime = gmstrftime("%H:%M", $timestamp); + $landdate = gmstrftime("%b %d %Y %H:%M", $land_timestamp); + $landtime = gmstrftime("%H:%M", $land_timestamp); + $bursttime = gmstrftime("%H:%M", $burst_timestamp); + $duration = gmstrftime("%H:%M", $land_timestamp - $timestamp); + $time_into_model = (int)(($burst_timestamp - mktime($gribhour, 0, 0, $gribmonth, $gribday, $gribyear)) / 3600); + $time_into_model = $time_into_model - ($time_into_model % 3); +?> +

Launch: " . $initial_lat . ", " . $initial_lon . " - " . $launchdate; ?> GMT
+Landing: " . $land_lat . ", " . $land_lon . " - " . $landdate; ?> GMT
+Duration:
+Distance:

+ + +
+
+

+ GFS wind speed data overlay (knots): +
mBar (approx. altitude): + +

+ + +
+
+ + + + + + diff --git a/index.php.old b/index.1.php.old similarity index 100% rename from index.php.old rename to index.1.php.old diff --git a/gui/index.html.old b/index.html.old similarity index 100% rename from gui/index.html.old rename to index.html.old diff --git a/index.php b/index.php index 95c65d8..5fa8dc0 100644 --- a/index.php +++ b/index.php @@ -1,208 +1,293 @@ "; - } -?> - +// if the form was submitted we should +// 1. sanity check inputs +// 2. generate an ini file +// 3. start prediction running +// 4. start ajax server poller +// 5. display the prediction data when run is complete +// 6. make the ini and the csv/kml available for download +$time = localtime(time(), true); +$uuid = md5(uniqid()); +$form_submitted = 0; +$software_available = array('grib', 'dap'); - - CU Spaceflight - Landing Prediction (Beta) - - - - - -

CU Spaceflight - Landing Prediction


- -"; - $land_timestamp = (float)$data[0]; - $land_lat = $data[1]; - $land_lon = $data[2]; - if ((int)$data[3] > $maxalt) { - $maxalt = (int)$data[3]; - $apogee_lat = $data[1]; - $apogee_lon = $data[2]; - $burst_timestamp = (float)$data[0]; - } - } - fclose($file); - - $data = parse_ini_file("example_scenario.ini"); // get the data from the scenario file - - $initial_zoom = "7"; - $initial_lat = $data['latitude']; - $initial_lon = $data['longitude']; - - $timestamp = mktime($data['hour'], $data['minute'], $data['second'], (int)$data['month'] + 1, $data['day'], (int)$data['year'] - 2000); - - $lat1 = deg2rad($initial_lat); - $lat2 = deg2rad($land_lat); - $lon1 = deg2rad($initial_lon); - $lon2 = deg2rad($land_lon); - //$dist = 2*asin(sqrt((sin(($lat1-$lat2)/2))^2 + cos($lat1)*cos($lat2)*(sin(($lon1-$lon2)/2))^2)); - $distkm = 6366.71 * acos(sin($lat1)*sin($lat2)+cos($lat1)*cos($lat2)*cos($lon1-$lon2)); - - $map_lat = ((float)$initial_lat + (float)$land_lat)/2; - $map_lon = ((float)$initial_lon + (float)$land_lon)/2; - - $launchdate = gmstrftime("%b %d %Y %H:%M", $timestamp); - $launchtime = gmstrftime("%H:%M", $timestamp); - $landdate = gmstrftime("%b %d %Y %H:%M", $land_timestamp); - $landtime = gmstrftime("%H:%M", $land_timestamp); - $bursttime = gmstrftime("%H:%M", $burst_timestamp); - $duration = gmstrftime("%H:%M", $land_timestamp - $timestamp); - $time_into_model = (int)(($burst_timestamp - mktime($gribhour, 0, 0, $gribmonth, $gribday, $gribyear)) / 3600); - $time_into_model = $time_into_model - ($time_into_model % 3); -?> -

Launch: " . $initial_lat . ", " . $initial_lon . " - " . $launchdate; ?> GMT
-Landing: " . $land_lat . ", " . $land_lon . " - " . $landdate; ?> GMT
-Duration:
-Distance:

- - -
-
-

- GFS wind speed data overlay (knots): -
mBar (approx. altitude): - -

- - -
-
- - + + + + + +
+
+

Debug Window

+No Messages +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Launch Site: + +
Latitude:
Longitude:
Launch altitude (m):
Launch Time: + " maxlength="2" size="2"> : + " maxlength="2" size="2"> +
Launch Date: + + + +
Ascent Rate (m/s):
Descent Rate (sea level m/s):
Burst Altitude (m):
Float time at apogee (s):
Landing prediction software: + +
+ +
+
+
+ - diff --git a/gui/js/jquery.js b/js/jquery.js similarity index 100% rename from gui/js/jquery.js rename to js/jquery.js diff --git a/gui/js/mootools-1.2.4.2-more.js b/js/mootools-1.2.4.2-more.js similarity index 100% rename from gui/js/mootools-1.2.4.2-more.js rename to js/mootools-1.2.4.2-more.js diff --git a/gui/js/pred.js b/js/pred.js similarity index 100% rename from gui/js/pred.js rename to js/pred.js