def determine_satellite_visibility(sat, gs, gs_tz, gs_start, gs_end, night): satnum = sat[0] saturl = "http://www.celestrak.com/cgi-bin/TLE.pl?CATNR=%s" % satnum st = SatelliteTle(satnum, tle_url=saturl) [suntimes, pentimes, umtimes] = st.compute_sun_times(gs_start, gs_end) ic = InviewCalculator(gs, st) inviews = ic.compute_inviews(gs_start, gs_end) intersections = [] for inview in inviews: i1 = intersect_times(night, inview) if (i1 is not None): #print_span(gs_tz, i1) for suntime in suntimes: i2 = intersect_times(i1, suntime) if (i2 is not None): #print_span(gs_tz, i2) i2startmjd = Time(i2[0]).mjd href = "http://www.heavens-above.com/passdetails.aspx?lat=%f&lng=%f&loc=%s&alt=%f&tz=%s&satid=%d&mjd=%f" % \ (gs.get_latitude(), gs.get_longitude(), gs.get_name(), gs.get_elevation_in_meters(), gs.get_tz().localize(datetime(i2[0].year, i2[0].month, i2[0].day)).tzname(), satnum, i2startmjd) intersections.append([ "<a href=%s>%s (mag:%s) %s %s-%s%s</a>" % (href, satnum, sat[1], st.get_satellite_name(), st.get_launch_year(), st.get_launch_year_number(), st.get_launch_piece()), i2 ]) #print_debug_times(gs_tz, satnum, night, suntimes, inviews) return intersections
def __generate_inview_bars_for_day(self, sat, day, \ start_time, end_time): # Time bars for inviews gsname = self.__ground_station.get_name() helptext = "" if ((day >= 0) and (day < self.__aer_days)): helptext = " (CLICK BAR FOR AZ/EL REPORT AND GRAPH)" # Get the InviewCalculator and compute the inviews ic = InviewCalculator(self.__ground_station, \ sat) inviews = [] inviews = ic.compute_inviews(start_time, end_time) self.__html_out.write(" dataTable.addRows([\n") for i in range(0, len(inviews)): riselocal = inviews[i][0].astimezone(self.__tz) setlocal = inviews[i][1].astimezone(self.__tz) self.__html_out.write((" ['%s - S/C %s Inviews', ' ', 'blue', " + \ "'%02d:%02d:%02d - %02d:%02d:%02d, Max Elev %02.1f degrees%s', " + \ "new Date(%s, %s, %s, %s, %s, %s), " + \ "new Date(%s, %s, %s, %s, %s, %s)],\n") % \ (gsname, sat.get_satellite_name(), \ riselocal.hour, riselocal.minute, riselocal.second, \ setlocal.hour, setlocal.minute, setlocal.second, \ inviews[i][2], helptext, \ riselocal.year, riselocal.month-1, riselocal.day, \ riselocal.hour, riselocal.minute, riselocal.second, \ setlocal.year, setlocal.month-1, setlocal.day, \ setlocal.hour, setlocal.minute, setlocal.second)) self.__html_out.write(" ]);\n") return len(inviews)
def main(): """Main function... makes 'forward declarations' of helper functions unnecessary""" # Constants groundstation_name = 'Wallops Antenna' groundstation_address = 'Radar Road, Temperanceville, VA 23442' satnum = 25544 # ISS = 25544 saturl="http://www.celestrak.com/NORAD/elements/stations.txt" gs_minimum_elevation_angle = 10.0 # Alternate constants gs_alt_lat = 37.854886 # Only needed if address not found gs_alt_lon = -75.512936 # Ditto gs_alt_el_meters = 3.8 # Ditto gs_alt_tz_offset_seconds = -18000.0 # Ditto gs_tzname = 'US/Eastern' # Construct the ground station info try: # Try to use the address... gs = GroundStation.from_address(groundstation_address, \ groundstation_name, \ gs_minimum_elevation_angle) except: # Otherwise, use explicit location data... gs = GroundStation.from_location(gs_alt_lat, gs_alt_lon, \ gs_alt_el_meters, \ gs_tzname, \ groundstation_name, \ gs_minimum_elevation_angle) # Times we need now = datetime.now() gs_today = gs.get_tz().localize(datetime(now.year, now.month, now.day)) gs_today_start = gs.get_tz().localize(datetime(now.year, now.month, now.day, \ 0, 0, 0)) gs_today_end = gs.get_tz().localize(datetime(now.year, now.month, now.day, \ 23, 59, 59)) # Get the InviewCalculator and compute the inviews st = SatelliteTle(satnum, tle_url=saturl) ic = InviewCalculator(gs, st) inviews = ic.compute_inviews(gs_today_start, gs_today_end) # Print the results print_satellite_header(st) print_inview_header(gs.get_minimum_elevation_angle(), gs_today, gs) print_inviews(gs, inviews) print_azeltables(inviews, ic)
def main(): """Main function... makes 'forward declarations' of helper functions unnecessary""" conf_file = "config/sat_html_report.config" if (len(sys.argv) > 1): conf_file = sys.argv[1] #sys.stderr.write("conf_file: %s\n" % conf_file) with open(conf_file) as json_data_file: data = json.load(json_data_file) #base_output_dir = Configuration.get_config_directory(data.get('base_output_directory',tempfile.gettempdir())) tz = Configuration.get_config_timezone(data.get('timezone', 'US/Eastern')) inviews = Configuration.get_config_boolean(data.get('inviews', 'false')) contacts = Configuration.get_config_boolean(data.get('contacts', 'false')) insun = Configuration.get_config_boolean(data.get('insun', 'false')) start_day = Configuration.get_config_int(data.get('start_day', '0'), -180, 180, 0) end_day = Configuration.get_config_int(data.get('end_day', '0'), -180, 180, 0) time_step_seconds = Configuration.get_config_float( data.get('time_step_seconds', '15'), 1, 600, 15) sat_tle = SatelliteTle.from_config(data.get('satellite', [])) ground_station = GroundStation.from_config(data.get('ground_station', [])) # Determine the time range for the requested day day_date = datetime.now() + timedelta(days=start_day) day_year = day_date.year day_month = day_date.month day_day = day_date.day start_time = tz.localize(datetime(day_year, day_month, day_day, 0, 0, 0)) end_time = tz.localize(datetime(day_year, day_month, day_day, 23, 59, 59)) # Get the InviewCalculator and compute the inviews base_ic = InviewCalculator(ground_station, sat_tle) base_inviews = [] base_inviews = base_ic.compute_inviews(start_time, end_time) for iv in base_inviews: print(iv) # debug start_time = iv[0].astimezone(tz) end_time = iv[1].astimezone(tz) azels = base_ic.compute_azels(iv[0], iv[1], time_step_seconds) for azel in azels: #print(" %s, %7.2f, %6.2f, %7.1f\n" % (azel[0].astimezone(tz), azel[1], azel[2], azel[3])) # convert to specified time zone print(" %s, %7.2f, %6.2f, %7.1f" % (azel[0].astimezone(tz), azel[1], azel[2], azel[3])) # convert to specified time zone
def generate_report(self): """Method to generate the HTML report""" # Use Google timeline JavaScript API from: https://developers.google.com/chart/interactive/docs/gallery/timeline months = ['zero', 'January', 'February', 'March', 'April', 'May', 'June', \ 'July', 'August', 'September', 'October', 'November', 'Decemter'] weekdays = [ 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' ] today = datetime.now() start_time = self.__tz.localize( datetime(today.year, today.month, today.day, 0, 0, 0)) end_time = self.__tz.localize( datetime(today.year, today.month, today.day, 23, 59, 59)) filename = "%s/satellite-overflight.html" % (self.__base_output_dir) #sys.stderr.write("Generating report: %s\n" % filename) with open(filename, "w") as self.__html_out: self.__html_out.write("<html>\n") self.__html_out.write(" <head>\n") self.__html_out.write(" </head>\n") self.__html_out.write(" <title>Satellite %s Over %s</title>\n" % (self.__common_satellite_name, self.__common_ground_station_name)) self.__html_out.write(" <body>\n") self.__html_out.write(" <p>On %s, %s %d, %4.4d, %s is over %s during:</p>\n" % \ (weekdays[today.weekday()], months[today.month], today.day, today.year, self.__common_satellite_name, self.__common_ground_station_name)) ic = InviewCalculator(self.__ground_station, \ self.__satellite_tle) inviews = [] inviews = ic.compute_inviews(start_time, end_time) self.__html_out.write(" <ul>\n") for iv in inviews: riselocal = iv[0].astimezone(self.__tz) setlocal = iv[1].astimezone(self.__tz) self.__html_out.write( " <li>%2.2d:%2.2d to %2.2d:%2.2d %s time</li>\n" % (riselocal.hour, riselocal.minute, setlocal.hour, setlocal.minute, self.__tz)) self.__html_out.write(" </ul>\n") self.__html_out.write(" </body>\n") self.__html_out.write("</html>\n")
def __generate_inview_bars_for_day(self, ground_station, day, \ start_time, end_time): # Time bars for inviews gsname = ground_station.get_name() helptext = "" if ((day >= 0) and (day < self.__aer_days)): helptext = " (CLICK BAR FOR AZ/EL REPORT AND GRAPH)" # Get the InviewCalculator and compute the inviews ic = InviewCalculator(ground_station, \ self.__satellite_tle) inviews = [] inviews = ic.compute_inviews(start_time, end_time) contacts = [] schedname = "" if (self.__create_contacts): fname = ground_station.get_schedule_directory( ).get_latest_schedule_full_filename_for_date(start_time.date()) #print("Schedule filename: %s" % fname) if (fname is not None): gsts = GroundStationTrackingSchedule(fname) contacts = gsts.get_satellite_contacts( self.__satellite_tle.get_satellite_contact_name()) #print(contacts) schedname = " -- (Schedule File: %s)" % ground_station.get_schedule_directory( ).get_latest_schedule_filename_for_date(start_time.date()) self.__html_out.write(" dataTable.addRows([\n") for i in range(0, len(inviews)): (typetext, color) = self.inview_contact_info(contacts, inviews[i]) riselocal = inviews[i][0].astimezone(self.__tz) setlocal = inviews[i][1].astimezone(self.__tz) self.__html_out.write((" ['%s - %s Inviews', ' ', '%s', " + \ "'%s %02d:%02d:%02d - %02d:%02d:%02d, Max Elev %02.1f degrees%s %s', " + \ "new Date(%s, %s, %s, %s, %s, %s), " + \ "new Date(%s, %s, %s, %s, %s, %s)],\n") % \ (gsname, self.__satellite_tle.get_satellite_name(), color, typetext, \ riselocal.hour, riselocal.minute, riselocal.second, \ setlocal.hour, setlocal.minute, setlocal.second, \ inviews[i][2], helptext, schedname, \ riselocal.year, riselocal.month-1, riselocal.day, \ riselocal.hour, riselocal.minute, riselocal.second, \ setlocal.year, setlocal.month-1, setlocal.day, \ setlocal.hour, setlocal.minute, setlocal.second)) self.__html_out.write(" ]);\n") return len(inviews)
def generate_report(self): """Method to generate the inview report""" end = start = datetime.now() start = start + timedelta(days=self.__start_day) end = end + timedelta(days=self.__end_day) start_time = self.__tz.localize( datetime(start.year, start.month, start.day, 0, 0, 0)) end_time = self.__tz.localize( datetime(end.year, end.month, end.day, 23, 59, 59)) filename = "%s/inviews.txt" % (self.__base_output_dir) #sys.stderr.write("Generating report: %s\n" % filename) with open(filename, "w") as self.__out: ic = InviewCalculator(self.__ground_station, \ self.__satellite_tle) inviews = [] inviews = ic.compute_inviews(start_time, end_time) for iv in inviews: riselocal = iv[0].astimezone(self.__tz) setlocal = iv[1].astimezone(self.__tz) self.__out.write("%s to %s\n" % (riselocal, setlocal))
def add_sat_data(satdata, tle_dir, date, year, month, day, tzone, satnum, gs): #print("adding sat on %s" % date) if (date not in satdata): elfile = glob.glob(tle_dir + "%s-%s-%s/*.tle" % (year, month, day)) tle = SatelliteTle(satnum, tle_file=elfile[0]) orb = Orbital(str(tle.get_satellite_number()), line1=tle.get_line1(), line2=tle.get_line2()) ic = InviewCalculator(gs, tle) inviews = ic.compute_inviews(tzone.localize(datetime(int(year), int(month), int(day), 0, 0, 0)), \ tzone.localize(datetime(int(year), int(month), int(day), 23, 59, 59))) plotinviews = [] for i in range(len(inviews)): plotinviews.append(False) p = SatData() p.inviews = inviews p.plotinviews = plotinviews p.inview_computer = ic p.orb = orb satdata[date] = p else: p = satdata[date] return (p.inviews, p.plotinviews, p.orb)
def __generate_azelrange_for_day(self, day): """Method to generate azimuth, elevation, range report for one day""" speed_of_light = 300000 # km/s # ALL TIMES ARE IN THE TIMEZONE self.__tz !! # Determine the time range for the requested day day_date = datetime.now() + timedelta(days=day) day_year = day_date.year day_month = day_date.month day_day = day_date.day start_time = self.__tz.localize( datetime(day_year, day_month, day_day, 0, 0, 0)) end_time = self.__tz.localize( datetime(day_year, day_month, day_day, 23, 59, 59)) # Get the InviewCalculator and compute the inviews base_ic = InviewCalculator(self.__ground_station, self.__satellite_of_interest) base_inviews = [] base_inviews = base_ic.compute_inviews(start_time, end_time) if (self.__ground_station.get_name() != ""): station_name = self.__ground_station.get_name() else: station_name = ("Lat:%s Lon:%s" % self.__ground_station.get_latitude(), self.__ground_station.get_longitude()) self.__out.write("<html>\n") self.__out.write(" <head>\n") self.__out.write(" <title>AER %s to %s, Day %d</title>\n" % ( \ station_name, self.__satellite_of_interest.get_satellite_name(), day)) self.__out.write(" </head>\n") self.__out.write(" <body>\n") report_date = datetime.now() + timedelta(days=day) title = "Azimuth, Elevation, Range Report from Ground Station %s to Satellite %s for Day %s (%04d-%02d-%02d)" % \ (station_name, self.__satellite_of_interest.get_satellite_name(), day, \ report_date.year, report_date.month, report_date.day) self.__out.write(" <h1>%s</h1>\n" % title) self.__out.write((" <h2>NOTE: Times displayed on the timeline are " + \ "for the timezone: %s</h2>\n") % \ self.__report_timezone) i = 0 self.__out.write(" <ul>\n") for iv in base_inviews: #self.__out.write(iv) # debug start_time = iv[0].astimezone(self.__tz) end_time = iv[1].astimezone(self.__tz) i = i + 1 self.__out.write(" <li>Goto: <a href=\"#inview%d\">Inview #%d (%s to %s)</a></li>\n" % (i, i, start_time, end_time)) self.__out.write(" </ul>\n") i = 0 for iv in base_inviews: #self.__out.write(iv) # debug start_time = iv[0].astimezone(self.__tz) end_time = iv[1].astimezone(self.__tz) i = i + 1 sat_string = "%s" % (self.__satellite_of_interest.get_satellite_name()) rx_freq = self.__satellite_of_interest.get_receive_frequency() if (rx_freq is not None): sat_string = sat_string + " (Receive Frequency %8.3f)" % (rx_freq) tx_freq = self.__satellite_of_interest.get_transmit_frequency() if (tx_freq is not None): sat_string = sat_string + " (Transmit Frequency %8.3f)" % (tx_freq) self.__out.write(" <h3><a name=\"inview%d\">%s to %s inview #%d (%s to %s)</a></h3>\n" % \ (i, station_name, sat_string, i, start_time, end_time)) azels = base_ic.compute_azels(iv[0], iv[1], self.__time_step_seconds) self.__out.write(" <table border='1'><tr><td>\n") self.__out.write(" <pre><code>\n") out_string = " Time (%-19s, Azimuth, Elevation, Range(km), Rng Rt(km/s)" % (str(self.__tz) + ")") if (rx_freq is not None): out_string = out_string + ", Xmit Freq" if (tx_freq is not None): out_string = out_string + ", Recv Freq" self.__out.write("%s\n" % out_string) prev_rng = None for azel in azels: if (prev_rng is None): rr_string = "--------" if (rx_freq is not None): tx_string = ", --------" else: tx_string = "" if (tx_freq is not None): rx_string = ", --------" else: rx_string = "" else: range_rate = (azel[3] - prev_rng) / self.__time_step_seconds rr_string = "%8.5f" % range_rate if (rx_freq is not None): freq = rx_freq * (1 + range_rate / speed_of_light) tx_string = ", %8.3f" % freq else: tx_string = "" if (tx_freq is not None): freq = tx_freq * (1 - range_rate / speed_of_light) rx_string = ", %8.3f" % freq else: rx_string = "" self.__out.write(" %s, %7.2f, %6.2f, %7.1f, %8.8s%s%s\n" % (azel[0].astimezone(self.__tz), azel[1], azel[2], azel[3], rr_string, tx_string, rx_string)) # convert to specified time zone prev_rng = azel[3] self.__out.write(" </pre></code>\n") self.__out.write(" </td><td>") self.__out.write(" <b><p id=\"time%d\" align=\"center\"></p></b>\n" % i) self.__out.write(" <script>\n") self.__out.write(" var temp%d = setInterval(myTimer%d, 1000);\n" % (i, i)) self.__out.write(" function myTimer%d() {\n" % i) self.__out.write(" var d = new Date();\n") self.__out.write(" var t = d.toLocaleTimeString();\n") self.__out.write(" document.getElementById(\"time%d\").innerHTML = d;\n" % i) self.__out.write(" }\n") self.__out.write(" </script>\n") filename = "aer-day%d-gs%d-sat%s-iv%d.png" % (day, self.__gs_number, self.__satellite_of_interest.get_satellite_number(), i) path = "%s/%s" % (self.__directory, filename) self.__generate_azelrange_plot(path, azels) self.__out.write(" <img src='../%s/%s'>\n" % (self.__datestr, filename)) self.__out.write(" </td></tr></table>\n") self.__out.write(" </body>\n") self.__out.write("</html>\n")
def __generate_separations_for_day(self, day): """Method to generate separations for one day""" D2R = math.pi / 180.0 # ALL TIMES ARE IN THE TIMEZONE self.__tz !! # Determine the time range for the requested day day_date = datetime.now() + timedelta(days=day) day_year = day_date.year day_month = day_date.month day_day = day_date.day start_time = self.__tz.localize( datetime(day_year, day_month, day_day, 0, 0, 0)) end_time = self.__tz.localize( datetime(day_year, day_month, day_day, 23, 59, 59)) # Get the InviewCalculator and compute the inviews base_ic = InviewCalculator(self.__ground_station, self.__satellite_of_interest) base_inviews = [] base_inviews = base_ic.compute_inviews(start_time, end_time) if (self.__debug): self.__out.write( "Inviews for satellite of interest %s\n" % self.__satellite_of_interest.get_satellite_number()) # debug base_ic.print_inviews(base_inviews) for sat in self.__other_satellite_tle_list: other_ic = InviewCalculator(self.__ground_station, sat) other_inviews = [] other_inviews = other_ic.compute_inviews(start_time, end_time) if (self.__debug): self.__out.write("Inviews for other satellite %s\n" % sat.get_satellite_number()) # debug other_ic.print_inviews(other_inviews) combined_inviews = self.combine_inviews(base_inviews, other_inviews) if (self.__debug): self.__out.write( "Combined inviews for %s and %s\n" % (self.__satellite_of_interest.get_satellite_number(), sat.get_satellite_number())) for civ in combined_inviews: if (self.__debug): self.__out.write("Start: %s, end: %s\n" % (civ[0], civ[1])) base_azel = base_ic.compute_azels(civ[0], civ[1], 15) other_azel = other_ic.compute_azels(civ[0], civ[1], 15) for i in range(len(base_azel)): base_unit = [ math.cos(D2R * base_azel[i][1]) * math.cos(D2R * base_azel[i][2]), math.sin(D2R * base_azel[i][1]) * math.cos(D2R * base_azel[i][2]), math.sin(D2R * base_azel[i][2]) ] other_unit = [ math.cos(D2R * other_azel[i][1]) * math.cos(D2R * other_azel[i][2]), math.sin(D2R * other_azel[i][1]) * math.cos(D2R * other_azel[i][2]), math.sin(D2R * other_azel[i][2]) ] separation_angle = math.acos(base_unit[0] * other_unit[0] + base_unit[1] * other_unit[1] + base_unit[2] * other_unit[2]) / D2R self.__out.write( "%s, %s, %s, %s, %f, %f, %f, %f, %f\n" % (base_azel[i][0], other_azel[i][0], self.__satellite_of_interest.get_satellite_number(), sat.get_satellite_number(), separation_angle, base_azel[i][1], base_azel[i][2], other_azel[i][1], other_azel[i][2]))
def main(): """Main function... makes 'forward declarations' of helper functions unnecessary""" parser = argparse.ArgumentParser() parser.add_argument("-s", "--satnum", help="Specify satellite number (e.g. 25544=ISS, 43852=STF-1)", \ type=int, metavar="[1-99999]", choices=range(1,99999), default=43852) parser.add_argument("-t", "--time", help="Specify date/time (UTC)", type=ArgValidator.validate_datetime, metavar="YYYY-MM-DDTHH:MM:SS", default=datetime.now()) parser.add_argument("-r", "--endtime", help="Specify date time range with this end date/time (UTC)", \ type=ArgValidator.validate_datetime, metavar="YYYY-MM-DDTHH:MM:SS", default=None) parser.add_argument("-d", "--timestep", help="Specify time step (delta) in seconds for tabular data", \ type=int, metavar="[1-86400]", choices=range(1,86400), default=60) parser.add_argument("-p", "--tle", help="Print TLE information", action="store_true") parser.add_argument("-u", "--sun", help="Print sun/umbra/penumbra information", action="store_true") parser.add_argument("-e", "--ecef", help="Print ECEF ephemeris", action="store_true") parser.add_argument("-i", "--eci", help="Print ECI ephemeris", action="store_true") parser.add_argument( "-l", "--lla", help= "Print latitude, longitude, altitude (geodetic degrees, altitude in km above WGS-84 ellipsoid) ephemeris", action="store_true") parser.add_argument( "-f", "--file", help="TLE file to use (instead of looking up the TLE on CelesTrak)", type=ArgValidator.validate_file, default=None) parser.add_argument("-m", "--mag", help="Print geomagnetic data", action="store_true") parser.add_argument("-a", "--aer", help="Print az/el/range from ground station", action="store_true") parser.add_argument("-x", "--longitude", help="Specify longitude (degrees) of ground station", \ type=float, default=-79.825518056) parser.add_argument("-y", "--latitude", help="Specify latitude (degrees) of ground station", \ type=float, default=38.43685028) parser.add_argument("-z", "--elevation", help="Specify elevation (meters) of ground station", \ type=float, default=842.0) parser.add_argument("-v", "--iirv", help="Print improved interrange vector (IIRV) format", action="store_true") args = parser.parse_args() if (args.file is not None): st = SatelliteTle(args.satnum, tle_file=args.file) else: saturl = "http://www.celestrak.com/cgi-bin/TLE.pl?CATNR=%s" % args.satnum st = SatelliteTle(args.satnum, tle_url=saturl) if (args.tle): print_tle_data(st) if (args.eci): if (args.endtime is None): point = st.compute_ephemeris_point(args.time) print_ephemeris_point(st, point) else: table = st.compute_ephemeris_table(args.time, args.endtime, args.timestep) print_ephemeris_table(st, table) if (args.ecef): #print "ECEF is not implemented" if (args.endtime is None): point = st.compute_ephemeris_point(args.time) print_ephemeris_point(st, point, False) else: table = st.compute_ephemeris_table(args.time, args.endtime, args.timestep) print_ephemeris_table(st, table, False) if (args.lla): if (args.endtime is None): llap = st.compute_lonlatalt_point(args.time) print_lonlatalt(st, llap) else: table = st.compute_lonlatalt_table(args.time, args.endtime, args.timestep) print_lonlatalt_table(st, table) if (args.mag): if (args.endtime is None): llap = st.compute_lonlatalt_point(args.time) print_mag(st, llap) else: table = st.compute_lonlatalt_table(args.time, args.endtime, args.timestep) print_mag_table(st, table) if (args.aer): gs = GroundStation(lat=args.latitude, lon=args.longitude, el_meters=args.elevation) ic = InviewCalculator(gs, st) if (args.endtime is None): args.endtime = args.time azels = ic.compute_azels(args.time, args.endtime, args.timestep) print_azelrange_table(azels) if (args.sun): if (args.endtime is None): sun_state = st.get_satellite_sun_state(args.time) if (sun_state == st.InSun): in_sun = "in sun" elif (sun_state == st.InPenumbra): in_sun = "in penumbra" else: in_sun = "in umbra" print("===== SUN =====") print("Satellite is %s" % in_sun) else: tables = st.compute_sun_times(args.time, args.endtime) print_sun_times_table(st, args.time, args.endtime, tables) if (args.iirv): if (args.endtime is None): point = st.compute_ephemeris_point(args.time) print_iirv_point(st, point) else: table = st.compute_ephemeris_table(args.time, args.endtime, args.timestep) print_iirv_points(st, table)