Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 14, 2024
1 parent 7947e7b commit 167ea1b
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 72 deletions.
30 changes: 18 additions & 12 deletions CI/SCRIPTS/test_stac_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ def _test_core(

def test_s2_l1c_e84():
"""Function testing the support of Sentinel-2 L1C constellation processed by E84 and linked via a STAC URL"""
with tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
), s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True):
with (
tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
),
s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True),
):
_test_core(
"https://earth-search.aws.element84.com/v1/collections/sentinel-2-l1c/items/S2B_29SLD_20231121_0_L1C",
Constellation.S2,
Expand All @@ -73,12 +76,15 @@ def test_s2_l2a_e84():

def test_l9_e84():
"""Function testing the support of Landsat-9 constellation processed by E84 and linked via a STAC URL"""
with tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
), s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True):
with (
tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
),
s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True),
):
_test_core(
"https://earth-search.aws.element84.com/v1/collections/landsat-c2-l2/items/LC09_L2SP_095022_20231119_02_T2",
Constellation.L9,
Expand Down
30 changes: 18 additions & 12 deletions CI/SCRIPTS_WEEKLY/test_stac_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ def _test_core(

def test_s2_l1c_e84():
"""Function testing the support of Sentinel-2 L1C constellation processed by E84 and linked via a STAC URL"""
with tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
), s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True):
with (
tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
),
s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True),
):
_test_core(
"https://earth-search.aws.element84.com/v1/collections/sentinel-2-l1c/items/S2B_29SLD_20231121_0_L1C",
Constellation.S2,
Expand All @@ -91,12 +94,15 @@ def test_s2_l2a_e84():

def test_l9_e84():
"""Function testing the support of Landsat-9 constellation processed by E84 and linked via a STAC URL"""
with tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
), s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True):
with (
tempenv.TemporaryEnvironment(
{
"AWS_SECRET_ACCESS_KEY": os.getenv("AWS_S3_AWS_SECRET_ACCESS_KEY"),
"AWS_ACCESS_KEY_ID": os.getenv("AWS_S3_AWS_ACCESS_KEY_ID"),
}
),
s3.temp_s3(endpoint="s3.us-west-2.amazonaws.com", requester_pays=True),
):
_test_core(
"https://earth-search.aws.element84.com/v1/collections/landsat-c2-l2/items/LC09_L2SP_095022_20231119_02_T2",
Constellation.L9,
Expand Down
62 changes: 29 additions & 33 deletions eoreader/products/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
# flake8: noqa
__all__ = ["Product", "SensorType", "OrbitDirection"]

from .product import Product, SensorType, OrbitDirection
from .product import OrbitDirection, Product, SensorType

__all__ += [
"CustomProduct",
"CustomFields",
]
from .custom_product import CustomProduct, CustomFields
from .custom_product import CustomFields, CustomProduct

# STAC products
__all__ += [
Expand All @@ -39,7 +39,7 @@
"OpticalProduct",
"CleanMethod",
]
from .optical.optical_product import OpticalProduct, CleanMethod
from .optical.optical_product import CleanMethod, OpticalProduct

# VHR
__all__ += [
Expand All @@ -64,24 +64,24 @@
"Gs2ProductType",
"Gs2BandCombination",
]
from .optical.vhr_product import VhrProduct
from .optical.dimap_v1_product import DimapV1Product
from .optical.dimap_v2_product import (
DimapV2BandCombination,
DimapV2Product,
DimapV2ProductType,
)
from .optical.pld_product import PldProduct
from .optical.spot67_product import Spot67Product
from .optical.gs2_product import Gs2BandCombination, Gs2Product, Gs2ProductType
from .optical.maxar_product import (
MaxarBandId,
MaxarProduct,
MaxarProductType,
MaxarSatId,
MaxarBandId,
)
from .optical.vis1_product import Vis1Product, Vis1ProductType, Vis1BandCombination
from .optical.sv1_product import Sv1Product, Sv1ProductType, Sv1BandCombination
from .optical.gs2_product import Gs2Product, Gs2ProductType, Gs2BandCombination
from .optical.pld_product import PldProduct
from .optical.spot67_product import Spot67Product
from .optical.sv1_product import Sv1BandCombination, Sv1Product, Sv1ProductType
from .optical.vhr_product import VhrProduct
from .optical.vis1_product import Vis1BandCombination, Vis1Product, Vis1ProductType

# SPOT4/5
__all__ += [
Expand All @@ -91,10 +91,10 @@
"Spot45Product",
]
from .optical.spot45_product import (
Spot45ProductType,
Spot4BandCombination,
Spot5BandCombination,
Spot45Product,
Spot45ProductType,
)

# Planet
Expand All @@ -110,23 +110,23 @@
"PlaProductType",
"PlaInstrument",
]
from .optical.pla_product import PlaProduct, PlaProductType, PlaInstrument
from .optical.pla_product import PlaInstrument, PlaProduct, PlaProductType

