code: def get_last_an_time(self, utc_time):
          
  
          # Propagate backwards to ascending node
          dt = np.timedelta64(10, 'm')
          t_old = utc_time
          t_new = t_old - dt
          pos0, vel0 = self.get_position(t_old, normalize=False)
          pos1, vel1 = self.get_position(t_new, normalize=False)
          while not (pos0[2] > 0 and pos1[2] < 0):
              pos0 = pos1
              t_old = t_new
              t_new = t_old - dt
              pos1, vel1 = self.get_position(t_new, normalize=False)
  
          # Return if z within 1 km of an
          if np.abs(pos0[2]) < 1:
              return t_old
          elif np.abs(pos1[2]) < 1:
              return t_new
  
          # Bisect to z within 1 km
          while np.abs(pos1[2]) > 1:
              # pos0, vel0 = pos1, vel1
              dt = (t_old - t_new) / 2
              t_mid = t_old - dt
              pos1, vel1 = self.get_position(t_mid, normalize=False)
              if pos1[2] > 0:
                  t_old = t_mid
              else:
                  t_new = t_mid
  
          return t_mid
docs: Calculate time of last ascending node relative to the
          specified time