def __init__(self):
        # scan all files to get an estimated date
        files = uos.listdir()
        maxsec = 0
        for f in files:
            stats = uos.stat(f)
            j = 7
            while j <= 9:
                t = stats[j]
                if t > maxsec:
                    maxsec = t
                j += 1

        self.start_time = utime.localtime(maxsec)
        self.start_sec = maxsec - (pyb.millis() // 1000)

        # default location is my local star gazing spot
        self.set_location(-122.246086, 37.364107)

        # at Greenwich (longitude = 0), the solar time that matches sidereal time = 00:00
        self.sidereal_sync_time = comutils.utc_to_epoch(
            2020, 8, 10, 20, 40, 53)
        # in Jan 1 2040 at 11:17:05 is another such epoch

        self.pole_move = pole_movement.PoleMovement()

        self.tick()

        self.readiness = False
 def get_utc_epoch(self):
     return comutils.utc_to_epoch(self.date_year, self.date_month, self.date_day, self.time_hour, self.time_minute, self.time_second)
 def set_utc_time(self, utc_yr, utc_month, utc_day, utc_hr, utc_min,
                  utc_sec):
     s = comutils.utc_to_epoch(utc_yr, utc_month, utc_day, utc_hr, utc_min,
                               utc_sec)
     self.set_utc_time_epoch(s)