mapchete-eo 2026.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mapchete_eo/__init__.py +1 -0
- mapchete_eo/array/__init__.py +0 -0
- mapchete_eo/array/buffer.py +16 -0
- mapchete_eo/array/color.py +29 -0
- mapchete_eo/array/convert.py +163 -0
- mapchete_eo/base.py +653 -0
- mapchete_eo/blacklist.txt +175 -0
- mapchete_eo/cli/__init__.py +30 -0
- mapchete_eo/cli/bounds.py +22 -0
- mapchete_eo/cli/options_arguments.py +227 -0
- mapchete_eo/cli/s2_brdf.py +77 -0
- mapchete_eo/cli/s2_cat_results.py +130 -0
- mapchete_eo/cli/s2_find_broken_products.py +77 -0
- mapchete_eo/cli/s2_jp2_static_catalog.py +166 -0
- mapchete_eo/cli/s2_mask.py +71 -0
- mapchete_eo/cli/s2_mgrs.py +45 -0
- mapchete_eo/cli/s2_rgb.py +114 -0
- mapchete_eo/cli/s2_verify.py +129 -0
- mapchete_eo/cli/static_catalog.py +82 -0
- mapchete_eo/eostac.py +30 -0
- mapchete_eo/exceptions.py +87 -0
- mapchete_eo/image_operations/__init__.py +12 -0
- mapchete_eo/image_operations/blend_functions.py +579 -0
- mapchete_eo/image_operations/color_correction.py +136 -0
- mapchete_eo/image_operations/compositing.py +266 -0
- mapchete_eo/image_operations/dtype_scale.py +43 -0
- mapchete_eo/image_operations/fillnodata.py +130 -0
- mapchete_eo/image_operations/filters.py +319 -0
- mapchete_eo/image_operations/linear_normalization.py +81 -0
- mapchete_eo/image_operations/sigmoidal.py +114 -0
- mapchete_eo/io/__init__.py +37 -0
- mapchete_eo/io/assets.py +496 -0
- mapchete_eo/io/items.py +162 -0
- mapchete_eo/io/levelled_cubes.py +259 -0
- mapchete_eo/io/path.py +155 -0
- mapchete_eo/io/products.py +423 -0
- mapchete_eo/io/profiles.py +45 -0
- mapchete_eo/platforms/sentinel2/__init__.py +17 -0
- mapchete_eo/platforms/sentinel2/_mapper_registry.py +89 -0
- mapchete_eo/platforms/sentinel2/bandpass_adjustment.py +104 -0
- mapchete_eo/platforms/sentinel2/brdf/__init__.py +8 -0
- mapchete_eo/platforms/sentinel2/brdf/config.py +32 -0
- mapchete_eo/platforms/sentinel2/brdf/correction.py +260 -0
- mapchete_eo/platforms/sentinel2/brdf/hls.py +251 -0
- mapchete_eo/platforms/sentinel2/brdf/models.py +44 -0
- mapchete_eo/platforms/sentinel2/brdf/protocols.py +27 -0
- mapchete_eo/platforms/sentinel2/brdf/ross_thick.py +136 -0
- mapchete_eo/platforms/sentinel2/brdf/sun_angle_arrays.py +76 -0
- mapchete_eo/platforms/sentinel2/config.py +241 -0
- mapchete_eo/platforms/sentinel2/driver.py +43 -0
- mapchete_eo/platforms/sentinel2/masks.py +329 -0
- mapchete_eo/platforms/sentinel2/metadata_parser/__init__.py +6 -0
- mapchete_eo/platforms/sentinel2/metadata_parser/base.py +56 -0
- mapchete_eo/platforms/sentinel2/metadata_parser/default_path_mapper.py +135 -0
- mapchete_eo/platforms/sentinel2/metadata_parser/models.py +78 -0
- mapchete_eo/platforms/sentinel2/metadata_parser/s2metadata.py +639 -0
- mapchete_eo/platforms/sentinel2/preconfigured_sources/__init__.py +57 -0
- mapchete_eo/platforms/sentinel2/preconfigured_sources/guessers.py +108 -0
- mapchete_eo/platforms/sentinel2/preconfigured_sources/item_mappers.py +171 -0
- mapchete_eo/platforms/sentinel2/preconfigured_sources/metadata_xml_mappers.py +217 -0
- mapchete_eo/platforms/sentinel2/preprocessing_tasks.py +50 -0
- mapchete_eo/platforms/sentinel2/processing_baseline.py +163 -0
- mapchete_eo/platforms/sentinel2/product.py +747 -0
- mapchete_eo/platforms/sentinel2/source.py +114 -0
- mapchete_eo/platforms/sentinel2/types.py +114 -0
- mapchete_eo/processes/__init__.py +0 -0
- mapchete_eo/processes/config.py +51 -0
- mapchete_eo/processes/dtype_scale.py +112 -0
- mapchete_eo/processes/eo_to_xarray.py +19 -0
- mapchete_eo/processes/merge_rasters.py +239 -0
- mapchete_eo/product.py +323 -0
- mapchete_eo/protocols.py +61 -0
- mapchete_eo/search/__init__.py +14 -0
- mapchete_eo/search/base.py +285 -0
- mapchete_eo/search/config.py +113 -0
- mapchete_eo/search/s2_mgrs.py +313 -0
- mapchete_eo/search/stac_search.py +278 -0
- mapchete_eo/search/stac_static.py +197 -0
- mapchete_eo/search/utm_search.py +251 -0
- mapchete_eo/settings.py +25 -0
- mapchete_eo/sort.py +60 -0
- mapchete_eo/source.py +109 -0
- mapchete_eo/time.py +62 -0
- mapchete_eo/types.py +76 -0
- mapchete_eo-2026.2.0.dist-info/METADATA +91 -0
- mapchete_eo-2026.2.0.dist-info/RECORD +89 -0
- mapchete_eo-2026.2.0.dist-info/WHEEL +4 -0
- mapchete_eo-2026.2.0.dist-info/entry_points.txt +11 -0
- mapchete_eo-2026.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_21NTD_20230604_0_L2A
|
|
2
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_28VDP_20231008_0_L2A
|
|
3
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_52XDJ_20230727_0_L2A
|
|
4
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_51XVE_20230608_0_L2A
|
|
5
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_51XVE_20230807_0_L2A
|
|
6
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_37QCU_20230208_1_L2A
|
|
7
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_28WDU_20230805_0_L2A
|
|
8
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_29VNK_20230904_0_L2A
|
|
9
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_16SDA_20230815_1_L2A
|
|
10
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_16TCM_20230707_1_L2A
|
|
11
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_16SGB_20230812_0_L2A
|
|
12
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_19EDT_20230504_0_L2A
|
|
13
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_56VNL_20230618_0_L2A
|
|
14
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_56VNL_20230618_0_L2A
|
|
15
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_52WDU_20230602_0_L2A
|
|
16
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_24JVT_20230505_0_L2A
|
|
17
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_37LGJ_20230517_0_L2A
|
|
18
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_37LGJ_20230527_0_L2A
|
|
19
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_57UWB_20230721_0_L2A
|
|
20
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_51SUV_20230501_0_L2A
|
|
21
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_54LTK_20230505_0_L2A
|
|
22
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_54SWE_20230825_0_L2A
|
|
23
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_54SWE_20230407_1_L2A
|
|
24
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_55KDP_20230319_1_L2A
|
|
25
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_1MHP_20230311_0_L2A
|
|
26
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_2MRB_20231026_0_L2A
|
|
27
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_2MQU_20230817_0_L2A
|
|
28
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_2MQU_20231115_0_L2A
|
|
29
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_43WFM_20231017_0_L2A
|
|
30
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_20NPH_20231017_0_L2A
|
|
31
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_22MDE_20230411_0_L2A
|
|
32
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_14RLP_20230112_1_L2A
|
|
33
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_53RLM_20231109_0_L2A
|
|
34
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13QBC_20230212_0_L2A
|
|
35
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_15PVR_20230209_0_L2A
|
|
36
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_22UDF_20230626_0_L2A
|
|
37
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_22UDF_20230815_0_L2A
|
|
38
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_22UDF_20230830_0_L2A
|
|
39
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_22UDF_20231004_0_L2A
|
|
40
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_17NNG_20230102_0_L2A
|
|
41
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_12VVK_20230606_0_L2A
|
|
42
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_12VVK_20230601_0_L2A
|
|
43
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_4KGB_20230302_0_L2A
|
|
44
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_6KTA_20231128_0_L2A
|
|
45
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_4KGB_20230620_0_L2A
|
|
46
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_10KFB_20230906_0_L2A
|
|
47
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_25MEN_20230216_0_L2A
|
|
48
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_24MYS_20231017_0_L2A
|
|
49
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_18LXP_20230316_0_L2A
|
|
50
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_18PZS_20230329_1_L2A
|
|
51
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_17MPS_20230630_0_L2A
|
|
52
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_17MQT_20230630_0_L2A
|
|
53
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_17MRT_20230630_0_L2A
|
|
54
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_17MQU_20230630_0_L2A
|
|
55
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_17MRU_20230630_0_L2A
|
|
56
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_21KWP_20230131_0_L2A
|
|
57
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_23PPN_20230224_0_L2A
|
|
58
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_4NEK_20231126_0_L2A
|
|
59
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_4QFH_20230508_0_L2A
|
|
60
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_42QTL_20230913_0_L2A
|
|
61
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13RDH_20230110_0_L2A
|
|
62
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13REH_20230110_0_L2A
|
|
63
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13RFH_20230110_0_L2A
|
|
64
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13RDJ_20230110_0_L2A
|
|
65
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13REJ_20230110_0_L2A
|
|
66
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13QEG_20230328_0_L2A
|
|
67
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13QFG_20230328_0_L2A
|
|
68
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_49LFK_20230314_0_L2A
|
|
69
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_49LFK_20230905_0_L2A
|
|
70
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_58MGD_20230906_0_L2A
|
|
71
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_59NMD_20230516_0_L2A
|
|
72
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_60KTU_20230514_0_L2A
|
|
73
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_59KRP_20230603_0_L2A
|
|
74
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_59KRP_20231016_0_L2A
|
|
75
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_59KRP_20231230_0_L2A
|
|
76
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_58LHQ_20231202_0_L2A
|
|
77
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_58PEU_20230105_0_L2A
|
|
78
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_58PEU_20230515_0_L2A
|
|
79
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58KGU_20230508_0_L2A
|
|
80
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_48LYR_20230228_0_L2A
|
|
81
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_49PGS_20230109_0_L2A
|
|
82
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_53NLF_20230919_0_L2A
|
|
83
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_51MTN_20230906_1_L2A
|
|
84
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_52MBT_20230823_0_L2A
|
|
85
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_30VWK_20231017_0_L2A
|
|
86
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58WDB_20230706_0_L2A
|
|
87
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_8UPD_20230902_0_L2A
|
|
88
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_54MYV_20230706_0_L2A
|
|
89
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_56LPL_20231213_0_L2A
|
|
90
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_56LPL_20231223_0_L2A
|
|
91
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_21XVF_20230913_0_L2A
|
|
92
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_24XVH_20230729_2_L2A
|
|
93
|
+
s3://sentinel-s2-l2a-stac/2023/08/05/S2A_OPER_MSI_L2A_TL_2APS_20230806T022123_A042412_T60VXH.json
|
|
94
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_20RPU_20230308_0_L2A
|
|
95
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_31XDF_20230810_2_L2A
|
|
96
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_35XLA_20230807_0_L2A
|
|
97
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_38CME_20230315_0_L2A
|
|
98
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_35CNP_20230213_0_L2A
|
|
99
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_41CMV_20230202_0_L2A
|
|
100
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_51CWM_20230120_1_L2A
|
|
101
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_52CDR_20230122_1_L2A
|
|
102
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_26CNA_20230225_0_L2A
|
|
103
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_25CDM_20230123_2_L2A
|
|
104
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_57CVP_20230314_0_L2A
|
|
105
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_8CNS_20230206_1_L2A
|
|
106
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_32SLH_20240313_0_L2A
|
|
107
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_22XDJ_20240716_2_L2A
|
|
108
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_43PBT_20240216_0_L2A
|
|
109
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_35HLA_20240203_0_L2A
|
|
110
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_35HLA_20240208_0_L2A
|
|
111
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_35HPA_20240225_0_L2A
|
|
112
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_35HPA_20240126_0_L2A
|
|
113
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_35HLA_20240124_0_L2A
|
|
114
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_39LXK_20240305_0_L2A
|
|
115
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_39LXK_20240315_0_L2A
|
|
116
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_38JLS_20240106_0_L2A
|
|
117
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_42FYM_20240304_0_L2A
|
|
118
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_43FEB_20240202_0_L2A
|
|
119
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_43FEB_20240522_0_L2A
|
|
120
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_29LKJ_20240613_0_L2A
|
|
121
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_51JXN_20240130_0_L2A
|
|
122
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_24FYF_20240325_0_L2A
|
|
123
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_55HFV_20240201_0_L2A
|
|
124
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_1GFM_20240126_0_L2A
|
|
125
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_1WEV_20240612_0_L2A
|
|
126
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_5VLG_20240520_1_L2A
|
|
127
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_42QTL_20240818_0_L2A
|
|
128
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_9UXB_20240620_0_L2A
|
|
129
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_13UFU_20240725_0_L2A
|
|
130
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_21VVK_20240506_1_L2A
|
|
131
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_53VLE_20240714_0_L2A
|
|
132
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_19XDE_20240705_1_L2A
|
|
133
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58XDJ_20240807_0_L2A
|
|
134
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58XDJ_20240509_0_L2A
|
|
135
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_56WNT_20240606_1_L2A
|
|
136
|
+
s3://sentinel-s2-l2a-stac/2024/05/05/S2B_OPER_MSI_L2A_TL_2BPS_20240506T001713_A037422_T01VCJ.json
|
|
137
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_22UED_20240612_0_L2A
|
|
138
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_22UED_20240905_0_L2A
|
|
139
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_22UED_20241030_0_L2A
|
|
140
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_34CEU_20240227_0_L2A
|
|
141
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_41CNS_20240215_0_L2A
|
|
142
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_34DFJ_20240116_0_L2A
|
|
143
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_22UDF_20240730_0_L2A
|
|
144
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_22UDF_20240829_0_L2A
|
|
145
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_30NYJ_20240430_0_L2A
|
|
146
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_31MHT_20240620_0_L2A
|
|
147
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_31MHT_20240630_0_L2A
|
|
148
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_19LGK_20240714_0_L2A
|
|
149
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_2MRB_20240124_0_L2A
|
|
150
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_2MRB_20240218_0_L2A
|
|
151
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_2MRB_20240712_0_L2A
|
|
152
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_2MQU_20241104_0_L2A
|
|
153
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_2MRB_20241124_0_L2A
|
|
154
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_2LMR_20240122_0_L2A
|
|
155
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_2LMR_20240406_0_L2A
|
|
156
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_2LMR_20240526_0_L2A
|
|
157
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_6KTA_20240516_0_L2A
|
|
158
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_53NLF_20240221_0_L2A
|
|
159
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_53NLF_20240401_0_L2A
|
|
160
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_53NLF_20240625_0_L2A
|
|
161
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_53NLF_20240804_0_L2A
|
|
162
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_7JDH_20241026_0_L2A
|
|
163
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_59QLA_20240102_0_L2A
|
|
164
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_59QLB_20240421_0_L2A
|
|
165
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_59NMD_20240126_0_L2A
|
|
166
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58MGD_20240707_0_L2A
|
|
167
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58MGD_20240915_0_L2A
|
|
168
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58MGD_20241015_0_L2A
|
|
169
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58LHQ_20240405_0_L2A
|
|
170
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58LHQ_20240714_0_L2A
|
|
171
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_59KRP_20240612_0_L2A
|
|
172
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_58KGU_20240202_0_L2A
|
|
173
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2A_47XNH_20240603_1_L2A
|
|
174
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_48XWN_20240703_1_L2A
|
|
175
|
+
https://earth-search.aws.element84.com/v1/collections/sentinel-2-l2a/items/S2B_49XDH_20240505_1_L2A
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from mapchete_eo.cli.bounds import bounds
|
|
4
|
+
from mapchete_eo.cli.s2_brdf import s2_brdf
|
|
5
|
+
from mapchete_eo.cli.s2_cat_results import s2_cat_results
|
|
6
|
+
from mapchete_eo.cli.s2_find_broken_products import s2_find_broken_products
|
|
7
|
+
from mapchete_eo.cli.s2_jp2_static_catalog import s2_jp2_static_catalog
|
|
8
|
+
from mapchete_eo.cli.s2_mask import s2_mask
|
|
9
|
+
from mapchete_eo.cli.s2_mgrs import s2_mgrs
|
|
10
|
+
from mapchete_eo.cli.s2_rgb import s2_rgb
|
|
11
|
+
from mapchete_eo.cli.s2_verify import s2_verify
|
|
12
|
+
from mapchete_eo.cli.static_catalog import static_catalog
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@click.group(help="Tools around mapchete EO package.")
|
|
16
|
+
@click.pass_context
|
|
17
|
+
def eo(ctx):
|
|
18
|
+
ctx.ensure_object(dict)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
eo.add_command(bounds)
|
|
22
|
+
eo.add_command(s2_brdf)
|
|
23
|
+
eo.add_command(s2_cat_results)
|
|
24
|
+
eo.add_command(s2_find_broken_products)
|
|
25
|
+
eo.add_command(s2_jp2_static_catalog)
|
|
26
|
+
eo.add_command(s2_mask)
|
|
27
|
+
eo.add_command(s2_mgrs)
|
|
28
|
+
eo.add_command(s2_rgb)
|
|
29
|
+
eo.add_command(s2_verify)
|
|
30
|
+
eo.add_command(static_catalog)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import click
|
|
2
|
+
import pystac
|
|
3
|
+
from mapchete.cli.options import opt_debug
|
|
4
|
+
from mapchete.path import MPath
|
|
5
|
+
|
|
6
|
+
from mapchete_eo.cli import options_arguments
|
|
7
|
+
from mapchete_eo.io.items import item_fix_footprint
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@click.command()
|
|
11
|
+
@options_arguments.arg_stac_item
|
|
12
|
+
@opt_debug
|
|
13
|
+
def bounds(
|
|
14
|
+
stac_item: MPath,
|
|
15
|
+
**_,
|
|
16
|
+
):
|
|
17
|
+
"""Prints bounds of STAC item."""
|
|
18
|
+
item = item_fix_footprint(pystac.Item.from_file(stac_item))
|
|
19
|
+
if item.bbox:
|
|
20
|
+
click.echo(f"{' '.join(map(str, item.bbox))}")
|
|
21
|
+
else:
|
|
22
|
+
click.echo("item does not have a bounding box")
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
import tqdm
|
|
5
|
+
from mapchete.path import MPath
|
|
6
|
+
|
|
7
|
+
from mapchete_eo.platforms.sentinel2.brdf.models import BRDFModels
|
|
8
|
+
from mapchete_eo.io.profiles import rio_profiles
|
|
9
|
+
from mapchete_eo.platforms.sentinel2.config import SceneClassification
|
|
10
|
+
from mapchete_eo.platforms.sentinel2.source import Sentinel2Source
|
|
11
|
+
from mapchete_eo.platforms.sentinel2.types import L2ABand, Resolution
|
|
12
|
+
from mapchete_eo.time import to_datetime
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class TqdmUpTo(tqdm.tqdm):
|
|
16
|
+
"""Provides `update_to(n)` which uses `tqdm.update(delta_n)`."""
|
|
17
|
+
|
|
18
|
+
def update_to(self, n: int = 1, nsize: int = 1, total: Optional[int] = None):
|
|
19
|
+
"""
|
|
20
|
+
n : int, optional
|
|
21
|
+
Number of blocks transferred so far [default: 1].
|
|
22
|
+
nsize : int, optional
|
|
23
|
+
Size of each block (in tqdm units) [default: 1].
|
|
24
|
+
total : int, optional
|
|
25
|
+
Total size (in tqdm units). If [default: None] remains unchanged.
|
|
26
|
+
"""
|
|
27
|
+
if total is not None:
|
|
28
|
+
self.total = total
|
|
29
|
+
return self.update(n * nsize - self.n) # also sets self.n = b * bsize
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _str_to_list(_, __, value):
|
|
33
|
+
if value:
|
|
34
|
+
return value.split(",")
|
|
35
|
+
return []
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _str_to_resolution(_, __, value):
|
|
39
|
+
if value:
|
|
40
|
+
return Resolution[value]
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _str_to_rio_profile(_, __, value):
|
|
44
|
+
if value:
|
|
45
|
+
return rio_profiles[value]
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _brdf_model_str_to_brdf(_, __, value):
|
|
49
|
+
if value:
|
|
50
|
+
if value == "none":
|
|
51
|
+
return None
|
|
52
|
+
else:
|
|
53
|
+
return BRDFModels[value]
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _str_to_l2a_bands(_, __, value):
|
|
57
|
+
if value:
|
|
58
|
+
return [L2ABand[v] for v in value.split(",")]
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _str_to_datetime(_, param, value):
|
|
62
|
+
if value:
|
|
63
|
+
return to_datetime(value)
|
|
64
|
+
raise ValueError(f"--{param.name} is mandatory")
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _str_to_source(_, __, value):
|
|
68
|
+
if value:
|
|
69
|
+
return Sentinel2Source(collection=value)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
arg_stac_item = click.argument("stac-item", type=click.Path(path_type=MPath))
|
|
73
|
+
arg_stac_items = click.argument(
|
|
74
|
+
"stac-items", type=click.Path(path_type=MPath), nargs=-1
|
|
75
|
+
)
|
|
76
|
+
arg_dst_path = click.argument("dst-path", type=click.Path(path_type=MPath))
|
|
77
|
+
opt_dst_path = click.option(
|
|
78
|
+
"--dst-path", type=click.Path(path_type=MPath), default=".", show_default=True
|
|
79
|
+
)
|
|
80
|
+
opt_thumbnail_dir = click.option(
|
|
81
|
+
"--thumbnail-dir", type=click.Path(path_type=MPath), default=None, show_default=True
|
|
82
|
+
)
|
|
83
|
+
opt_blacklist = click.option(
|
|
84
|
+
"--blacklist",
|
|
85
|
+
type=click.Path(path_type=MPath),
|
|
86
|
+
default="s3://eox-mhub-cache/blacklist.txt",
|
|
87
|
+
show_default=True,
|
|
88
|
+
)
|
|
89
|
+
opt_s2_l2a_bands = click.option(
|
|
90
|
+
"--l2a-bands",
|
|
91
|
+
type=click.STRING,
|
|
92
|
+
callback=_str_to_l2a_bands,
|
|
93
|
+
help=f"List of L2A bands to be used. (Available bands: {','.join([band.name for band in L2ABand])})",
|
|
94
|
+
show_default=True,
|
|
95
|
+
default="B04,B03,B02",
|
|
96
|
+
)
|
|
97
|
+
opt_assets_rgb = click.option(
|
|
98
|
+
"--assets",
|
|
99
|
+
"-a",
|
|
100
|
+
type=click.STRING,
|
|
101
|
+
nargs=3,
|
|
102
|
+
default=["red", "green", "blue"],
|
|
103
|
+
show_default=True,
|
|
104
|
+
)
|
|
105
|
+
opt_resolution = click.option(
|
|
106
|
+
"--resolution",
|
|
107
|
+
type=click.Choice(list(Resolution.__members__.keys())),
|
|
108
|
+
default="original",
|
|
109
|
+
show_default=True,
|
|
110
|
+
callback=_str_to_resolution,
|
|
111
|
+
help="Resample assets to this resolution in meter.",
|
|
112
|
+
)
|
|
113
|
+
opt_rio_profile = click.option(
|
|
114
|
+
"--rio-profile",
|
|
115
|
+
type=click.Choice(list(rio_profiles.keys())),
|
|
116
|
+
default="cog_deflate",
|
|
117
|
+
callback=_str_to_rio_profile,
|
|
118
|
+
help="Available rasterio profiles for raster assets.",
|
|
119
|
+
)
|
|
120
|
+
opt_mask_footprint = click.option(
|
|
121
|
+
"--mask-footprint", is_flag=True, help="Mask by product footprint."
|
|
122
|
+
)
|
|
123
|
+
opt_mask_clouds = click.option("--mask-clouds", is_flag=True, help="Mask out clouds.")
|
|
124
|
+
opt_mask_snow_ice = click.option(
|
|
125
|
+
"--mask-snow-ice", is_flag=True, help="Mask out snow and ice."
|
|
126
|
+
)
|
|
127
|
+
opt_mask_cloud_probability_threshold = click.option(
|
|
128
|
+
"--mask-cloud-probability-threshold",
|
|
129
|
+
type=click.INT,
|
|
130
|
+
default=100,
|
|
131
|
+
help="Mask out pixels with cloud probability over value.",
|
|
132
|
+
show_default=True,
|
|
133
|
+
)
|
|
134
|
+
opt_mask_snow_probability_threshold = click.option(
|
|
135
|
+
"--mask-snow-probability-threshold",
|
|
136
|
+
type=click.INT,
|
|
137
|
+
default=100,
|
|
138
|
+
help="Mask out pixels with snow probability over value.",
|
|
139
|
+
show_default=True,
|
|
140
|
+
)
|
|
141
|
+
opt_mask_scl_classes = click.option(
|
|
142
|
+
"--mask-scl-classes",
|
|
143
|
+
type=click.STRING,
|
|
144
|
+
callback=_str_to_list,
|
|
145
|
+
help=f"Available classes: {', '.join([scene_class.name for scene_class in SceneClassification])}",
|
|
146
|
+
)
|
|
147
|
+
opt_brdf_model = click.option(
|
|
148
|
+
"--brdf-model",
|
|
149
|
+
type=click.Choice([model.name for model in BRDFModels]),
|
|
150
|
+
default=BRDFModels.HLS,
|
|
151
|
+
callback=_brdf_model_str_to_brdf,
|
|
152
|
+
show_default=True,
|
|
153
|
+
help="BRDF model.",
|
|
154
|
+
)
|
|
155
|
+
opt_brdf_weight = click.option(
|
|
156
|
+
"--brdf-weight",
|
|
157
|
+
type=click.FLOAT,
|
|
158
|
+
default=1.0,
|
|
159
|
+
show_default=True,
|
|
160
|
+
help="BRDF model weight.",
|
|
161
|
+
)
|
|
162
|
+
opt_mgrs_tile = click.option("--mgrs-tile", type=click.STRING)
|
|
163
|
+
opt_start_time = click.option(
|
|
164
|
+
"--start-time", type=click.STRING, callback=_str_to_datetime, help="Start time"
|
|
165
|
+
)
|
|
166
|
+
opt_end_time = click.option(
|
|
167
|
+
"--end-time", type=click.STRING, callback=_str_to_datetime, help="End time"
|
|
168
|
+
)
|
|
169
|
+
opt_source = click.option(
|
|
170
|
+
"--source",
|
|
171
|
+
type=click.STRING,
|
|
172
|
+
default="EarthSearch",
|
|
173
|
+
callback=_str_to_source,
|
|
174
|
+
help="Data source to be queried.",
|
|
175
|
+
)
|
|
176
|
+
opt_name = click.option("--name", type=click.STRING, help="Static catalog name.")
|
|
177
|
+
opt_description = click.option(
|
|
178
|
+
"--description", type=click.STRING, help="Static catalog description."
|
|
179
|
+
)
|
|
180
|
+
opt_assets = click.option(
|
|
181
|
+
"--assets",
|
|
182
|
+
type=click.STRING,
|
|
183
|
+
callback=_str_to_list,
|
|
184
|
+
help="STAC item assets.",
|
|
185
|
+
)
|
|
186
|
+
opt_assets_dst_resolution = click.option(
|
|
187
|
+
"--assets-dst-resolution",
|
|
188
|
+
type=click.Choice(list(Resolution.__members__.keys())),
|
|
189
|
+
default="original",
|
|
190
|
+
show_default=True,
|
|
191
|
+
callback=_str_to_resolution,
|
|
192
|
+
help="Resample assets to this resolution in meter.",
|
|
193
|
+
)
|
|
194
|
+
opt_assets_dst_rio_profile = click.option(
|
|
195
|
+
"--assets-dst-rio-profile",
|
|
196
|
+
type=click.Choice(list(rio_profiles.keys())),
|
|
197
|
+
default="cog_deflate",
|
|
198
|
+
callback=_str_to_rio_profile,
|
|
199
|
+
help="Available rasterio profiles for raster assets.",
|
|
200
|
+
)
|
|
201
|
+
opt_copy_metadata = click.option(
|
|
202
|
+
"--copy-metadata", is_flag=True, help="Download granule metadata and QI bands."
|
|
203
|
+
)
|
|
204
|
+
opt_overwrite = click.option(
|
|
205
|
+
"--overwrite", "-o", is_flag=True, help="Overwrite existing files."
|
|
206
|
+
)
|
|
207
|
+
opt_dump_detector_footprints = click.option(
|
|
208
|
+
"--dump-detector-footprints",
|
|
209
|
+
is_flag=True,
|
|
210
|
+
help="Also dump products detector footprints.",
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
opt_out_dtype = click.option(
|
|
214
|
+
"--out-dtype", default="uint8", help="Out dType string; default: uint8"
|
|
215
|
+
)
|
|
216
|
+
|
|
217
|
+
opt_brdf_log10 = click.option(
|
|
218
|
+
"--brdf-log10",
|
|
219
|
+
is_flag=True,
|
|
220
|
+
help="Flag to switch BRDF input band convertion to log10. Default: False",
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
opt_brdf_detector_iter = click.option(
|
|
224
|
+
"--brdf-detector-iter",
|
|
225
|
+
is_flag=True,
|
|
226
|
+
help="Switch to switch if the brdf correction should be iterated over the detector footprints or merge them prefering higher angle value. Default: False",
|
|
227
|
+
)
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
import click
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pystac
|
|
5
|
+
from mapchete.cli.options import opt_debug
|
|
6
|
+
from mapchete.io import rasterio_open
|
|
7
|
+
from mapchete.path import MPath
|
|
8
|
+
|
|
9
|
+
from mapchete_eo.cli import options_arguments
|
|
10
|
+
from mapchete_eo.io.profiles import COGDeflateProfile
|
|
11
|
+
from mapchete_eo.platforms.sentinel2.brdf.config import BRDFModels
|
|
12
|
+
from mapchete_eo.platforms.sentinel2.config import BRDFConfig
|
|
13
|
+
from mapchete_eo.platforms.sentinel2.product import S2Product
|
|
14
|
+
from mapchete_eo.platforms.sentinel2.metadata_parser.s2metadata import Resolution
|
|
15
|
+
from mapchete_eo.platforms.sentinel2.types import L2ABand
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@click.command()
|
|
19
|
+
@options_arguments.arg_stac_item
|
|
20
|
+
@options_arguments.opt_dst_path
|
|
21
|
+
@options_arguments.opt_s2_l2a_bands
|
|
22
|
+
@options_arguments.opt_resolution
|
|
23
|
+
@options_arguments.opt_brdf_model
|
|
24
|
+
@options_arguments.opt_dump_detector_footprints
|
|
25
|
+
@options_arguments.opt_brdf_detector_iter
|
|
26
|
+
@opt_debug
|
|
27
|
+
def s2_brdf(
|
|
28
|
+
stac_item: MPath,
|
|
29
|
+
dst_path: MPath,
|
|
30
|
+
l2a_bands: List[L2ABand] = [L2ABand.B04, L2ABand.B03, L2ABand.B02],
|
|
31
|
+
resolution: Resolution = Resolution["120m"],
|
|
32
|
+
brdf_model: BRDFModels = BRDFModels.HLS,
|
|
33
|
+
dump_detector_footprints=False,
|
|
34
|
+
brdf_detector_iter: bool = False,
|
|
35
|
+
**_,
|
|
36
|
+
):
|
|
37
|
+
"""Generate 8bit RGB image from Sentinel-2 product."""
|
|
38
|
+
item = pystac.Item.from_file(stac_item)
|
|
39
|
+
product = S2Product.from_stac_item(item)
|
|
40
|
+
if not resolution.value:
|
|
41
|
+
resolution = Resolution["10m"]
|
|
42
|
+
grid = product.metadata.grid(resolution)
|
|
43
|
+
click.echo(product)
|
|
44
|
+
for band in l2a_bands:
|
|
45
|
+
if dump_detector_footprints:
|
|
46
|
+
out_path = (
|
|
47
|
+
dst_path / stac_item.without_suffix().name
|
|
48
|
+
+ f"_footprints_{band.name}_{resolution}.tif"
|
|
49
|
+
)
|
|
50
|
+
click.echo(
|
|
51
|
+
f"write detector footprint for band {band.name} to {str(out_path)}"
|
|
52
|
+
)
|
|
53
|
+
product.metadata.detector_footprints(band, grid).to_file(out_path)
|
|
54
|
+
out_path = (
|
|
55
|
+
dst_path / stac_item.without_suffix().name
|
|
56
|
+
+ f"_brdf_{band.name}_{resolution}.tif"
|
|
57
|
+
)
|
|
58
|
+
click.echo(
|
|
59
|
+
f"write BRDF correction grid for band {band.name} to {str(out_path)}"
|
|
60
|
+
)
|
|
61
|
+
with rasterio_open(
|
|
62
|
+
out_path,
|
|
63
|
+
"w",
|
|
64
|
+
**COGDeflateProfile(grid.to_dict(), count=1, dtype=np.float32),
|
|
65
|
+
) as dst:
|
|
66
|
+
dst.write(
|
|
67
|
+
product.read_brdf_grid(
|
|
68
|
+
band,
|
|
69
|
+
grid=grid,
|
|
70
|
+
brdf_config=BRDFConfig(
|
|
71
|
+
model=brdf_model,
|
|
72
|
+
resolution=resolution,
|
|
73
|
+
per_detector_correction=brdf_detector_iter,
|
|
74
|
+
),
|
|
75
|
+
),
|
|
76
|
+
1,
|
|
77
|
+
)
|