Skip to content

Commit a610f77

Browse files
committed
- **BREAKING CHANGES: Platform becomes Constellation to fit STAC vocabulary**
- **ENH: Add a STAC object that can be used to retrieve STAC Items from every Product (`prod.stac.create_item()`)** - **ENH: Extending `get_raw_band_paths` to every products ([#31](#31 - **ENH: Adding a `is_ortho` attribute corresponding to when the product is already orthorectified/geocoded, in order to avoid computing heavy processes without wanting it (i.e. footprint...)** - OPTIM: Retrieve extent from metadata when possible
1 parent 7fbd046 commit a610f77

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1833
-705
lines changed

CHANGES.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Breaking Changes
66

77
- **BREAKING CHANGES: `Optical` becomes `Spectral` when more appropriate**
8+
- **BREAKING CHANGES: `Platform` becomes `Constellation` to fit STAC vocabulary**
89
- **BREAKING CHANGES: File `alias` is removed, replaced by `*_bands` files and proper imports in `bands.__init__`**
910
- **BREAKING CHANGES: Product attribute `band_names` becomes `bands` in order to be STAC compliant ([#29](https://github.com/sertit/eoreader/issues/29))**
1011
- **BREAKING CHANGES: Better use of `NIR` and `NARROW_NIR` in the `indices` file (according to the gsd of `Sentinel-2` bands composing the indices)**
@@ -19,10 +20,14 @@
1920
- **ENH: Adding the `GREEN1` mapped band, corresponding to PlanetScope `GREEN I` and `Sentinel-3 OLCI` `Oa05` band**
2021
- **ENH: Handle some slightly broken `Sentinel-2` products, i.e. when the metadata files are corrupted or when the detfoo vectors are empty ([#34](https://github.com/sertit/eoreader/issues/34))**
2122
- **ENH: Handle exception for corrupted bands (in `Sentinel-2` and `utils.read`) ([#34](https://github.com/sertit/eoreader/issues/34))**
23+
- **ENH: Add a STAC object that can be used to retrieve STAC Items from every Product (`prod.stac.create_item()`)**
24+
- **ENH: Extending `get_raw_band_paths` to every products ([#31](https://github.com/sertit/eoreader/issues/31))**
25+
- **ENH: Adding a `is_ortho` attribute corresponding to when the product is already orthorectified/geocoded, in order to avoid computing heavy processes without wanting it (i.e. footprint...)**
2226

2327
### Optimizations
2428

25-
- OPTIM: retrieve name from filename if possible
29+
- OPTIM: Retrieve name from filename if possible
30+
- OPTIM: Retrieve extent from metadata when possible
2631

2732
### Bug Fixes
2833

CI/SCRIPTS/test_custom.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def test_custom():
4343
name="20200310T030415_WV02_Ortho",
4444
datetime="20200310T030415",
4545
sensor_type=SensorType.OPTICAL,
46-
platform="WV02",
46+
constellation="WV02",
4747
resolution=2.0,
4848
product_type="Ortho",
4949
band_map={BLUE: 1, GREEN: 2, RED: 3, NIR: 4, SWIR_1: 5},
@@ -150,7 +150,7 @@ def test_custom():
150150
sensor_type=SensorType.SAR,
151151
name="20210827T162210_ICEYE_SC_GRD",
152152
datetime="20210827T162210",
153-
platform="ICEYE",
153+
constellation="ICEYE",
154154
resolution=6.0,
155155
product_type="GRD",
156156
band_map={VV: 1, VV_DSPK: 2},
@@ -198,7 +198,7 @@ def test_custom():
198198
sensor_type=SensorType.OPTICAL,
199199
name="SPOT6_WGS84",
200200
datetime="20181218T090308",
201-
platform="SPOT6",
201+
constellation="SPOT6",
202202
resolution=1.5 * 15,
203203
product_type="ORT",
204204
band_map={RED: 1, GREEN: 2, BLUE: 3, NIR: 4},
@@ -221,7 +221,7 @@ def test_custom():
221221
assert root.findtext("name") == "SPOT6_WGS84"
222222
assert root.findtext("datetime") == "2018-12-18T09:03:08"
223223
assert root.findtext("sensor_type") == "Optical"
224-
assert root.findtext("platform") == "Spot-6"
224+
assert root.findtext("constellation") == "Spot-6"
225225
assert root.findtext("resolution") == str(1.5 * 15)
226226
assert root.findtext("product_type") == "ORT"
227227
assert root.findtext("band_map") == "{'BLUE': 3, 'GREEN': 2, 'RED': 1, 'NIR': 4}"

CI/SCRIPTS/test_others.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from eoreader.env_vars import DEM_PATH, S3_DB_URL_ROOT
1414
from eoreader.exceptions import InvalidTypeError
1515
from eoreader.products import SensorType
16-
from eoreader.reader import Platform
16+
from eoreader.reader import Constellation
1717

1818
from .scripts_utils import (
1919
AWS_ACCESS_KEY_ID,
@@ -331,15 +331,15 @@ def test_reader_methods():
331331
prod_path = opt_path().joinpath("LC08_L1GT_023030_20200518_20200527_01_T2")
332332

333333
# NAME
334-
READER.valid_name(prod_path, Platform.L8)
334+
READER.valid_name(prod_path, Constellation.L8)
335335
READER.valid_name(prod_path, "L8")
336336
READER.valid_name(prod_path, "Landsat-8")
337-
READER.valid_name(prod_path, Platform.L8.name)
338-
READER.valid_name(prod_path, Platform.L8.value)
337+
READER.valid_name(prod_path, Constellation.L8.name)
338+
READER.valid_name(prod_path, Constellation.L8.value)
339339

340340
# MTD
341-
READER.valid_mtd(prod_path, Platform.L8)
341+
READER.valid_mtd(prod_path, Constellation.L8)
342342
READER.valid_mtd(prod_path, "L8")
343343
READER.valid_mtd(prod_path, "Landsat-8")
344-
READER.valid_mtd(prod_path, Platform.L8.name)
345-
READER.valid_mtd(prod_path, Platform.L8.value)
344+
READER.valid_mtd(prod_path, Constellation.L8.name)
345+
READER.valid_mtd(prod_path, Constellation.L8.value)

CI/SCRIPTS/test_satellites.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def _test_core(
260260

261261
# Check attributes
262262
assert stack.attrs["long_name"] == " ".join(to_str(stack_bands))
263-
assert stack.attrs["sensor"] == prod._get_platform().value
263+
assert stack.attrs["sensor"] == prod._get_constellation().value
264264
assert stack.attrs["sensor_id"] == prod.sat_id
265265
assert stack.attrs["product_type"] == prod.product_type.value
266266
assert stack.attrs["acquisition_date"] == prod.get_datetime(
@@ -301,7 +301,7 @@ def _test_core(
301301

302302
# Check attributes
303303
assert band_arr.attrs["long_name"] == first_band.name
304-
assert band_arr.attrs["sensor"] == prod._get_platform().value
304+
assert band_arr.attrs["sensor"] == prod._get_constellation().value
305305
assert band_arr.attrs["sensor_id"] == prod.sat_id
306306
assert band_arr.attrs["product_type"] == prod.product_type.value
307307
assert band_arr.attrs["acquisition_date"] == prod.get_datetime(

0 commit comments

Comments
 (0)