-($yr,$mon,$day,$hr,$min)=Sun::Calendar_date_and_time_from_JD($jtime);
-#printf("%2.2d %2.2d %2.2d %2.2d %2.2d\n",$min,$hr,$day,$mon,$yr);
-push @out,sprintf("Tracking table for $satname");
-push @out,sprintf("dd/mm UTC Lat Lon Alt(km) Az El Dist(km)");
-my ($slat,$slon,$salt,$az,$el,$distance)=
- Sun::get_satellite_pos(
- $jtime,$lat*$d2r,$lon*$d2r,$alt,$satname);
-push @out,sprintf( # print the current satellite position
- "Now %2.2d:%2.2d %6.1f %6.1f %6.1f %6.1f %6.1f %6.1f",
- $hr,$min,$slat*$r2d,$slon*$r2d,$salt,
- $az*$r2d,$el*$r2d,$distance);
-
-my $numsteps=0;
-my $step = 2; # tracking table resolution in minutes
-$jtime=$jtime+$step/24/60;
-while ( $numsteps < 6*60/$step ) # for now, look 6 hours ahead for tracking table
+
+#$DB::single=1;
+if ($satname && $Sun::keps{$satname}) {
+
+ ($yr,$mon,$day,$hr,$min)=Sun::Calendar_date_and_time_from_JD($jtime);
+ #printf("%2.2d %2.2d %2.2d %2.2d %2.2d\n",$min,$hr,$day,$mon,$yr);
+ push @out, $self->msg("pos", $call, slat($lat), slong($lon));
+ push @out, $self->msg("sat1", $satname, $numhours, $step);
+ push @out, $self->msg("sat2");
+
+ my ($slat,$slon,$salt,$az,$el,$distance)=Sun::get_satellite_pos($jtime,$lat*$d2r,$lon*$d2r,$alt,$satname);
+ # print the current satellite position
+ push @out,sprintf("Now %2.2d:%2.2d %7.1f %7.1f %7.1f %7.1f %7.1f %7.1f",
+ $hr,$min,$slat*$r2d,$slon*$r2d,$salt,
+ $az*$r2d,$el*$r2d,$distance);
+
+ my $numsteps=0;
+ $jtime=$jtime+$step/24/60;
+ my $disc = 0; # discontinuity flag
+ while ( $numsteps < $numhours*60/$step ) # look $numhours ahead for tracking table