# SkySat
__all__ += [
"SkyProductType",
"SkyProduct",
"SkyInstrument",
]
from .optical.sky_product import SkyProductType, SkyProduct, SkyInstrument
from .optical.sky_product import SkyInstrument, SkyProduct, SkyProductType

# RapidEye
__all__ += [
"ReProductType",
"ReProduct",
"ReInstrument",
]
from .optical.re_product import ReProductType, ReProduct
from .optical.re_product import ReProduct, ReProductType

# Landsat
__all__ += [
Expand All @@ -136,10 +136,10 @@
"LandsatInstrument",
]
from .optical.landsat_product import (
LandsatProduct,
LandsatProductType,
LandsatCollection,
LandsatInstrument,
LandsatProduct,
LandsatProductType,
)

# Sentinel
Expand All @@ -163,24 +163,24 @@
"SlstrView",
"SlstrStripe",
]
from .optical.s2_e84_product import S2E84Product, S2E84StacProduct
from .optical.s2_mpc_product import S2MpcStacProduct
from .optical.s2_product import (
S2Product,
S2ProductType,
S2GmlMasks,
S2Jp2Masks,
S2Product,
S2ProductType,
S2StacProduct,
)
from .optical.s2_e84_product import S2E84Product, S2E84StacProduct
from .optical.s2_mpc_product import S2MpcStacProduct
from .optical.s2_theia_product import S2TheiaProduct
from .optical.s3_product import S3Product, S3ProductType, S3DataType, S3Instrument
from .optical.s3_olci_product import S3OlciProduct
from .optical.s3_product import S3DataType, S3Instrument, S3Product, S3ProductType
from .optical.s3_slstr_product import (
S3SlstrProduct,
SlstrRadAdjustTuple,
SlstrRadAdjust,
SlstrView,
SlstrRadAdjustTuple,
SlstrStripe,
SlstrView,
)

# -- SAR --
Expand Down Expand Up @@ -221,31 +221,27 @@
"CapellaProductType",
"CapellaSensorMode" "",
]
from .sar.sar_product import SarProduct, SarProductType, SnapDems
from .sar.capella_product import CapellaProduct, CapellaProductType, CapellaSensorMode
from .sar.cosmo_product import CosmoProduct, CosmoProductType
from .sar.csg_product import CsgProduct, CsgSensorMode
from .sar.csk_product import CskProduct, CskSensorMode
from .sar.iceye_product import IceyeProduct, IceyeProductType, IceyeSensorMode
from .sar.rcm_product import RcmProduct, RcmProductType, RcmSensorMode
from .sar.rs2_product import Rs2Product, Rs2ProductType, Rs2SensorMode
from .sar.s1_product import S1Product, S1SensorMode, S1ProductType
from .sar.s1_product import S1Product, S1ProductType, S1SensorMode
from .sar.s1_rtc_asf_product import S1RtcAsfProduct, S1RtcProductType
from .sar.s1_rtc_mpc_product import S1RtcMpcStacProduct
from .sar.saocom_product import (
SaocomPolarization,
SaocomProduct,
SaocomProductType,
SaocomPolarization,
SaocomSensorMode,
)
from .sar.sar_product import SarProduct, SarProductType, SnapDems
from .sar.tsx_product import (
TsxProduct,
TsxPolarization,
TsxSatId,
TsxProduct,
TsxProductType,
TsxSatId,
TsxSensorMode,
)
from .sar.capella_product import (
CapellaProduct,
CapellaProductType,
CapellaSensorMode,
)
10 changes: 5 additions & 5 deletions eoreader/products/optical/pld_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,27 @@ def _map_bands(self) -> None:
# https://www.intelligence-airbusds.com/automne/api/docs/v1.0/document/download/ZG9jdXRoZXF1ZS1kb2N1bWVudC01NTMxNw==/ZG9jdXRoZXF1ZS1maWxlLTU1MzE2/pleiades-brochure-2019.pdf
pan = SpectralBand(
eoreader_name=PAN,
**{NAME: "PAN", ID: 1, GSD: self._pan_res, WV_MIN: 470, WV_MAX: 830}
**{NAME: "PAN", ID: 1, GSD: self._pan_res, WV_MIN: 470, WV_MAX: 830},
)

blue = SpectralBand(
eoreader_name=BLUE,
**{NAME: "BLUE", ID: 1, GSD: self._ms_res, WV_MIN: 460, WV_MAX: 530}
**{NAME: "BLUE", ID: 1, GSD: self._ms_res, WV_MIN: 460, WV_MAX: 530},
)

