satcube 0.1.11__py3-none-any.whl → 0.1.13__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.
Potentially problematic release.
This version of satcube might be problematic. Click here for more details.
- satcube/cloud_detection.py +21 -3
- {satcube-0.1.11.dist-info → satcube-0.1.13.dist-info}/METADATA +2 -2
- {satcube-0.1.11.dist-info → satcube-0.1.13.dist-info}/RECORD +5 -5
- {satcube-0.1.11.dist-info → satcube-0.1.13.dist-info}/LICENSE +0 -0
- {satcube-0.1.11.dist-info → satcube-0.1.13.dist-info}/WHEEL +0 -0
satcube/cloud_detection.py
CHANGED
|
@@ -22,8 +22,16 @@ import rasterio as rio
|
|
|
22
22
|
import torch
|
|
23
23
|
|
|
24
24
|
from satcube.utils import DeviceManager, _reset_gpu
|
|
25
|
+
import warnings, re
|
|
25
26
|
|
|
26
27
|
|
|
28
|
+
warnings.filterwarnings(
|
|
29
|
+
"ignore",
|
|
30
|
+
message=re.escape("The secret `HF_TOKEN` does not exist in your Colab secrets."),
|
|
31
|
+
category=UserWarning,
|
|
32
|
+
module="huggingface_hub.utils._auth",
|
|
33
|
+
)
|
|
34
|
+
|
|
27
35
|
def cloud_masking(
|
|
28
36
|
input: str | Path, # noqa: A002 (shadowing built-in is OK here)
|
|
29
37
|
output: str | Path,
|
|
@@ -32,7 +40,7 @@ def cloud_masking(
|
|
|
32
40
|
pad: int = 64,
|
|
33
41
|
save_mask: bool = False,
|
|
34
42
|
device: str = "cpu",
|
|
35
|
-
max_pix_cpu: float = 7.0e7
|
|
43
|
+
max_pix_cpu: float = 7.0e7
|
|
36
44
|
) -> List[Path]:
|
|
37
45
|
"""Write cloud-masked Sentinel-2 images.
|
|
38
46
|
|
|
@@ -52,7 +60,7 @@ def cloud_masking(
|
|
|
52
60
|
Tile images larger than this when running on CPU.
|
|
53
61
|
|
|
54
62
|
Returns
|
|
55
|
-
|
|
63
|
+
------
|
|
56
64
|
list[pathlib.Path]
|
|
57
65
|
Paths to the generated masked images.
|
|
58
66
|
"""
|
|
@@ -75,8 +83,18 @@ def cloud_masking(
|
|
|
75
83
|
if not tif_paths:
|
|
76
84
|
print(f"[cloud_masking] No .tif files found in {src}")
|
|
77
85
|
return []
|
|
86
|
+
|
|
87
|
+
dir = Path("SEN2CloudEnsemble")
|
|
88
|
+
|
|
89
|
+
if not dir.exists():
|
|
90
|
+
|
|
91
|
+
mlstac.download(
|
|
92
|
+
file = "https://huggingface.co/tacofoundation/CloudSEN12-models/resolve/main/SEN2CloudEnsemble/mlm.json",
|
|
93
|
+
output_dir = "SEN2CloudEnsemble",
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
experiment = mlstac.load(dir.as_posix())
|
|
78
97
|
|
|
79
|
-
experiment = mlstac.load("SEN2CloudEnsemble")
|
|
80
98
|
dm = DeviceManager(experiment, init_device=device)
|
|
81
99
|
|
|
82
100
|
masked_paths: list[Path] = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: satcube
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.13
|
|
4
4
|
Summary: A Python package to create cloud-free monthly composites by fusing Landsat and Sentinel-2 data.
|
|
5
5
|
Home-page: https://github.com/IPL-UV/satcube
|
|
6
6
|
Author: Cesar Aybar
|
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Provides-Extra: full
|
|
14
|
-
Requires-Dist: cubexpress (>=0.1.
|
|
14
|
+
Requires-Dist: cubexpress (>=0.1.7)
|
|
15
15
|
Requires-Dist: earthengine-api (>=1.5.12)
|
|
16
16
|
Requires-Dist: mlstac (>=0.4.0)
|
|
17
17
|
Requires-Dist: numpy (>=1.25.0)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
satcube/__init__.py,sha256=WxfiBldO7YXWJFATRjbhWLOnD1mk0b8Pc6HGQYOJZJA,221
|
|
2
|
-
satcube/cloud_detection.py,sha256=
|
|
2
|
+
satcube/cloud_detection.py,sha256=nSDwBd4oboPy5JKsbI9hUD2cYrIi2RQd27esl_eHvBs,6325
|
|
3
3
|
satcube/cloud_detection_old.py,sha256=7MviF8QlT2tj6QC3seepr8SZU0nHOK9Pji8AU94Z2q0,751
|
|
4
4
|
satcube/dataclass.py,sha256=TAAKouyTts5eMtVXRmwWgJb5EaUXryEtkKMtt1O8TKM,934
|
|
5
5
|
satcube/download.py,sha256=xwPIm6SWN_cev2wM0OzqN18ejPgnjuNVPxfeF7FhI9c,1397
|
|
@@ -7,7 +7,7 @@ satcube/download_old.py,sha256=Y7dUgq7Gl7jVKHZl5x9cpxALN9T6dCjtZwNjBiq1CAA,2647
|
|
|
7
7
|
satcube/main.py,sha256=BpQJbPXl6Ydj6X3pX2lFepH7w1-cfJ3LeTTsTmQih6s,14841
|
|
8
8
|
satcube/utils.py,sha256=wQl4ZSrocSZSSU6hjwCA2CYIv8p3deiX8PUKxJRr3yc,1952
|
|
9
9
|
satcube/utils_old.py,sha256=UBCI2oaL7E5MEjebobnyqGqgOtK6jU9O3t-c58JqZ0k,35057
|
|
10
|
-
satcube-0.1.
|
|
11
|
-
satcube-0.1.
|
|
12
|
-
satcube-0.1.
|
|
13
|
-
satcube-0.1.
|
|
10
|
+
satcube-0.1.13.dist-info/LICENSE,sha256=YdB4BQMkMzWuKvXRIpQR4g91IQ_pwA5PSH2lNM97zFI,1070
|
|
11
|
+
satcube-0.1.13.dist-info/METADATA,sha256=4HgT2yGq_gX8ky_inhlCZsWyylFDJS3B71wH5HZXT-0,6686
|
|
12
|
+
satcube-0.1.13.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
13
|
+
satcube-0.1.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|