openeo-gfmap 0.4.1__py3-none-any.whl → 0.4.3__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.
@@ -108,7 +108,6 @@ def _load_collection_hybrid(
108
108
  return cube
109
109
 
110
110
 
111
- # TODO; deprecated?
112
111
  def _load_collection(
113
112
  connection: openeo.Connection,
114
113
  bands: list,
@@ -145,16 +144,21 @@ def _load_collection(
145
144
  properties=load_collection_parameters,
146
145
  )
147
146
  elif fetch_type == FetchType.POINT:
148
- assert isinstance(
149
- spatial_extent, GeoJSON
150
- ), "Please provide only a GeoJSON FeatureCollection for point based fetching."
151
- assert (
152
- spatial_extent["type"] == "FeatureCollection"
153
- ), "Please provide a FeatureCollection type of GeoJSON"
147
+ if isinstance(spatial_extent, GeoJSON):
148
+ assert (
149
+ spatial_extent["type"] == "FeatureCollection"
150
+ ), "Please provide a FeatureCollection type of GeoJSON"
151
+ elif isinstance(spatial_extent, str):
152
+ assert spatial_extent.startswith("https://") or spatial_extent.startswith(
153
+ "http://"
154
+ ), "Please provide a valid URL or a path to a GeoJSON file."
155
+ else:
156
+ raise ValueError(
157
+ "Please provide a valid URL to a GeoParquet or GeoJSON file."
158
+ )
154
159
  cube = load_collection_method(
155
160
  connection=connection,
156
161
  bands=bands,
157
- spatial_extent=spatial_extent,
158
162
  temporal_extent=temporal_extent,
159
163
  properties=load_collection_parameters,
160
164
  )
@@ -41,3 +41,34 @@ def compress_backscatter_uint16(
41
41
 
42
42
  # Change the data type to uint16 for optimization purposes
43
43
  return cube.linear_scale_range(1, 65534, 1, 65534)
44
+
45
+
46
+ def decompress_backscatter_uint16(
47
+ backend_context: BackendContext, cube: openeo.DataCube
48
+ ) -> openeo.DataCube:
49
+ """
50
+ Decompresing the bands from uint16 to their original float32 values.
51
+
52
+ Parameters
53
+ ----------
54
+ backend_context : BackendContext
55
+ The backend context to fetch the backend name.
56
+ cube : openeo.DataCube
57
+ The datacube to decompress the backscatter values.
58
+ Returns
59
+ -------
60
+ openeo.DataCube
61
+ The datacube with the backscatter values in their original float32 values.
62
+ """
63
+
64
+ cube = cube.apply_dimension(
65
+ dimension="bands",
66
+ process=lambda x: array_create(
67
+ [
68
+ power(base=10, p=(20.0 * x[0].log(base=10) - 83.0) / 10.0),
69
+ power(base=10, p=(20.0 * x[1].log(base=10) - 83.0) / 10.0),
70
+ ]
71
+ ),
72
+ )
73
+
74
+ return cube
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openeo_gfmap
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: OpenEO General Framework for Mapping
5
5
  Project-URL: Homepage, https://github.com/Open-EO/openeo-gfmap
6
6
  Project-URL: Bug Tracker, https://github.com/Open-EO/openeo-gfmap/issues
@@ -29,6 +29,7 @@ Requires-Dist: pre-commit; extra == 'dev'
29
29
  Requires-Dist: pytest-depends; extra == 'dev'
30
30
  Requires-Dist: pytest-timeout>=2.2.0; extra == 'dev'
31
31
  Requires-Dist: pytest>=7.4.0; extra == 'dev'
32
+ Requires-Dist: requests-mock>=1.8.0; extra == 'dev'
32
33
  Requires-Dist: rioxarray>=0.13.0; extra == 'dev'
33
34
  Requires-Dist: xarray>=2022.3.0; extra == 'dev'
34
35
  Description-Content-Type: text/markdown
@@ -6,7 +6,7 @@ openeo_gfmap/temporal.py,sha256=qhKCgSoOc0CrscPTru-d7acaxsCVhftyYrb_8UVU1S4,583
6
6
  openeo_gfmap/features/__init__.py,sha256=UtQUPnglF9uURn9FqtegnazuE4_CgQP6a2Cdx1TOuZ0,419
7
7
  openeo_gfmap/features/feature_extractor.py,sha256=ApTCCbD1-S4VOOSEZh9i-Gqxso87xwe_z7CN35fP15A,14719
8
8
  openeo_gfmap/fetching/__init__.py,sha256=KFDwqKTwXUDhFqPqeaIg5uCL2xp7lXmNzcbAph-EU1c,938
9
- openeo_gfmap/fetching/commons.py,sha256=7kr34Lq3ZxKWQXJrtAHFJYkc93y6LHGfTe1jn7Adr64,7656
9
+ openeo_gfmap/fetching/commons.py,sha256=uug-BfbySbCPfQAoeBOLjDFt6nOiV41Tmat8VDvGuBo,7871
10
10
  openeo_gfmap/fetching/fetching.py,sha256=dHeOMzN6OPgD8YFfZtcCzEOwQqo47IeBgIdS2mrx3MY,3674
11
11
  openeo_gfmap/fetching/generic.py,sha256=ojSO52cnLsWpC6FAnLRoXxfQmTiC839DzFH8MAok2B8,5851
12
12
  openeo_gfmap/fetching/s1.py,sha256=Ek9Ek-GExyKdb-9Ijja6I-izOmVvPY2C9w9gyyGGjII,6360
@@ -20,7 +20,7 @@ openeo_gfmap/preprocessing/__init__.py,sha256=-kJAy_WY4o8oqziRozcUuXtuGIM0IOvTCF
20
20
  openeo_gfmap/preprocessing/cloudmasking.py,sha256=d280H5fByjNbCVZHjPn_dUatNI-ejphu4A75sUVoRqo,10029
21
21
  openeo_gfmap/preprocessing/compositing.py,sha256=Jp9Ku5JpU7TJ4DYGc6YuqMeP1Ip7zns7NguC17BtFyA,2526
22
22
  openeo_gfmap/preprocessing/interpolation.py,sha256=VVD483NoC0KYUSh28XaBNZzNaybQjdyCN8rXyXy2W9E,327
23
- openeo_gfmap/preprocessing/sar.py,sha256=XtOIlBrX3o2DlrGHBksHYWzOdzhkZMQT2rp5LxDbdMQ,1391
23
+ openeo_gfmap/preprocessing/sar.py,sha256=Qzn3zCh3cWr0Vm-IFOy2_DrGxgGuQLiMnZZQjj2LwaY,2257
24
24
  openeo_gfmap/preprocessing/scaling.py,sha256=oUNhykVC41Je3E_men_-PikAKNwYhYbwN9J1_Ru8Zi4,2121
25
25
  openeo_gfmap/preprocessing/udf_cldmask.py,sha256=WqqFLBK5rIQPkb_dlgUWWSzicsPtVSthaIef40FHKJA,1162
26
26
  openeo_gfmap/preprocessing/udf_rank.py,sha256=n2gSIY2ZHVVr9wJx1Bs2HtmvScAkz2NqhjxUM-iIKM0,1438
@@ -34,7 +34,7 @@ openeo_gfmap/utils/intervals.py,sha256=V6l3ofww50fN_pvWC4NuGQ2ZsyGdhAlTZTiRcC0fo
34
34
  openeo_gfmap/utils/netcdf.py,sha256=KkAAxnq-ZCMjDMd82638noYwxqNpMsnpiU04Q-qX26A,698
35
35
  openeo_gfmap/utils/split_stac.py,sha256=asjT0jx6ic8GJFqqAisaWxOvQ_suSRv4sxyFOyHFvpI,3895
36
36
  openeo_gfmap/utils/tile_processing.py,sha256=QZ9bi5tPmyTVyyNvFZgd26s5dSnMl1grTKq2veK1C90,2068
37
- openeo_gfmap-0.4.1.dist-info/METADATA,sha256=vGOWtETT4FZjDKLj2DV4hCZVOZbYDmeH6NB6VmqV0O0,4322
38
- openeo_gfmap-0.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
- openeo_gfmap-0.4.1.dist-info/licenses/LICENSE,sha256=aUuGpjieWiscTNtyLcSaeVsJ4pb6J9c4wUq1bR0e4t4,11349
40
- openeo_gfmap-0.4.1.dist-info/RECORD,,
37
+ openeo_gfmap-0.4.3.dist-info/METADATA,sha256=Lj7HiV-92WCJQTqlyZWZKyc8SNGvbFyzTDMyiWCK8FY,4374
38
+ openeo_gfmap-0.4.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
39
+ openeo_gfmap-0.4.3.dist-info/licenses/LICENSE,sha256=aUuGpjieWiscTNtyLcSaeVsJ4pb6J9c4wUq1bR0e4t4,11349
40
+ openeo_gfmap-0.4.3.dist-info/RECORD,,