green = SpectralBand(
eoreader_name=GREEN,
**{NAME: "GREEN", ID: 2, GSD: self._ms_res, WV_MIN: 500, WV_MAX: 620}
**{NAME: "GREEN", ID: 2, GSD: self._ms_res, WV_MIN: 500, WV_MAX: 620},
)

red = SpectralBand(
eoreader_name=RED,
**{NAME: "RED", ID: 3, GSD: self._ms_res, WV_MIN: 590, WV_MAX: 710}
**{NAME: "RED", ID: 3, GSD: self._ms_res, WV_MIN: 590, WV_MAX: 710},
)

nir = SpectralBand(
eoreader_name=NIR,
**{NAME: "NIR", ID: 4, GSD: self._ms_res, WV_MIN: 740, WV_MAX: 940}
**{NAME: "NIR", ID: 4, GSD: self._ms_res, WV_MIN: 740, WV_MAX: 940},
)
self._map_bands_core(blue=blue, green=green, red=red, nir=nir, pan=pan)

Expand Down
14 changes: 7 additions & 7 deletions eoreader/products/optical/pneo_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,37 +53,37 @@ def _map_bands(self) -> None:
# Create spectral bands
ca = SpectralBand(
eoreader_name=CA,
**{NAME: "DEEP BLUE", ID: 5, GSD: self._ms_res, WV_MIN: 400, WV_MAX: 450}
**{NAME: "DEEP BLUE", ID: 5, GSD: self._ms_res, WV_MIN: 400, WV_MAX: 450},
)

pan = SpectralBand(
eoreader_name=PAN,
**{NAME: "PAN", ID: 1, GSD: self._pan_res, WV_MIN: 450, WV_MAX: 800}
**{NAME: "PAN", ID: 1, GSD: self._pan_res, WV_MIN: 450, WV_MAX: 800},
)

blue = SpectralBand(
eoreader_name=BLUE,
**{NAME: "BLUE", ID: 1, GSD: self._ms_res, WV_MIN: 450, WV_MAX: 520}
**{NAME: "BLUE", ID: 1, GSD: self._ms_res, WV_MIN: 450, WV_MAX: 520},
)

green = SpectralBand(
eoreader_name=GREEN,
**{NAME: "GREEN", ID: 2, GSD: self._ms_res, WV_MIN: 490, WV_MAX: 610}
**{NAME: "GREEN", ID: 2, GSD: self._ms_res, WV_MIN: 490, WV_MAX: 610},
)

red = SpectralBand(
eoreader_name=RED,
**{NAME: "RED", ID: 3, GSD: self._ms_res, WV_MIN: 600, WV_MAX: 720}
**{NAME: "RED", ID: 3, GSD: self._ms_res, WV_MIN: 600, WV_MAX: 720},
)

nir = SpectralBand(
eoreader_name=NIR,
**{NAME: "NIR", ID: 4, GSD: self._ms_res, WV_MIN: 750, WV_MAX: 830}
**{NAME: "NIR", ID: 4, GSD: self._ms_res, WV_MIN: 750, WV_MAX: 830},
)

vre = SpectralBand(
eoreader_name=VRE_1,
**{NAME: "RED EDGE", ID: 6, GSD: self._ms_res, WV_MIN: 700, WV_MAX: 750}
**{NAME: "RED EDGE", ID: 6, GSD: self._ms_res, WV_MIN: 700, WV_MAX: 750},
)
self._map_bands_core(
blue=blue, green=green, red=red, nir=nir, pan=pan, vre=vre, ca=ca
Expand Down
6 changes: 3 additions & 3 deletions eoreader/products/optical/spot67_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ def _map_bands(self) -> None:
# https://www.intelligence-airbusds.com/automne/api/docs/v1.0/document/download/ZG9jdXRoZXF1ZS1kb2N1bWVudC01NTMyMw==/ZG9jdXRoZXF1ZS1maWxlLTU1MzIy/spot-brochure-2019.pdf
pan = SpectralBand(
eoreader_name=PAN,
**{NAME: "PAN", ID: 1, GSD: 1.5, WV_MIN: 450, WV_MAX: 745}
**{NAME: "PAN", ID: 1, GSD: 1.5, WV_MIN: 450, WV_MAX: 745},
)

blue = SpectralBand(
eoreader_name=BLUE,
**{NAME: "BLUE", ID: 1, GSD: 6, WV_MIN: 450, WV_MAX: 520}
**{NAME: "BLUE", ID: 1, GSD: 6, WV_MIN: 450, WV_MAX: 520},
)

green = SpectralBand(
eoreader_name=GREEN,
**{NAME: "GREEN", ID: 2, GSD: 6, WV_MIN: 530, WV_MAX: 590}
**{NAME: "GREEN", ID: 2, GSD: 6, WV_MIN: 530, WV_MAX: 590},
)

red = SpectralBand(
Expand Down

0 comments on commit 167ea1b

Please sign in to comment.