#!/usr/bin/env perl use FileHandle; # Ed Murphy's program to rewrite the orbit page # Updated 03/27/00 Changed GSOC to Heavens Above $output_filename = "/data2/violet/htdocs/users/orbit.html"; open (OUTF, ">$output_filename") || die "Cannot open $output_filename file"; system("chmod ug+rw $output_filename"); system("chgrp www $output_filename"); $input_filename = "@DATADIR@/calfiles/FUSE.TLE"; open (INP_TLE, "<$input_filename") || die "Cannot open $input_filename file"; $satid = 25791; &input_lines; close (INP_TLE); &parse_lines; &convert_doy; &convert_dayfrac; &calculate_a0; &calculate_orbs; $now=`date`; $datest = substr($now,4,3)." ".substr($now,8,2).", ".substr($now,24,4); print OUTF "\n"; print OUTF "
\n"; print OUTF "\n";
print OUTF "![]()
![]() \n"; print OUTF " \n"; print OUTF "Check out the\n"; print OUTF "\n"; print OUTF "Heavens-Above Satellite Predictions page .\n"; print OUTF " \n"; print OUTF " \n"; print OUTF " \n"; print OUTF " \n"; print OUTF "FUSE orbital elements:\n"; print OUTF " NORAD number 25791\n"; print OUTF " International ID 99035A\n"; print OUTF " \n"; &print_orb; print OUTF "\n"; &print_tail; close (OUTF); ### end of Perl script sub convert_doy { @daytab1 = (0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); @daytab2 = (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); @monthstr = ("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); if ((($year%4 == 0) && ($year%100 != 0)) || ($year%400 == 0)) { # $year is a leap year use daytab1 for ($i = 1; $doy > $daytab1[$i]; $i++) { $doy -= $daytab1[$i]; } } else { # $year is not a leap year, use daytab2 for ($i = 1; $doy > $daytab2[$i]; $i++) { $doy -= $daytab2[$i]; } } $month = $monthstr[$i]; $day = $doy; } sub convert_dayfrac { $dayfrac *= 24.0; $hour = int($dayfrac); $minute = int(($dayfrac-$hour)*60.0); $second = ((($dayfrac-$hour)*60.0)-$minute)*60.0; } sub input_lines { $line1 = "; print OUTF "The FUSE Delta II second stage (NORAD #25792) reentered on \n"; print OUTF "the morning of August 4, 1999 during orbit number 708. \n"; print OUTF "According to predictions by Alan Pickup, reentry \n"; print OUTF "occured within 90 minutes of 5:31 UT, probably over the \n"; print OUTF "Arabian Sea or India. The final orbit was 119 x 103 km (74 x 64 mi).\n"; print OUTF " "; print OUTF " \n"; print OUTF " ![]() These numbers assume a Keplerian orbit; the actual apogee and perigee \n"; print OUTF "will differ by a few km on an orbit-to-orbit basis.\n"; print OUTF " "; print OUTF " The NORAD Two-Line Elements (TLEs) for FUSE can be found in the file \n"; print OUTF " FUSE.TLE .\n"; print OUTF " \n"; print OUTF "This page is automatically updated daily. I wish to thank \n"; print OUTF "Doyle Groves \n"; print OUTF "for providing a Perl script to access the NASA\n"; print OUTF "Orbital Information Group web page.\n"; print OUTF " Ed Murphy, \n"; print OUTF "emurphy\@pha.jhu.edu\n"; print OUTF " \n";
print OUTF " \n"; print OUTF "Last changed: $datest.\n"; print OUTF " \n";
print OUTF "Return to the FUSE home page. \n"; print OUTF " |