Attachment 'crosser.pl'

Download

   1 #!/usr/local/bin/perl
   2 # crosser.pl    v0.1  2013 Fri 25
   3 #
   4 # This finds the crossing density through the equatorial plane
   5 #
   6 # ./crosser.pl < {two line element file}
   7 
   8 use Astro::SpaceTrack;
   9 use Astro::Coord::ECI;
  10 use Astro::Coord::ECI::TLE;
  11 use Astro::Coord::ECI::TLE::Set;
  12 use Astro::Coord::ECI::Utils qw(deg2rad rad2deg);
  13 
  14 my  $rdel   = 200.0              ;  # km
  15 my  $rmin   = 6400.0             ;  # km
  16 my  $rmax   = 50000.0            ;  # km
  17 my  $r288   = 12789.0            ;  # km
  18 my  $nmin   = int( $rmin/$rdel)  ;  # minimum bin
  19 my  $nmax   = 1 +int($rmax/$rdel);  # number of bins
  20 
  21 my  $cntall = 0                  ;
  22 my  $cnt288 = 0                  ;
  23 my  $pi     = 4.0*atan2(1.0,1.0) ;
  24 my  $mu     = 3.986004418e5      ; # km3/s2 (no oblate effects)
  25 my  $v288   = sqrt($mu/$r288)    ;
  26 
  27 my  @crosstab = (0.0)*$nmax ;
  28 my  $fluxtab  = (0.0)*$nmax ;
  29 my  $r        = (0.0)*2     ;
  30 
  31 foreach $el ( Astro::Coord::ECI::TLE->parse( <> ) ) {
  32   
  33    my $nam = $el->get('name');               # name
  34    my $bod = $el->body_type();               # body type
  35    my $apo = $el->apogee();                  # apogee km
  36    my $per = $el->perigee();                 # perigee km
  37    my $sem = $el->semimajor();               # semimajor axis km
  38    my $prd = $el->period();                  # period sec
  39    my $ecc = $el->get('eccentricity');       # eccentricity
  40    my $inc = $el->get('inclination');        # inclination radians
  41    my $apg = $el->get('argumentofperigee');  # arg of perigee radians
  42    my $v01 = sqrt( $mu*( 1.0 - $ecc**2 )/$sem ); # orbit velocity
  43 
  44    $cntall += 1 ;
  45 
  46    # radius at equatorial crossings (two places)
  47    $r[0] = $sem * ( 1.0 - $ecc**2 ) / ( 1.0 + $ecc*cos($apg) ) ;
  48    $r[1] = $sem * ( 1.0 - $ecc**2 ) / ( 1.0 - $ecc*cos($apg) ) ;
  49 
  50    for( my $cross = 0 ; $cross <= 1 ; $cross += 1 ) {
  51       my $bin = int( $r[$cross] / $rdel ) ;
  52       $bin = $nmax if ( $bin > $nmax )    ;
  53       $crosstab[$bin] += 1.0/$rdel        ; # crossings in that bin
  54       # crossings per square meter per second 
  55       $fluxtab[$bin]  += 5e-7 / ( $prd * $pi * $rdel * $r[$cross] );
  56    }
  57 }
  58 
  59 printf( "# total objects=%8d\n", $cntall );
  60 printf( "# radius  crossers   flux\n"    );
  61 
  62 for( my $oc = $nmin ; $oc <= $nmax ; $oc += 1.0 ) {
  63    my $rr = $oc * $rdel / 1000.0 ;  # thousands of kilometers
  64    printf( "%10.3f%10.3f%10.2e\n", $rr, $crosstab[$oc], $fluxtab[$oc] );
  65 }

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-02-12 15:26:57, 228.9 KB) [[attachment:A0_title.jpg]]
  • [get | view] (2013-02-12 15:35:39, 912.5 KB) [[attachment:B0_serversatV3a.png]]
  • [get | view] (2013-02-12 15:36:48, 1976.2 KB) [[attachment:C0_world_marble.png]]
  • [get | view] (2013-02-12 15:36:23, 1602.0 KB) [[attachment:C3_energy.png]]
  • [get | view] (2013-02-12 15:33:18, 469.6 KB) [[attachment:E0_m288xx.png]]
  • [get | view] (2013-02-12 15:32:48, 59.2 KB) [[attachment:E3_crosser.png]]
  • [get | view] (2013-02-12 15:32:06, 405.6 KB) [[attachment:H0_toroid.png]]
  • [get | view] (2013-02-12 15:34:51, 97.8 KB) [[attachment:I0_echrome.png]]
  • [get | view] (2013-02-12 15:34:08, 356.0 KB) [[attachment:J3_turn_tidal.png]]
  • [get | view] (2013-02-12 15:33:46, 281.9 KB) [[attachment:K0_lighteccentric.png]]
  • [get | view] (2013-02-12 15:31:33, 454.9 KB) [[attachment:M0_temperature.png]]
  • [get | view] (2013-02-12 15:35:14, 101.8 KB) [[attachment:M3_deploy.png]]
  • [get | view] (2013-02-12 15:30:15, 700.1 KB) [[attachment:Q0_phasedarray.png]]
  • [get | view] (2013-02-12 15:29:44, 466.0 KB) [[attachment:Q3_arrayspace.png]]
  • [get | view] (2013-02-12 15:31:06, 488.4 KB) [[attachment:R0_radiation.png]]
  • [get | view] (2013-02-12 15:30:42, 281.4 KB) [[attachment:R3_radiation.png]]
  • [get | view] (2013-02-12 15:27:28, 506.1 KB) [[attachment:S0_costdrop.png]]
  • [get | view] (2013-02-12 15:28:49, 3693.6 KB) [[attachment:U0_radar.png]]
  • [get | view] (2013-02-12 15:27:55, 416.5 KB) [[attachment:U3_rocketbody.png]]
  • [get | view] (2013-02-16 04:59:50, 14.8 KB) [[attachment:a6.c]]
  • [get | view] (2013-02-16 04:59:58, 14.6 KB) [[attachment:a7.c]]
  • [get | view] (2013-02-16 03:52:04, 16.9 KB) [[attachment:ar06.c]]
  • [get | view] (2013-02-15 23:11:57, 1.7 KB) [[attachment:crosser.gp]]
  • [get | view] (2013-02-15 23:11:40, 2.3 KB) [[attachment:crosser.pl]]
  • [get | view] (2013-02-16 04:30:17, 2.0 KB) [[attachment:darkside0.gp]]
  • [get | view] (2013-02-16 15:28:29, 2.3 KB) [[attachment:darkside0.pl]]
  • [get | view] (2013-02-16 03:38:30, 9.3 KB) [[attachment:echrome04.c]]
  • [get | view] (2013-02-16 15:29:15, 5.7 KB) [[attachment:insertrb.pl]]
  • [get | view] (2013-02-16 15:37:24, 1.9 KB) [[attachment:lj2.gp]]
  • [get | view] (2013-02-16 15:37:08, 2.3 KB) [[attachment:lj2.pl]]
  • [get | view] (2013-02-16 04:14:19, 5.1 KB) [[attachment:orbit04w.c]]
  • [get | view] (2013-02-16 04:19:08, 9.1 KB) [[attachment:pa03.c]]
  • [get | view] (2013-02-16 04:19:19, 9.1 KB) [[attachment:pa04.c]]
  • [get | view] (2013-02-12 18:22:40, 5.3 KB) [[attachment:pc02.c]]
  • [get | view] (2013-02-16 15:29:37, 2.0 KB) [[attachment:rb.gp]]
  • [get | view] (2013-02-16 02:50:27, 6.0 KB) [[attachment:sh01.c]]
  • [get | view] (2013-02-13 23:22:32, 13918.1 KB) [[attachment:ss.pdf]]
  • [get | view] (2013-02-13 23:21:58, 23.3 KB) [[attachment:ss.tex]]
  • [get | view] (2013-02-16 04:07:31, 24.1 KB) [[attachment:ss6a.c]]
  • [get | view] (2013-02-16 04:12:13, 3.4 KB) [[attachment:tor08.c]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.