Esempio n. 1
0
    def test_set_sun_elevation_summaries(self) -> None:
        collection = self.collection.clone()
        view_summaries = ViewExtension.summaries(collection, True)

        view_summaries.sun_elevation = RangeSummary(-10, 38)
        self.assertDictEqual({
            "minimum": -10,
            "maximum": 38
        }, view_summaries.sun_elevation.to_dict())
Esempio n. 2
0
    def test_set_off_nadir_summaries(self) -> None:
        collection = self.collection.clone()
        view_summaries = ViewExtension.summaries(collection, True)

        view_summaries.off_nadir = RangeSummary(0, 10)
        self.assertDictEqual({
            "minimum": 0,
            "maximum": 10
        }, view_summaries.off_nadir.to_dict())
Esempio n. 3
0
    def test_set_sun_azimuth_summaries(self) -> None:
        collection = self.collection.clone()
        view_summaries = ViewExtension.summaries(collection, True)

        view_summaries.sun_azimuth = RangeSummary(210, 275)
        self.assertDictEqual({
            "minimum": 210,
            "maximum": 275
        }, view_summaries.sun_azimuth.to_dict())
Esempio n. 4
0
    def test_set_incidence_angle_summaries(self) -> None:
        collection = self.collection.clone()
        view_summaries = ViewExtension.summaries(collection, True)

        view_summaries.incidence_angle = RangeSummary(5, 15)
        self.assertDictEqual({
            "minimum": 5,
            "maximum": 15
        }, view_summaries.incidence_angle.to_dict())
Esempio n. 5
0
    def test_get_azimuth_summaries(self) -> None:
        azimuths = ViewExtension.summaries(self.collection, True).azimuth

        assert azimuths is not None

        self.assertDictEqual({
            "minimum": 20,
            "maximum": 186
        }, azimuths.to_dict())
Esempio n. 6
0
    def test_get_off_nadir_summaries(self) -> None:
        off_nadirs = ViewExtension.summaries(self.collection, True).off_nadir

        assert off_nadirs is not None

        self.assertDictEqual({
            "minimum": 0.5,
            "maximum": 7.3
        }, off_nadirs.to_dict())
Esempio n. 7
0
    def test_get_sun_elevation_summaries(self) -> None:
        sun_elevations = ViewExtension.summaries(self.collection,
                                                 True).sun_elevation

        assert sun_elevations is not None

        self.assertDictEqual({
            "minimum": 10,
            "maximum": 45
        }, sun_elevations.to_dict())
Esempio n. 8
0
    def test_get_sun_azimuth_summaries(self) -> None:
        sun_azimuths = ViewExtension.summaries(self.collection,
                                               True).sun_azimuth

        assert sun_azimuths is not None

        self.assertDictEqual({
            "minimum": 48,
            "maximum": 78
        }, sun_azimuths.to_dict())
Esempio n. 9
0
    def test_get_incidence_angle_summaries(self) -> None:
        incidence_angles = ViewExtension.summaries(self.collection,
                                                   True).incidence_angle

        assert incidence_angles is not None

        self.assertDictEqual({
            "minimum": 23,
            "maximum": 35
        }, incidence_angles.to_dict())
Esempio n. 10
0
    def test_summaries_adds_uri(self) -> None:
        collection = self.collection.clone()
        collection.stac_extensions = []
        self.assertRaisesRegex(
            pystac.ExtensionNotImplemented,
            r"Could not find extension schema URI.*",
            ViewExtension.summaries,
            collection,
            False,
        )
        _ = ViewExtension.summaries(collection, True)

        self.assertIn(ViewExtension.get_schema_uri(),
                      collection.stac_extensions)

        ViewExtension.remove_from(collection)
        self.assertNotIn(ViewExtension.get_schema_uri(),
                         collection.stac_extensions)
Esempio n. 11
0
    def test_set_azimuth_summaries(self) -> None:
        collection = self.collection.clone()
        view_summaries = ViewExtension.summaries(collection, True)

        view_summaries.azimuth = None
        self.assertIsNone(view_summaries.azimuth)