def calculate_groundtrack(
        self, spacecraft_tle,
        interval=None,
        timestep=py_td(seconds=20)
    ):
        """
        Calculates the GroundTrack for the spacecraft with the given tle object.
        :param spacecraft_tle: TLE for the spacecraft
        :param interval: simulation interval
        :param timestep: time ellapsed for the calculation of two subsequent
                            points in the ground track
        :return: Array where each element is { timestamp, latitude, longitude }.
                    The first timestamp is "start" and the last one is
                    "start+floor(duration/timestamp)*timestamp".
        """
        if not interval:
            interval = OrbitalSimulator.get_simulation_window()

        if self._test_mode:
            if self._fail_test:
                raise Exception('TEST TEST TEST EXCEPTION')

        self.set_spacecraft(spacecraft_tle)

        groundtrack = []
        date_i = interval[0]

        while date_i < interval[1]:

            self._body.compute(date_i)

            lat_i = numpy.rad2deg(self._body.sublat)
            lng_i = numpy.rad2deg(self._body.sublong)

            groundtrack.append({
                'timestamp': date_i,
                'latitude': lat_i,
                'longitude': lng_i
            })

            date_i += timestep

        return groundtrack
dataset/ETHPy150Open satnet-project/server/services/common/simulation.py/OrbitalSimulator.calculate_groundtrack/original