diff --git a/CHANGELOG.MD b/CHANGELOG.MD index ada9ebd..af971a9 100644 --- a/CHANGELOG.MD +++ b/CHANGELOG.MD @@ -4,12 +4,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). This project attempts to match the major and minor versions of [stactools](https://github.com/stac-utils/stactools) and increments the patch number as needed. -## [0.6.2] - 2024-01-08 - -### Fixed - -- ViewExtension handles NaN values for viewing_angles correctly. - ## [0.6.1] - 2024-01-04 ### Fixed @@ -125,7 +119,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Upgrade to stactools 0.2.1.a2 (supporting PySTAC 1.0.0) -[0.6.2]: [0.6.1]: [0.6.0]: [0.5.0]: diff --git a/pyproject.toml b/pyproject.toml index 811f156..c9a0418 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,10 +5,3 @@ build-backend = "setuptools.build_meta" [tool.ruff] line-length = 88 select = ["E", "F", "I"] - -# pyproject.toml -[tool.pytest.ini_options] -filterwarnings = [ - "error", - "ignore::antimeridian.FixWindingWarning", -] \ No newline at end of file diff --git a/scripts/create_expected.py b/scripts/create_expected.py index c954d08..c7618e9 100755 --- a/scripts/create_expected.py +++ b/scripts/create_expected.py @@ -10,7 +10,6 @@ "S2A_MSIL2A_20190212T192651_N0212_R013_T07HFE_20201007T160857", "S2A_MSIL1C_20210908T042701_N0301_R133_T46RER_20210908T070248", "S2B_MSIL2A_20191228T210519_N0212_R071_T01CCV_20201003T104658", - "S2A_OPER_MSI_L2A_TL_VGS1_20220401T110010_A035382_T34LBQ-no-tileDataGeometry", ] root = Path(__file__).parents[1] diff --git a/src/stactools/sentinel2/__init__.py b/src/stactools/sentinel2/__init__.py index 7615729..ef91b35 100644 --- a/src/stactools/sentinel2/__init__.py +++ b/src/stactools/sentinel2/__init__.py @@ -11,4 +11,4 @@ def register_plugin(registry): registry.register_subcommand(commands.create_sentinel2_command) -__version__ = "0.6.2" +__version__ = "0.6.1" diff --git a/src/stactools/sentinel2/stac.py b/src/stactools/sentinel2/stac.py index 268b4dc..88fed84 100644 --- a/src/stactools/sentinel2/stac.py +++ b/src/stactools/sentinel2/stac.py @@ -16,7 +16,6 @@ from pystac.extensions.projection import ProjectionExtension from pystac.extensions.raster import DataType, RasterBand, RasterExtension from pystac.extensions.sat import OrbitState, SatExtension -from pystac.extensions.view import SCHEMA_URI as VIEW_EXT_URI from pystac.extensions.view import ViewExtension from pystac.utils import now_to_rfc3339_str from shapely.geometry import mapping as shapely_mapping @@ -197,14 +196,8 @@ def create_item( # View Extension view = ViewExtension.ext(item, add_if_missing=True) - - if all(not math.isnan(v.azimuth) for v in metadata.viewing_angles.values()): - view.azimuth = mean([v.azimuth for v in metadata.viewing_angles.values()]) - - if all(not math.isnan(v.zenith) for v in metadata.viewing_angles.values()): - view.incidence_angle = mean( - [v.zenith for v in metadata.viewing_angles.values()] - ) + view.azimuth = mean([v.azimuth for v in metadata.viewing_angles.values()]) + view.incidence_angle = mean([v.zenith for v in metadata.viewing_angles.values()]) # both sun_azimuth and sun_zenith can be NaN, so don't set # when that is the case @@ -214,17 +207,6 @@ def create_item( if (msz := metadata.sun_zenith) and not math.isnan(msz): view.sun_elevation = 90 - msz - if all( - x is None - for x in [ - view.azimuth, - view.incidence_angle, - view.sun_azimuth, - view.sun_elevation, - ] - ): - item.stac_extensions.remove(VIEW_EXT_URI) - # Sentinel-2 Extension item.stac_extensions.append(SENTINEL2_EXTENSION_SCHEMA) item.properties.update(metadata.metadata_dict) diff --git a/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/expected_output.json b/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/expected_output.json deleted file mode 100644 index 1bebc4e..0000000 --- a/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/expected_output.json +++ /dev/null @@ -1,1794 +0,0 @@ -{ - "type": "Feature", - "stac_version": "1.0.0", - "id": "S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL", - "properties": { - "created": "2024-01-08T15:01:58.725815Z", - "providers": [ - { - "name": "ESA", - "roles": [ - "producer", - "processor", - "licensor" - ], - "url": "https://earth.esa.int/web/guest/home" - } - ], - "platform": "sentinel-2a", - "constellation": "sentinel-2", - "instruments": [ - "msi" - ], - "eo:cloud_cover": 74.49823, - "proj:epsg": 32634, - "proj:centroid": { - "lat": 58.84466, - "lon": 21.00154 - }, - "mgrs:utm_zone": 34, - "mgrs:latitude_band": "V", - "mgrs:grid_square": "EL", - "grid:code": "MGRS-34VEL", - "view:sun_azimuth": 174.263139694724, - "view:sun_elevation": 8.519874994470499, - "s2:tile_id": "S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL_N05.10", - "s2:degraded_msi_data_percentage": 0.0, - "s2:nodata_pixel_percentage": 99.997187, - "s2:saturated_defective_pixel_percentage": 0.0, - "s2:dark_features_percentage": 0.0, - "s2:cloud_shadow_percentage": 0.0, - "s2:vegetation_percentage": 0.0, - "s2:not_vegetated_percentage": 0.0, - "s2:water_percentage": 25.50177, - "s2:unclassified_percentage": 0.0, - "s2:medium_proba_clouds_percentage": 48.760331, - "s2:high_proba_clouds_percentage": 8.028335, - "s2:thin_cirrus_percentage": 17.709564, - "s2:snow_ice_percentage": 0.0, - "s2:product_type": "S2MSI2A", - "s2:processing_baseline": "05.10", - "datetime": "2024-01-08T10:14:07.485000Z" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - 20.999670819641665, - 58.8396991190033 - ], - [ - 21.00527335734796, - 58.84659513527369 - ], - [ - 20.999670743888814, - 58.847684103413386 - ], - [ - 20.999670819641665, - 58.8396991190033 - ] - ] - ] - }, - "links": [ - { - "rel": "license", - "href": "https://sentinel.esa.int/documents/247904/690755/Sentinel_Data_Legal_Notice" - } - ], - "assets": { - "red": { - "href": "./R10m/B04.jp2", - "type": "image/jp2", - "title": "Red - 10m", - "eo:bands": [ - { - "name": "B04", - "common_name": "red", - "center_wavelength": 0.665, - "full_width_half_max": 0.038 - } - ], - "gsd": 10, - "proj:shape": [ - 10980, - 10980 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 10.0, - 0.0, - 499980.0, - 0.0, - -10.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 10, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "green": { - "href": "./R10m/B03.jp2", - "type": "image/jp2", - "title": "Green - 10m", - "eo:bands": [ - { - "name": "B03", - "common_name": "green", - "center_wavelength": 0.56, - "full_width_half_max": 0.045 - } - ], - "gsd": 10, - "proj:shape": [ - 10980, - 10980 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 10.0, - 0.0, - 499980.0, - 0.0, - -10.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 10, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "blue": { - "href": "./R10m/B02.jp2", - "type": "image/jp2", - "title": "Blue - 10m", - "eo:bands": [ - { - "name": "B02", - "common_name": "blue", - "center_wavelength": 0.49, - "full_width_half_max": 0.098 - } - ], - "gsd": 10, - "proj:shape": [ - 10980, - 10980 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 10.0, - 0.0, - 499980.0, - 0.0, - -10.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 10, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "wvp_10m": { - "href": "./R10m/WVP.jp2", - "type": "image/jp2", - "title": "Water Vapour (WVP)", - "gsd": 10, - "proj:shape": [ - 10980, - 10980 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 10.0, - 0.0, - 499980.0, - 0.0, - -10.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 10, - "unit": "cm", - "scale": 0.001, - "offset": 0 - } - ], - "roles": [ - "data" - ] - }, - "aot_10m": { - "href": "./R10m/AOT.jp2", - "type": "image/jp2", - "title": "Aerosol optical thickness (AOT)", - "gsd": 10, - "proj:shape": [ - 10980, - 10980 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 10.0, - 0.0, - 499980.0, - 0.0, - -10.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 10, - "scale": 0.001, - "offset": 0 - } - ], - "roles": [ - "data" - ] - }, - "visual": { - "href": "./R10m/TCI.jp2", - "type": "image/jp2", - "title": "True color image", - "eo:bands": [ - { - "name": "B04", - "common_name": "red", - "center_wavelength": 0.665, - "full_width_half_max": 0.038 - }, - { - "name": "B03", - "common_name": "green", - "center_wavelength": 0.56, - "full_width_half_max": 0.045 - }, - { - "name": "B02", - "common_name": "blue", - "center_wavelength": 0.49, - "full_width_half_max": 0.098 - } - ], - "gsd": 10, - "proj:shape": [ - 10980, - 10980 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 10.0, - 0.0, - 499980.0, - 0.0, - -10.0, - 6600000.0 - ], - "roles": [ - "visual" - ] - }, - "nir": { - "href": "./R10m/B08.jp2", - "type": "image/jp2", - "title": "NIR 1 - 10m", - "eo:bands": [ - { - "name": "B08", - "common_name": "nir", - "center_wavelength": 0.842, - "full_width_half_max": 0.145 - } - ], - "gsd": 10, - "proj:shape": [ - 10980, - 10980 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 10.0, - 0.0, - 499980.0, - 0.0, - -10.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 10, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "swir22": { - "href": "./R20m/B12.jp2", - "type": "image/jp2", - "title": "SWIR 2.2\u03bcm - 20m", - "eo:bands": [ - { - "name": "B12", - "common_name": "swir22", - "center_wavelength": 2.19, - "full_width_half_max": 0.242 - } - ], - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "rededge2": { - "href": "./R20m/B06.jp2", - "type": "image/jp2", - "title": "Red Edge 2 - 20m", - "eo:bands": [ - { - "name": "B06", - "common_name": "rededge", - "center_wavelength": 0.74, - "full_width_half_max": 0.018 - } - ], - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "rededge3": { - "href": "./R20m/B07.jp2", - "type": "image/jp2", - "title": "Red Edge 3 - 20m", - "eo:bands": [ - { - "name": "B07", - "common_name": "rededge", - "center_wavelength": 0.783, - "full_width_half_max": 0.028 - } - ], - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "rededge1": { - "href": "./R20m/B05.jp2", - "type": "image/jp2", - "title": "Red Edge 1 - 20m", - "eo:bands": [ - { - "name": "B05", - "common_name": "rededge", - "center_wavelength": 0.704, - "full_width_half_max": 0.019 - } - ], - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "swir16": { - "href": "./R20m/B11.jp2", - "type": "image/jp2", - "title": "SWIR 1.6\u03bcm - 20m", - "eo:bands": [ - { - "name": "B11", - "common_name": "swir16", - "center_wavelength": 1.61, - "full_width_half_max": 0.143 - } - ], - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "red_20m": { - "href": "./R20m/B04.jp2", - "type": "image/jp2", - "title": "Red - 20m", - "eo:bands": [ - { - "name": "B04", - "common_name": "red", - "center_wavelength": 0.665, - "full_width_half_max": 0.038 - } - ], - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "green_20m": { - "href": "./R20m/B03.jp2", - "type": "image/jp2", - "title": "Green - 20m", - "eo:bands": [ - { - "name": "B03", - "common_name": "green", - "center_wavelength": 0.56, - "full_width_half_max": 0.045 - } - ], - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "blue_20m": { - "href": "./R20m/B02.jp2", - "type": "image/jp2", - "title": "Blue - 20m", - "eo:bands": [ - { - "name": "B02", - "common_name": "blue", - "center_wavelength": 0.49, - "full_width_half_max": 0.098 - } - ], - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "wvp": { - "href": "./R20m/WVP.jp2", - "type": "image/jp2", - "title": "Water Vapour (WVP)", - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "unit": "cm", - "scale": 0.001, - "offset": 0 - } - ], - "roles": [ - "data" - ] - }, - "nir08": { - "href": "./R20m/B8A.jp2", - "type": "image/jp2", - "title": "NIR 2 - 20m", - "eo:bands": [ - { - "name": "B8A", - "common_name": "nir08", - "center_wavelength": 0.865, - "full_width_half_max": 0.033 - } - ], - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "scl": { - "href": "./R20m/SCL.jp2", - "type": "image/jp2", - "title": "Scene classification map (SCL)", - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint8", - "spatial_resolution": 20 - } - ], - "roles": [ - "data" - ] - }, - "aot": { - "href": "./R20m/AOT.jp2", - "type": "image/jp2", - "title": "Aerosol optical thickness (AOT)", - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.001, - "offset": 0 - } - ], - "roles": [ - "data" - ] - }, - "visual_20m": { - "href": "./R20m/TCI.jp2", - "type": "image/jp2", - "title": "True color image", - "eo:bands": [ - { - "name": "B04", - "common_name": "red", - "center_wavelength": 0.665, - "full_width_half_max": 0.038 - }, - { - "name": "B03", - "common_name": "green", - "center_wavelength": 0.56, - "full_width_half_max": 0.045 - }, - { - "name": "B02", - "common_name": "blue", - "center_wavelength": 0.49, - "full_width_half_max": 0.098 - } - ], - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "roles": [ - "visual" - ] - }, - "nir_20m": { - "href": "./R20m/B08.jp2", - "type": "image/jp2", - "title": "NIR 1 - 20m", - "eo:bands": [ - { - "name": "B08", - "common_name": "nir", - "center_wavelength": 0.842, - "full_width_half_max": 0.145 - } - ], - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 20, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "swir22_60m": { - "href": "./R60m/B12.jp2", - "type": "image/jp2", - "title": "SWIR 2.2\u03bcm - 60m", - "eo:bands": [ - { - "name": "B12", - "common_name": "swir22", - "center_wavelength": 2.19, - "full_width_half_max": 0.242 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "rededge2_60m": { - "href": "./R60m/B06.jp2", - "type": "image/jp2", - "title": "Red Edge 2 - 60m", - "eo:bands": [ - { - "name": "B06", - "common_name": "rededge", - "center_wavelength": 0.74, - "full_width_half_max": 0.018 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "rededge3_60m": { - "href": "./R60m/B07.jp2", - "type": "image/jp2", - "title": "Red Edge 3 - 60m", - "eo:bands": [ - { - "name": "B07", - "common_name": "rededge", - "center_wavelength": 0.783, - "full_width_half_max": 0.028 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "rededge1_60m": { - "href": "./R60m/B05.jp2", - "type": "image/jp2", - "title": "Red Edge 1 - 60m", - "eo:bands": [ - { - "name": "B05", - "common_name": "rededge", - "center_wavelength": 0.704, - "full_width_half_max": 0.019 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "swir16_60m": { - "href": "./R60m/B11.jp2", - "type": "image/jp2", - "title": "SWIR 1.6\u03bcm - 60m", - "eo:bands": [ - { - "name": "B11", - "common_name": "swir16", - "center_wavelength": 1.61, - "full_width_half_max": 0.143 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "red_60m": { - "href": "./R60m/B04.jp2", - "type": "image/jp2", - "title": "Red - 60m", - "eo:bands": [ - { - "name": "B04", - "common_name": "red", - "center_wavelength": 0.665, - "full_width_half_max": 0.038 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "coastal": { - "href": "./R60m/B01.jp2", - "type": "image/jp2", - "title": "Coastal - 60m", - "eo:bands": [ - { - "name": "B01", - "common_name": "coastal", - "center_wavelength": 0.443, - "full_width_half_max": 0.027 - } - ], - "gsd": 60, - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "green_60m": { - "href": "./R60m/B03.jp2", - "type": "image/jp2", - "title": "Green - 60m", - "eo:bands": [ - { - "name": "B03", - "common_name": "green", - "center_wavelength": 0.56, - "full_width_half_max": 0.045 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "blue_60m": { - "href": "./R60m/B02.jp2", - "type": "image/jp2", - "title": "Blue - 60m", - "eo:bands": [ - { - "name": "B02", - "common_name": "blue", - "center_wavelength": 0.49, - "full_width_half_max": 0.098 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "wvp_60m": { - "href": "./R60m/WVP.jp2", - "type": "image/jp2", - "title": "Water Vapour (WVP)", - "gsd": 60, - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "unit": "cm", - "scale": 0.001, - "offset": 0 - } - ], - "roles": [ - "data" - ] - }, - "nir08_60m": { - "href": "./R60m/B8A.jp2", - "type": "image/jp2", - "title": "NIR 2 - 60m", - "eo:bands": [ - { - "name": "B8A", - "common_name": "nir08", - "center_wavelength": 0.865, - "full_width_half_max": 0.033 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "scl_60m": { - "href": "./R60m/SCL.jp2", - "type": "image/jp2", - "title": "Scene classification map (SCL)", - "gsd": 60, - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint8", - "spatial_resolution": 60 - } - ], - "roles": [ - "data" - ] - }, - "aot_60m": { - "href": "./R60m/AOT.jp2", - "type": "image/jp2", - "title": "Aerosol optical thickness (AOT)", - "gsd": 60, - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.001, - "offset": 0 - } - ], - "roles": [ - "data" - ] - }, - "nir09": { - "href": "./R60m/B09.jp2", - "type": "image/jp2", - "title": "NIR 3 - 60m", - "eo:bands": [ - { - "name": "B09", - "common_name": "nir09", - "center_wavelength": 0.945, - "full_width_half_max": 0.026 - } - ], - "gsd": 60, - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "visual_60m": { - "href": "./R60m/TCI.jp2", - "type": "image/jp2", - "title": "True color image", - "eo:bands": [ - { - "name": "B04", - "common_name": "red", - "center_wavelength": 0.665, - "full_width_half_max": 0.038 - }, - { - "name": "B03", - "common_name": "green", - "center_wavelength": 0.56, - "full_width_half_max": 0.045 - }, - { - "name": "B02", - "common_name": "blue", - "center_wavelength": 0.49, - "full_width_half_max": 0.098 - } - ], - "gsd": 60, - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "roles": [ - "visual" - ] - }, - "nir_60m": { - "href": "./R60m/B08.jp2", - "type": "image/jp2", - "title": "NIR 1 - 60m", - "eo:bands": [ - { - "name": "B08", - "common_name": "nir", - "center_wavelength": 0.842, - "full_width_half_max": 0.145 - } - ], - "proj:shape": [ - 1830, - 1830 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 60.0, - 0.0, - 499980.0, - 0.0, - -60.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint16", - "spatial_resolution": 60, - "scale": 0.0001, - "offset": -0.1 - } - ], - "roles": [ - "data", - "reflectance" - ] - }, - "cloud": { - "href": "./qi/CLD_20m.jp2", - "type": "image/jp2", - "title": "Cloud Probabilities", - "gsd": 20, - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint8", - "spatial_resolution": 20 - } - ], - "roles": [ - "data", - "cloud" - ] - }, - "snow": { - "href": "./qi/SNW_20m.jp2", - "type": "image/jp2", - "title": "Snow Probabilities", - "proj:shape": [ - 5490, - 5490 - ], - "proj:bbox": [ - 499980.0, - 6490200.0, - 609780.0, - 6600000.0 - ], - "proj:transform": [ - 20.0, - 0.0, - 499980.0, - 0.0, - -20.0, - 6600000.0 - ], - "raster:bands": [ - { - "nodata": 0, - "data_type": "uint8", - "spatial_resolution": 20 - } - ], - "roles": [ - "data", - "snow-ice" - ] - }, - "preview": { - "href": "./qi/L2A_PVI.jp2", - "type": "image/jp2", - "title": "True color preview", - "eo:bands": [ - { - "name": "B04", - "common_name": "red", - "center_wavelength": 0.665, - "full_width_half_max": 0.038 - }, - { - "name": "B03", - "common_name": "green", - "center_wavelength": 0.56, - "full_width_half_max": 0.045 - }, - { - "name": "B02", - "common_name": "blue", - "center_wavelength": 0.49, - "full_width_half_max": 0.098 - } - ], - "roles": [ - "overview" - ] - }, - "granule_metadata": { - "href": "./metadata.xml", - "type": "application/xml", - "roles": [ - "metadata" - ] - }, - "tileinfo_metadata": { - "href": "./tileInfo.json", - "type": "application/json", - "roles": [ - "metadata" - ] - } - }, - "bbox": [ - 20.999671, - 58.839699, - 21.005273, - 58.847684 - ], - "stac_extensions": [ - "https://stac-extensions.github.io/eo/v1.1.0/schema.json", - "https://stac-extensions.github.io/raster/v1.1.0/schema.json", - "https://stac-extensions.github.io/projection/v1.1.0/schema.json", - "https://stac-extensions.github.io/mgrs/v1.0.0/schema.json", - "https://stac-extensions.github.io/grid/v1.1.0/schema.json", - "https://stac-extensions.github.io/view/v1.0.0/schema.json", - "https://stac-extensions.github.io/sentinel-2/v1.0.0/schema.json" - ] -} \ No newline at end of file diff --git a/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/metadata.xml b/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/metadata.xml deleted file mode 100644 index 7b5be0b..0000000 --- a/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/metadata.xml +++ /dev/null @@ -1,249 +0,0 @@ - - - - S2A_OPER_MSI_L1C_TL_2APS_20240108T105807_A044635_T34VEL_N05.10 - S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL_N05.10 - S2A_OPER_MSI_L2A_DS_2APS_20240108T121951_S20240108T101404_N05.10 - NOMINAL - 2024-01-08T10:14:07.485567Z - - 2APS - 2024-01-08T12:34:25.742305Z - - - - - WGS84 / UTM zone 34N - EPSG:32634 - - 10980 - 10980 - - - 5490 - 5490 - - - 1830 - 1830 - - - 499980 - 6600000 - 10 - -10 - - - 499980 - 6600000 - 20 - -20 - - - 499980 - 6600000 - 60 - -60 - - - - - - 5000 - 5000 - - 82.0286 82.0235 82.0183 82.0132 82.0081 82.003 81.9979 81.9928 81.9877 81.9826 81.9775 81.9724 81.9673 81.9622 81.9571 81.952 81.947 81.9419 81.9368 81.9318 81.9267 81.9216 81.9166 - 81.9838 81.9787 81.9736 81.9684 81.9633 81.9582 81.9531 81.948 81.9429 81.9378 81.9327 81.9276 81.9225 81.9175 81.9124 81.9073 81.9022 81.8972 81.8921 81.887 81.882 81.8769 81.8719 - 81.939 81.9339 81.9288 81.9237 81.9186 81.9135 81.9084 81.9033 81.8981 81.8931 81.888 81.8829 81.8778 81.8727 81.8676 81.8626 81.8575 81.8524 81.8474 81.8423 81.8372 81.8322 81.8271 - 81.8943 81.8891 81.884 81.8789 81.8738 81.8687 81.8636 81.8585 81.8534 81.8483 81.8432 81.8381 81.833 81.828 81.8229 81.8178 81.8127 81.8077 81.8026 81.7975 81.7925 81.7874 81.7824 - 81.8495 81.8444 81.8393 81.8341 81.829 81.8239 81.8188 81.8137 81.8086 81.8035 81.7984 81.7934 81.7883 81.7832 81.7781 81.7731 81.768 81.7629 81.7579 81.7528 81.7478 81.7427 81.7377 - 81.8047 81.7996 81.7945 81.7894 81.7843 81.7792 81.7741 81.769 81.7639 81.7588 81.7537 81.7486 81.7435 81.7384 81.7334 81.7283 81.7232 81.7182 81.7131 81.7081 81.703 81.698 81.6929 - 81.7599 81.7548 81.7497 81.7446 81.7395 81.7344 81.7293 81.7242 81.7191 81.714 81.7089 81.7038 81.6988 81.6937 81.6886 81.6836 81.6785 81.6734 81.6684 81.6633 81.6583 81.6532 81.6482 - 81.7152 81.71 81.7049 81.6998 81.6947 81.6896 81.6845 81.6794 81.6743 81.6693 81.6642 81.6591 81.654 81.6489 81.6439 81.6388 81.6338 81.6287 81.6236 81.6186 81.6135 81.6085 81.6035 - 81.6704 81.6653 81.6602 81.6551 81.65 81.6449 81.6398 81.6347 81.6296 81.6245 81.6194 81.6143 81.6093 81.6042 81.5991 81.5941 81.589 81.5839 81.5789 81.5738 81.5688 81.5638 81.5587 - 81.6256 81.6205 81.6154 81.6103 81.6052 81.6001 81.595 81.5899 81.5848 81.5797 81.5747 81.5696 81.5645 81.5594 81.5544 81.5493 81.5443 81.5392 81.5341 81.5291 81.5241 81.519 81.514 - 81.5808 81.5757 81.5706 81.5655 81.5604 81.5553 81.5502 81.5451 81.5401 81.535 81.5299 81.5248 81.5198 81.5147 81.5096 81.5046 81.4995 81.4945 81.4894 81.4844 81.4793 81.4743 81.4693 - 81.536 81.5309 81.5258 81.5207 81.5156 81.5105 81.5055 81.5004 81.4953 81.4902 81.4851 81.4801 81.475 81.4699 81.4649 81.4598 81.4548 81.4497 81.4447 81.4396 81.4346 81.4295 81.4245 - 81.4913 81.4862 81.4811 81.476 81.4709 81.4658 81.4607 81.4556 81.4505 81.4454 81.4404 81.4353 81.4302 81.4252 81.4201 81.4151 81.41 81.405 81.3999 81.3949 81.3898 81.3848 81.3798 - 81.4465 81.4414 81.4363 81.4312 81.4261 81.421 81.4159 81.4108 81.4058 81.4007 81.3956 81.3905 81.3855 81.3804 81.3754 81.3703 81.3652 81.3602 81.3552 81.3501 81.3451 81.3401 81.335 - 81.4017 81.3966 81.3915 81.3864 81.3813 81.3762 81.3711 81.3661 81.361 81.3559 81.3508 81.3458 81.3407 81.3357 81.3306 81.3255 81.3205 81.3155 81.3104 81.3054 81.3004 81.2953 81.2903 - 81.3569 81.3518 81.3467 81.3416 81.3365 81.3315 81.3264 81.3213 81.3162 81.3111 81.3061 81.301 81.296 81.2909 81.2858 81.2808 81.2757 81.2707 81.2657 81.2606 81.2556 81.2506 81.2456 - 81.3121 81.307 81.3019 81.2969 81.2918 81.2867 81.2816 81.2765 81.2714 81.2664 81.2613 81.2562 81.2512 81.2461 81.2411 81.236 81.231 81.226 81.2209 81.2159 81.2109 81.2058 81.2008 - 81.2674 81.2623 81.2572 81.2521 81.247 81.2419 81.2368 81.2318 81.2267 81.2216 81.2165 81.2115 81.2064 81.2014 81.1963 81.1913 81.1862 81.1812 81.1762 81.1711 81.1661 81.1611 81.1561 - 81.2226 81.2175 81.2124 81.2073 81.2022 81.1971 81.1921 81.187 81.1819 81.1768 81.1718 81.1667 81.1617 81.1566 81.1516 81.1465 81.1415 81.1365 81.1314 81.1264 81.1214 81.1163 81.1113 - 81.1778 81.1727 81.1676 81.1625 81.1574 81.1524 81.1473 81.1422 81.1371 81.1321 81.127 81.122 81.1169 81.1119 81.1068 81.1018 81.0967 81.0917 81.0867 81.0816 81.0766 81.0716 81.0666 - 81.133 81.1279 81.1228 81.1177 81.1127 81.1076 81.1025 81.0974 81.0924 81.0873 81.0822 81.0772 81.0721 81.0671 81.062 81.057 81.052 81.0469 81.0419 81.0369 81.0319 81.0269 81.0218 - 81.0882 81.0831 81.078 81.073 81.0679 81.0628 81.0577 81.0527 81.0476 81.0425 81.0375 81.0324 81.0274 81.0223 81.0173 81.0122 81.0072 81.0022 80.9972 80.9921 80.9871 80.9821 80.9771 - 81.0434 81.0383 81.0333 81.0282 81.0231 81.018 81.0129 81.0079 81.0028 80.9978 80.9927 80.9877 80.9826 80.9776 80.9725 80.9675 80.9625 80.9574 80.9524 80.9474 80.9424 80.9374 80.9324 - - - - 5000 - 5000 - - 173.356 173.438 173.519 173.601 173.682 173.764 173.845 173.927 174.008 174.09 174.172 174.253 174.335 174.416 174.498 174.579 174.661 174.742 174.824 174.906 174.987 175.069 175.15 - 173.358 173.44 173.521 173.602 173.684 173.765 173.847 173.928 174.01 174.091 174.173 174.254 174.335 174.417 174.498 174.58 174.661 174.743 174.824 174.906 174.987 175.069 175.15 - 173.36 173.441 173.523 173.604 173.685 173.767 173.848 173.93 174.011 174.092 174.174 174.255 174.336 174.418 174.499 174.58 174.662 174.743 174.824 174.906 174.987 175.068 175.15 - 173.362 173.443 173.525 173.606 173.687 173.768 173.85 173.931 174.012 174.093 174.175 174.256 174.337 174.418 174.5 174.581 174.662 174.743 174.825 174.906 174.987 175.068 175.15 - 173.364 173.445 173.526 173.608 173.689 173.77 173.851 173.932 174.013 174.094 174.176 174.257 174.338 174.419 174.5 174.581 174.663 174.744 174.825 174.906 174.987 175.068 175.149 - 173.366 173.447 173.528 173.609 173.69 173.771 173.852 173.933 174.014 174.096 174.177 174.258 174.339 174.42 174.501 174.582 174.663 174.744 174.825 174.906 174.987 175.068 175.149 - 173.368 173.449 173.53 173.611 173.692 173.773 173.854 173.935 174.016 174.097 174.178 174.259 174.34 174.42 174.501 174.582 174.663 174.744 174.825 174.906 174.987 175.068 175.149 - 173.37 173.451 173.532 173.613 173.694 173.774 173.855 173.936 174.017 174.098 174.179 174.259 174.34 174.421 174.502 174.583 174.664 174.745 174.825 174.906 174.987 175.068 175.149 - 173.372 173.453 173.534 173.614 173.695 173.776 173.857 173.937 174.018 174.099 174.18 174.26 174.341 174.422 174.503 174.583 174.664 174.745 174.826 174.906 174.987 175.068 175.149 - 173.374 173.455 173.535 173.616 173.697 173.777 173.858 173.939 174.019 174.1 174.181 174.261 174.342 174.423 174.503 174.584 174.665 174.745 174.826 174.907 174.987 175.068 175.149 - 173.376 173.457 173.537 173.618 173.698 173.779 173.859 173.94 174.021 174.101 174.182 174.262 174.343 174.423 174.504 174.584 174.665 174.746 174.826 174.907 174.987 175.068 175.148 - 173.378 173.459 173.539 173.619 173.7 173.78 173.861 173.941 174.022 174.102 174.183 174.263 174.344 174.424 174.505 174.585 174.665 174.746 174.826 174.907 174.987 175.068 175.148 - 173.38 173.46 173.541 173.621 173.701 173.782 173.862 173.943 174.023 174.103 174.184 174.264 174.344 174.425 174.505 174.586 174.666 174.746 174.827 174.907 174.987 175.068 175.148 - 173.382 173.462 173.543 173.623 173.703 173.783 173.864 173.944 174.024 174.104 174.185 174.265 174.345 174.425 174.506 174.586 174.666 174.747 174.827 174.907 174.987 175.068 175.148 - 173.384 173.464 173.544 173.624 173.705 173.785 173.865 173.945 174.025 174.105 174.186 174.266 174.346 174.426 174.506 174.587 174.667 174.747 174.827 174.907 174.987 175.068 175.148 - 173.386 173.466 173.546 173.626 173.706 173.786 173.866 173.946 174.027 174.107 174.187 174.267 174.347 174.427 174.507 174.587 174.667 174.747 174.827 174.907 174.987 175.068 175.148 - 173.388 173.468 173.548 173.628 173.708 173.788 173.868 173.948 174.028 174.108 174.188 174.268 174.348 174.428 174.508 174.588 174.668 174.748 174.828 174.908 174.988 175.068 175.147 - 173.39 173.47 173.55 173.63 173.709 173.789 173.869 173.949 174.029 174.109 174.189 174.269 174.348 174.428 174.508 174.588 174.668 174.748 174.828 174.908 174.988 175.067 175.147 - 173.392 173.472 173.551 173.631 173.711 173.791 173.871 173.95 174.03 174.11 174.19 174.27 174.349 174.429 174.509 174.589 174.668 174.748 174.828 174.908 174.988 175.067 175.147 - 173.394 173.473 173.553 173.633 173.713 173.792 173.872 173.952 174.031 174.111 174.191 174.27 174.35 174.43 174.51 174.589 174.669 174.749 174.828 174.908 174.988 175.067 175.147 - 173.396 173.475 173.555 173.635 173.714 173.794 173.873 173.953 174.033 174.112 174.192 174.271 174.351 174.431 174.51 174.59 174.669 174.749 174.829 174.908 174.988 175.067 175.147 - 173.398 173.477 173.557 173.636 173.716 173.795 173.875 173.954 174.034 174.113 174.193 174.272 174.352 174.431 174.511 174.59 174.67 174.749 174.829 174.908 174.988 175.067 175.147 - 173.4 173.479 173.558 173.638 173.717 173.797 173.876 173.955 174.035 174.114 174.194 174.273 174.353 174.432 174.511 174.591 174.67 174.75 174.829 174.908 174.988 175.067 175.147 - - - - - 81.4801250055295 - 174.263139694724 - - - - 0 - 0 - - 0 - 0 - - - - 0 - 0 - - 0 - 0 - - - - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - NaN - NaN - - - - - - - 74.498230 - 0.000000 - 0.000000 - 99.997187 - 0.000000 - 0.000000 - 0.000000 - 0.000000 - 0.000000 - 25.501770 - 0.000000 - 48.760331 - 8.028335 - 17.709564 - 0.000000 - 0.0 - 0.0 - 0.0 - CAMS - 0.060000 - 0.000000 - AUX_ECMWFT - 350.618205 - - - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B01.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B01.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B02.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B02.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B03.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B03.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B04.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B04.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B05.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B05.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B06.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B06.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B07.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B07.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B08.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B08.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B8A.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B8A.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B09.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B09.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B10.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B10.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B11.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B11.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_DETFOO_B12.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_QUALIT_B12.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_CLASSI_B00.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_CLDPRB_20m.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_SNWPRB_20m.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_CLDPRB_60m.jp2 - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/MSK_SNWPRB_60m.jp2 - - GRANULE/L2A_T34VEL_A044635_20240108T101404/QI_DATA/T34VEL_20240108T101401_PVI.jp2 - - diff --git a/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/tileInfo.json b/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/tileInfo.json deleted file mode 100644 index 73bd7a8..0000000 --- a/tests/data-files/S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL/tileInfo.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "path" : "tiles/34/V/EL/2024/1/8/0", - "timestamp" : "2024-01-08T10:14:07.485Z", - "utmZone" : 34, - "latitudeBand" : "V", - "gridSquare" : "EL", - "datastrip" : { - "id" : "S2A_OPER_MSI_L2A_DS_2APS_20240108T121951_S20240108T101404_N05.10", - "path" : "products/2024/1/8/S2A_MSIL2A_20240108T101401_N0510_R022_T34VEL_20240108T121951/datastrip/0" - }, - "tileGeometry" : { - "type" : "Polygon", - "crs" : { - "type" : "name", - "properties" : { - "name" : "urn:ogc:def:crs:EPSG:8.8.1:32634" - } - }, - "coordinates" : [ [ [ 499980.0, 6600000.0 ], [ 609780.0, 6600000.0 ], [ 609780.0, 6490200.0 ], [ 499980.0, 6490200.0 ], [ 499980.0, 6600000.0 ] ] ] - }, - "tileDataGeometry" : { - "type" : "Polygon", - "crs" : { - "type" : "name", - "properties" : { - "name" : "urn:ogc:def:crs:EPSG:8.8.1:32634" - } - }, - "coordinates" : [ [ [ 499981.0, 6522202.646042625 ], [ 499981.0, 6523091.756953125 ], [ 500304.31305821775, 6522970.514555884 ], [ 499981.0, 6522202.646042625 ] ] ] - }, - "tileOrigin" : { - "type" : "Point", - "crs" : { - "type" : "name", - "properties" : { - "name" : "urn:ogc:def:crs:EPSG:8.8.1:32634" - } - }, - "coordinates" : [ 499980.0, 6600000.0 ] - }, - "dataCoveragePercentage" : 0.0, - "cloudyPixelPercentage" : 0.0, - "productName" : "S2A_MSIL2A_20240108T101401_N0510_R022_T34VEL_20240108T121951", - "productPath" : "products/2024/1/8/S2A_MSIL2A_20240108T101401_N0510_R022_T34VEL_20240108T121951" -} \ No newline at end of file diff --git a/tests/test_commands.py b/tests/test_commands.py index e9d5429..54bfebe 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -9,6 +9,7 @@ import pystac import pytest +from antimeridian import FixWindingWarning from click import Group from click.testing import CliRunner from pystac.extensions.eo import EOExtension @@ -63,8 +64,6 @@ "S2A_T01WCS_20230625T234624_L2A": "S2A_MSIL2A_20230625T234621_N0509_R073_T01WCS_20230626T022157.SAFE", # both sun_azimuth and sun_zenith can be NaN, so don't set # "S2A_T01WCP_20230625T234624_L2A": "S2A_MSIL2A_20230625T234621_N0509_R073_T01WCP_20230626T022158.SAFE", - # viewing angles are all NaN, so don't set - "S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL": "S2A_OPER_MSI_L2A_TL_2APS_20240108T121951_A044635_T34VEL", } @@ -90,10 +89,11 @@ def proj_bbox_area_difference(item): def test_create_item(tmp_path: Path, item_id: str, file_name: str): granule_href = test_data.get_path(f"data-files/{file_name}") runner = CliRunner() - runner.invoke( - create_sentinel2_command(Group()), - ["create-item", granule_href, str(tmp_path)], - ) + with pytest.warns(FixWindingWarning): + runner.invoke( + create_sentinel2_command(Group()), + ["create-item", granule_href, str(tmp_path)], + ) jsons = [p for p in os.listdir(tmp_path) if p.endswith(".json")] assert len(jsons) == 1 file_name = jsons[0] diff --git a/tests/test_stac.py b/tests/test_stac.py index fb69626..28ed5f3 100644 --- a/tests/test_stac.py +++ b/tests/test_stac.py @@ -1,5 +1,6 @@ import pytest import shapely.geometry +from antimeridian import FixWindingWarning from stactools.sentinel2 import stac from . import test_data @@ -8,7 +9,8 @@ def test_product_metadata_asset() -> None: file_name = "S2A_OPER_MSI_L2A_TL_VGS1_20220401T110010_A035382_T34LBQ" path = test_data.get_path(f"data-files/{file_name}") - item = stac.create_item(path) + with pytest.warns(FixWindingWarning): + item = stac.create_item(path) assert "product_metadata" in item.assets @@ -18,14 +20,16 @@ def test_raises_for_missing_tileDataGeometry() -> None: ) path = test_data.get_path(f"data-files/{file_name}") with pytest.raises(ValueError): - stac.create_item(path) + with pytest.warns(FixWindingWarning): + stac.create_item(path) def test_antimeridian() -> None: path = test_data.get_path( "data-files/S2A_MSIL2A_20230821T221941_N0509_R029_T01KAB_20230822T021825.SAFE" ) - item = stac.create_item(path) + with pytest.warns(FixWindingWarning): + item = stac.create_item(path) expected = { "type": "MultiPolygon", "coordinates": [