merging dap branch
rodzic
79c5ecef4d
commit
0282c96988
BIN
auto_prediction
BIN
auto_prediction
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,205 @@
|
|||
<?php
|
||||
$google_maps_key = "ABQIAAAAzpAeP4iTRyyvc3_y95bQZBSKwkMTdHp8HFczqP8NHp8p-gzf6hS3D2nn-v4cH1tY-5dVl1LLI46Lng";
|
||||
$map_width = "100%";
|
||||
$map_height = "70%";
|
||||
|
||||
function footer() {
|
||||
echo "</body></html>";
|
||||
}
|
||||
?>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>CU Spaceflight - Landing Prediction (Beta)</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $google_maps_key ?>" type="text/javascript"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>CU Spaceflight - Landing Prediction</h1><hr>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$file = fopen("new.csv", "r");
|
||||
while (($data = fgetcsv($file)) != FALSE) {
|
||||
//print_r($data);
|
||||
$gmapsdata .= ",new GLatLng(" . $data[1] . "," . $data[2] . ")\n";
|
||||
//print $data[1] . " " . $data[2] . " " . $data[3] . "<br />";
|
||||
$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);
|
||||
|
||||
$initial_zoom = "7";
|
||||
$initial_lat = $_POST['lat'];
|
||||
$initial_lon = $_POST['lon'];
|
||||
|
||||
$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)$_POST['lat'] + (float)$land_lat)/2;
|
||||
$map_lon = ((float)$_POST['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);
|
||||
?>
|
||||
<p>Launch: <?php if ($_POST["launchsite"] != "other") echo $_POST["launchsite"]; ?> <?php echo "<b>" . $initial_lat . ", " . $initial_lon . "</b> - " . $launchdate; ?> GMT<br />
|
||||
Landing: <?php echo "<b>" . $land_lat . ", " . $land_lon . "</b> - " . $landdate; ?> GMT<br />
|
||||
Duration: <?php echo $duration; ?><br />
|
||||
Distance: <?php echo (int)$distkm . " km (" . (int)($distkm * 0.62137) . " miles)"; ?></p>
|
||||
<p><a href="flight_path.kml">KML File</a></p>
|
||||
</td>
|
||||
<td>
|
||||
<div id="coords"></div>
|
||||
<form name="wind_overlay">
|
||||
<p>
|
||||
GFS wind speed data overlay (knots): <input type="checkbox" name="wind_overlay_enabled" onChange="update_wind_overlay()">
|
||||
<br />mBar (approx. altitude):
|
||||
<select name="mbar" onChange="update_wind_overlay()">
|
||||
<option value="200">200 (12km)</option>
|
||||
<option value="300" selected>300 (9km)</option>
|
||||
<option value="500">500 (5.5km)</option>
|
||||
<option value="700">700 (3km)</option>
|
||||
<option value="850">850 (1.5km)</option>
|
||||
</select>
|
||||
</p></form>
|
||||
</td></tr></table>
|
||||
|
||||
<div id="map" style="width: <?php echo $map_width ?>; height: <?php echo $map_height ?>">
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
var map = new GMap2(document.getElementById("map"));
|
||||
map.addControl(new GLargeMapControl());
|
||||
map.addControl(new GMapTypeControl());
|
||||
map.addControl(new GScaleControl());
|
||||
//map.setUIToDefault();
|
||||
|
||||
map.setCenter(new GLatLng(<?php echo $map_lat ?>, <?php echo $map_lon ?>), <?php echo $initial_zoom ?>);
|
||||
|
||||
var baseIcon = new GIcon();
|
||||
baseIcon.iconSize = new GSize(20,20);
|
||||
baseIcon.iconAnchor = new GPoint(10,10);
|
||||
baseIcon.infoWindowAnchor = new GPoint(10,10);
|
||||
|
||||
var launchIcon = new GIcon(baseIcon);
|
||||
launchIcon.image = "icons/arrow.png";
|
||||
markerOptions = { icon:launchIcon };
|
||||
var launchMarker = new GMarker(new GLatLng(<?php echo $initial_lat . "," . $initial_lon ?>), markerOptions);
|
||||
GEvent.addListener(launchMarker, "click", function() {
|
||||
launchMarker.openInfoWindowHtml("<b>Launch Site</b><br /><?php if ($_POST["launchsite"] != "other") echo $_POST["launchsite"] . "<br />"; ?><?php echo $initial_lat . ", " . $initial_lon . " - " . $launchtime ?>");
|
||||
});
|
||||
map.addOverlay(launchMarker)
|
||||
|
||||
var landIcon = new GIcon(baseIcon);
|
||||
landIcon.image = "icons/target-red.png";
|
||||
markerOptions = { icon:landIcon };
|
||||
var landMarker = new GMarker(new GLatLng(<?php echo $land_lat . "," . $land_lon ?>), markerOptions);
|
||||
GEvent.addListener(landMarker, "click", function() {
|
||||
landMarker.openInfoWindowHtml("<b>Predicted Landing</b><br /><?php echo $land_lat . ", " . $land_lon . " - " . $landtime ?>");
|
||||
});
|
||||
map.addOverlay(landMarker)
|
||||
|
||||
function drawCircle(center, radius, color, width, complexity) {
|
||||
var points = [];
|
||||
var radians = Math.PI / 180;
|
||||
var longitudeOffset = radius / (Math.cos(center.y * radians) *
|
||||
111325);
|
||||
var latitudeOffset = radius / 111325;
|
||||
for (var i = 0; i < 360; i += complexity) {
|
||||
var point = new GPoint(center.x + (longitudeOffset * Math.cos(i
|
||||
* radians)), center.y + (latitudeOffset * Math.sin(i * radians)));
|
||||
points.push(point);
|
||||
}
|
||||
points.push(points[0]);// close the circle
|
||||
var polygon = new GPolygon(points, true, color,0.25, true);
|
||||
|
||||
map.addOverlay(polygon);
|
||||
}
|
||||
|
||||
drawCircle(new GLatLng(<?php echo $land_lat . "," . $land_lon ?>),15000,"#ffff00",3,10);
|
||||
drawCircle(new GLatLng(<?php echo $land_lat . "," . $land_lon ?>),10000,"#ff0000",3,10);
|
||||
drawCircle(new GLatLng(<?php echo $land_lat . "," . $land_lon ?>),5000,"#ff0000",3,10);
|
||||
|
||||
GEvent.addDomListener(map,'mousemove',
|
||||
function(point){
|
||||
document.getElementById("coords").innerHTML = 'Coords: ' + point.lat().toFixed(4) + ', ' + point.lng().toFixed(4) + '<br />Range from launch site ' + (point.distanceFrom(new GLatLng(<?php echo $initial_lat . ',' . $initial_lon ?>))/1000).toFixed(2) + 'km, landing site ' + (point.distanceFrom(new GLatLng(<?php echo $land_lat . ',' . $land_lon ?>))/1000).toFixed(2) + 'km';
|
||||
//window.status='Wgs84 - '+point.toUrlValue();
|
||||
});
|
||||
|
||||
var apogeeIcon = new GIcon(baseIcon);
|
||||
apogeeIcon.image = "icons/balloon.png";
|
||||
markerOptions = { icon:apogeeIcon };
|
||||
var apogeeMarker = new GMarker(new GLatLng(<?php echo $apogee_lat . "," . $apogee_lon ?>), markerOptions);
|
||||
GEvent.addListener(apogeeMarker, "click", function() {
|
||||
apogeeMarker.openInfoWindowHtml("<b>Balloon Burst</b><br /><?php echo $_POST["burst"] . " km<br />" . $apogee_lat . ", " . $apogee_lon . " - " . $bursttime ?>");
|
||||
});
|
||||
map.addOverlay(apogeeMarker)
|
||||
|
||||
//var pointSW = new GLatLng(48,-4.5);
|
||||
//var pointNE = new GLatLng(57,4.5);
|
||||
//var groundOverlay = new GGroundOverlay(
|
||||
// "http://www.srcf.ucam.org/~cuspaceflight/predict/graph-out.png",
|
||||
// new GLatLngBounds(pointSW, pointNE));
|
||||
|
||||
var windOverlay = new GGroundOverlay("", map.getBounds());
|
||||
|
||||
var hour = <?php echo $time_into_model; ?>;
|
||||
var modelrun = "<?php echo $gribyear . $gribmonth . $gribday . $gribhour; ?>";
|
||||
|
||||
function update_wind_overlay() {
|
||||
var bounds = map.getBounds();
|
||||
var size = map.getSize();
|
||||
|
||||
var imgurl = "http://modelmaps.wunderground.com/php/run.php?model=GFS&script="
|
||||
+ document.wind_overlay.mbar.options[document.wind_overlay.mbar.selectedIndex].value +
|
||||
"&hour="+hour+"&modelrun="+modelrun+"&maxlat="
|
||||
+ bounds.getNorthEast().lat() +
|
||||
"&maxlon=" + bounds.getNorthEast().lng() +
|
||||
"&minlat=" + bounds.getSouthWest().lat() +
|
||||
"&minlon=" + bounds.getSouthWest().lng() +
|
||||
"&width=" + size.width + "&height=" + size.height;
|
||||
|
||||
window.status = imgurl;
|
||||
|
||||
map.removeOverlay(windOverlay);
|
||||
if (document.wind_overlay.wind_overlay_enabled.checked) {
|
||||
windOverlay = new GGroundOverlay(imgurl, bounds);
|
||||
map.addOverlay(windOverlay);
|
||||
}
|
||||
}
|
||||
|
||||
GEvent.addListener(map, "moveend", update_wind_overlay );
|
||||
|
||||
update_wind_overlay();
|
||||
|
||||
var polyline = new GPolyline([
|
||||
<?php echo $gmapsdata; ?>
|
||||
],"#ff0000", 2, 1);
|
||||
map.addOverlay(polyline);
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
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
|
|
Plik binarny nie jest wyświetlany.
Ładowanie…
Reference in New Issue