Using GRIB data from the " . $gribyear . "/" . $gribmonth . "/" . $gribday . " " . $gribhour . ":00 GMT model ";
$file = fopen("flight_path.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] . " ";
$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);
unlink("lock");
$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);
?>
Launch: " . $initial_lat . ", " . $initial_lon . " - " . $launchdate; ?> GMT
Landing: " . $land_lat . ", " . $land_lon . " - " . $landdate; ?> GMT
Duration:
Distance:
KML File
|
|