Ejemplo n.º 1
0
    def test_moving_body_pointing_law(self):
        """
        moving_body_pointing_law test
        """
        parameters = {
                    "eccentricity": 0.0008641,
                    "semimajor_axis": 6801395.04,
                    "inclination": 87.0,
                    "perigee_argument": 20.0,
                    "right_ascension_of_ascending_node": 10.0,
                    "anomaly": radians(0.0),
                    "anomaly_type": "TRUE",
                    "orbit_update_date":'2021-12-02T00:00:00.000',
                    "frame": "EME"}
        parameters1 = {
                    "eccentricity": 0.0008641,
                    "semimajor_axis": 6801395.04,
                    "inclination": 87.0,
                    "perigee_argument": 10.0,
                    "right_ascension_of_ascending_node": 10.0,
                    "anomaly": radians(0.0),
                    "anomaly_type": "TRUE",
                    "orbit_update_date":'2021-12-02T00:00:00.000',
                    "frame": "EME"}


        orbit_propagator_1 = analytical_propagator(parameters1)
        orbit_propagator_2 = analytical_propagator(parameters1)
        parameters["frame"] = orekit_utils.frame_to_string(orbit_propagator_1.getFrame())

        time_to_propagate = orekit_utils.absolute_time_converter_utc_string('2022-05-02T00:00:00.000')
        orbit_to_track_propagator = analytical_propagator(parameters)

        test1 = CelestialBodyPointed(FramesFactory.getEME2000(), orbit_to_track_propagator,
                                                Vector3D.PLUS_K, Vector3D.PLUS_K,
                                                Vector3D.MINUS_J)
        test2 = moving_body_pointing_law(orbit_to_track_propagator, parameters)

        orbit_propagator_1.setAttitudeProvider(test1)
        orbit_propagator_2.setAttitudeProvider(test2)
        state_1 = orbit_propagator_1.propagate(time_to_propagate)
        state_2 = orbit_propagator_2.propagate(time_to_propagate)
        self.assertTrue((state_1.getAttitude().getSpin().toString() == state_2.getAttitude().getSpin().toString()))
Ejemplo n.º 2
0
    def test_ground_pointing_law(self):
        """
        ground_pointing_law test
        """
        parameters = {"latitude": 12.0, "altitude": 2343.0, "longitude": 12.0}
        parameters1 = {
            "eccentricity": 0.0008641,
            "semimajor_axis": 6801395.04,
            "inclination": 87.0,
            "perigee_argument": 10.0,
            "right_ascension_of_ascending_node": 10.0,
            "anomaly": radians(0.0),
            "anomaly_type": "TRUE",
            "orbit_update_date": '2021-12-02T00:00:00.000',
            "frame": "EME"
        }

        orbit_propagator_1 = analytical_propagator(parameters1)
        orbit_propagator_2 = analytical_propagator(parameters1)
        parameters["frame"] = orekit_utils.frame_to_string(
            orbit_propagator_1.getFrame())

        ITRF = FramesFactory.getITRF(IERSConventions.IERS_2010, True)
        target = GeodeticPoint(parameters["latitude"], parameters["longitude"],
                               parameters["altitude"])
        attitude_provider = ground_pointing_law(parameters)
        attitude_provider_1 = TargetPointing(
            FramesFactory.getEME2000(), target,
            OneAxisEllipsoid(Constants.WGS84_EARTH_EQUATORIAL_RADIUS,
                             Constants.WGS84_EARTH_FLATTENING, ITRF))

        orbit_propagator_1.setAttitudeProvider(attitude_provider)
        orbit_propagator_2.setAttitudeProvider(attitude_provider_1)

        time_to_propagate = orekit_utils.absolute_time_converter_utc_string(
            '2022-05-02T00:00:00.000')
        state_1 = orbit_propagator_1.propagate(time_to_propagate)
        state_2 = orbit_propagator_2.propagate(time_to_propagate)

        self.assertTrue((state_1.getAttitude().getSpin().toString() ==
                         state_2.getAttitude().getSpin().toString()))
Ejemplo n.º 3
0
    def test_attitude_provider_constructor(self):
        """
        attitude_provider_constructor test
        """
        moving_body = "moving_body_tracking"
        moving_body_param = {
                    "eccentricity": 0.0008641,
                    "semimajor_axis": 6801395.04,
                    "inclination": 87.0,
                    "perigee_argument": 10.0,
                    "right_ascension_of_ascending_node": 10.0,
                    "anomaly": 0.0,
                    "anomaly_type": "TRUE",
                    "orbit_update_date":"2021-12-02T00:00:00.000",
                    "frame": "EME"}

        orbit_params = {
                    "eccentricity": 0.0008641,
                    "semimajor_axis": 6801395.04,
                    "inclination": 87.0,
                    "perigee_argument": 20.0,
                    "right_ascension_of_ascending_node": 10.0,
                    "anomaly": 0.0,
                    "anomaly_type": "TRUE",
                    "orbit_update_date":'2021-12-02T00:00:00.000',
                    "frame": "EME"}

        orbit_propagator_1 = analytical_propagator(orbit_params)
        orbit_propagator_2 = analytical_propagator(orbit_params)

        attitude_m_body = attitude_provider_constructor(moving_body, moving_body_param)
        attitude_m_body_1 = moving_body_pointing_law(analytical_propagator(moving_body_param),moving_body_param)

        orbit_propagator_1.setAttitudeProvider(attitude_m_body)
        orbit_propagator_2.setAttitudeProvider(attitude_m_body_1)

        time_to_propagate = orekit_utils.absolute_time_converter_utc_string('2022-05-02T00:00:00.000')

        state_1 = orbit_propagator_1.propagate(time_to_propagate)
        state_2 = orbit_propagator_2.propagate(time_to_propagate)

        self.assertTrue((state_1.getAttitude().getSpin().toString() == state_2.getAttitude().getSpin().toString()))

        ground = "ground_tracking"
        ground_param = {
            "latitude": 12.0,
            "altitude": 2343.0,
            "longitude":12.0
            }
        parameters = {
                    "eccentricity": 0.0008641,
                    "semimajor_axis": 6801395.04,
                    "inclination": 87.0,
                    "perigee_argument": 10.0,
                    "right_ascension_of_ascending_node": 10.0,
                    "anomaly": radians(0.0),
                    "anomaly_type": "TRUE",
                    "orbit_update_date":'2021-12-02T00:00:00.000',
                    "frame": "EME"}

        orbit_propagator_1 = analytical_propagator(parameters)
        orbit_propagator_2 = analytical_propagator(parameters)
        ground_param["frame"] = orekit_utils.frame_to_string(orbit_propagator_1.getFrame())

        attitude_provider_1 = attitude_provider_constructor(ground, ground_param)
        attitude_provider_2 = ground_pointing_law(ground_param)

        orbit_propagator_1.setAttitudeProvider(attitude_provider_1)
        orbit_propagator_2.setAttitudeProvider(attitude_provider_2)

        time_to_propagate = orekit_utils.absolute_time_converter_utc_string('2022-05-02T00:00:00.000')
        state_1 = orbit_propagator_1.propagate(time_to_propagate)
        state_2 = orbit_propagator_2.propagate(time_to_propagate)

        self.assertTrue((state_1.getAttitude().getSpin().toString() == state_2.getAttitude().getSpin().toString()))