opticallyshallowdeep 1.2.0__tar.gz → 1.2.1__tar.gz
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.
- {opticallyshallowdeep-1.2.0/opticallyshallowdeep.egg-info → opticallyshallowdeep-1.2.1}/PKG-INFO +12 -14
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/README.md +11 -13
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/process_as_strips.py +4 -2
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/run.py +5 -1
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1/opticallyshallowdeep.egg-info}/PKG-INFO +12 -14
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/setup.py +1 -1
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/LICENSE +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/MANIFEST.in +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/__init__.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/check_transpose.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/cloud_mask.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/find_epsg.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/make_multiband_image.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/make_vertical_strips.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/models/SR.h5 +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/models/TOA.h5 +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/netcdf_to_multiband_geotiff.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/parse_string.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/write_georef_image.py +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep.egg-info/SOURCES.txt +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep.egg-info/dependency_links.txt +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep.egg-info/requires.txt +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep.egg-info/top_level.txt +0 -0
- {opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/setup.cfg +0 -0
{opticallyshallowdeep-1.2.0/opticallyshallowdeep.egg-info → opticallyshallowdeep-1.2.1}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opticallyshallowdeep
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Identify optically shallow and deep waters in satellite imagery
|
|
5
5
|
Author: Yulun Wu
|
|
6
6
|
Author-email: yulunwu8@gmail.com
|
|
@@ -23,7 +23,7 @@ Requires-Dist: tensorflow
|
|
|
23
23
|
|
|
24
24
|
This python tool delineates optically shallow and deep waters in Sentinel-2 imagery. The tool uses a deep neural network (DNN) that was trained on a diverse set of global images.
|
|
25
25
|
|
|
26
|
-
Supported input includes L1C SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.
|
|
26
|
+
Supported input includes Level-1C (L1C) SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.
|
|
27
27
|
|
|
28
28
|
Originally coded by by Galen Richardson and Anders Knudby, modified and packaged by Yulun Wu
|
|
29
29
|
|
|
@@ -47,7 +47,6 @@ For mac OS:
|
|
|
47
47
|
```bash
|
|
48
48
|
conda install -c apple tensorflow-deps
|
|
49
49
|
python -m pip install tensorflow-macos
|
|
50
|
-
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
|
|
@@ -55,14 +54,6 @@ For windows:
|
|
|
55
54
|
|
|
56
55
|
```bash
|
|
57
56
|
pip3 install tensorflow==2.13.0
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
In case of compatibility issues, please try the newest version of tensorflow:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
pip3 install --upgrade --force-reinstall tensorflow
|
|
65
|
-
|
|
66
57
|
```
|
|
67
58
|
|
|
68
59
|
|
|
@@ -106,16 +97,23 @@ file_L2R = 'test_folder_in/L2R.nc'
|
|
|
106
97
|
folder_out = 'folder/test_folder_out'
|
|
107
98
|
|
|
108
99
|
# Run the OSW/ODW classifier
|
|
109
|
-
osd.run(
|
|
100
|
+
osd.run(file_L1C, folder_out, file_L2R=file_L2R)
|
|
110
101
|
```
|
|
111
102
|
|
|
112
|
-
The L1C file is always required as it contains a cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.
|
|
103
|
+
The L1C file is always required as it contains a built-in cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.
|
|
113
104
|
|
|
114
105
|
|
|
115
|
-
Output is a 1-band geotiff, with values of prediction probability of OSW
|
|
106
|
+
Output is a 1-band geotiff, with values of prediction probability of optically shallow water (OSW): 100 means most likely OSW, 0 means most likely optically deep water (ODW). Non-water pixels are masked. It is recommended to treat pixels between 0 and 40 as ODW, and pixels between 60 and 100 as OSW (publication in review).
|
|
116
107
|
|
|
117
108
|
A log file, an intermediate multi-band geotiff, and a preview PNG are also generated in the output folder. They can be deleted after the processing.
|
|
118
109
|
|
|
110
|
+
|
|
111
|
+
**Sample Sentinel-2 scene and output:**
|
|
112
|
+
|
|
113
|
+
<img src="images/TOA.jpeg" height="500">
|
|
114
|
+
|
|
115
|
+
<img src="images/OSW.jpeg" height="500">
|
|
116
|
+
|
|
119
117
|
## Training, test, and validation data
|
|
120
118
|
|
|
121
119
|
All annotated shapefiles used in training, testing, and validating the DNN model are in the annotated_shapefiles folder, grouped by Sentinel-2 Scene ID.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This python tool delineates optically shallow and deep waters in Sentinel-2 imagery. The tool uses a deep neural network (DNN) that was trained on a diverse set of global images.
|
|
4
4
|
|
|
5
|
-
Supported input includes L1C SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.
|
|
5
|
+
Supported input includes Level-1C (L1C) SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.
|
|
6
6
|
|
|
7
7
|
Originally coded by by Galen Richardson and Anders Knudby, modified and packaged by Yulun Wu
|
|
8
8
|
|
|
@@ -26,7 +26,6 @@ For mac OS:
|
|
|
26
26
|
```bash
|
|
27
27
|
conda install -c apple tensorflow-deps
|
|
28
28
|
python -m pip install tensorflow-macos
|
|
29
|
-
|
|
30
29
|
```
|
|
31
30
|
|
|
32
31
|
|
|
@@ -34,14 +33,6 @@ For windows:
|
|
|
34
33
|
|
|
35
34
|
```bash
|
|
36
35
|
pip3 install tensorflow==2.13.0
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
In case of compatibility issues, please try the newest version of tensorflow:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
pip3 install --upgrade --force-reinstall tensorflow
|
|
44
|
-
|
|
45
36
|
```
|
|
46
37
|
|
|
47
38
|
|
|
@@ -85,16 +76,23 @@ file_L2R = 'test_folder_in/L2R.nc'
|
|
|
85
76
|
folder_out = 'folder/test_folder_out'
|
|
86
77
|
|
|
87
78
|
# Run the OSW/ODW classifier
|
|
88
|
-
osd.run(
|
|
79
|
+
osd.run(file_L1C, folder_out, file_L2R=file_L2R)
|
|
89
80
|
```
|
|
90
81
|
|
|
91
|
-
The L1C file is always required as it contains a cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.
|
|
82
|
+
The L1C file is always required as it contains a built-in cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.
|
|
92
83
|
|
|
93
84
|
|
|
94
|
-
Output is a 1-band geotiff, with values of prediction probability of OSW
|
|
85
|
+
Output is a 1-band geotiff, with values of prediction probability of optically shallow water (OSW): 100 means most likely OSW, 0 means most likely optically deep water (ODW). Non-water pixels are masked. It is recommended to treat pixels between 0 and 40 as ODW, and pixels between 60 and 100 as OSW (publication in review).
|
|
95
86
|
|
|
96
87
|
A log file, an intermediate multi-band geotiff, and a preview PNG are also generated in the output folder. They can be deleted after the processing.
|
|
97
88
|
|
|
89
|
+
|
|
90
|
+
**Sample Sentinel-2 scene and output:**
|
|
91
|
+
|
|
92
|
+
<img src="images/TOA.jpeg" height="500">
|
|
93
|
+
|
|
94
|
+
<img src="images/OSW.jpeg" height="500">
|
|
95
|
+
|
|
98
96
|
## Training, test, and validation data
|
|
99
97
|
|
|
100
98
|
All annotated shapefiles used in training, testing, and validating the DNN model are in the annotated_shapefiles folder, grouped by Sentinel-2 Scene ID.
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/process_as_strips.py
RENAMED
|
@@ -179,13 +179,15 @@ def process_image_with_filters(img, selected_columns):
|
|
|
179
179
|
for band, kernel_size, filter_type in filter_list:
|
|
180
180
|
|
|
181
181
|
if filter_type is None:
|
|
182
|
-
filtered_band = img[:, :, band]
|
|
182
|
+
filtered_band = img[:, :, band]
|
|
183
183
|
else:
|
|
184
184
|
with warnings.catch_warnings():
|
|
185
185
|
warnings.simplefilter("ignore", category=RuntimeWarning)
|
|
186
186
|
filtered_band = apply_filter(img[:, :, band].astype(np.float32), kernel_size, filter_type)
|
|
187
187
|
filtered_band[filtered_band==-32768] = 32768
|
|
188
|
-
|
|
188
|
+
|
|
189
|
+
filtered_band[filtered_band<0] = 0
|
|
190
|
+
filtered_band = filtered_band.astype(np.uint16)#this means it is a single pixel
|
|
189
191
|
|
|
190
192
|
output_bands.append(filtered_band)#append to list of filters
|
|
191
193
|
del filtered_band
|
|
@@ -32,7 +32,11 @@ def run(file_L1C, folder_out, file_L2R = None, to_log=True):
|
|
|
32
32
|
# Start logging in txt file
|
|
33
33
|
orig_stdout = sys.stdout
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
if file_L2R is None:
|
|
36
|
+
log_base = os.path.basename(file_L1C).replace('.safe','.txt').replace('.SAFE','.txt')
|
|
37
|
+
else:
|
|
38
|
+
log_base = os.path.basename(file_L2R).replace('.nc','.txt')
|
|
39
|
+
|
|
36
40
|
log_base = 'OSD_log_'+ log_base
|
|
37
41
|
log_file = os.path.join(folder_out,log_base)
|
|
38
42
|
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1/opticallyshallowdeep.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: opticallyshallowdeep
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.1
|
|
4
4
|
Summary: Identify optically shallow and deep waters in satellite imagery
|
|
5
5
|
Author: Yulun Wu
|
|
6
6
|
Author-email: yulunwu8@gmail.com
|
|
@@ -23,7 +23,7 @@ Requires-Dist: tensorflow
|
|
|
23
23
|
|
|
24
24
|
This python tool delineates optically shallow and deep waters in Sentinel-2 imagery. The tool uses a deep neural network (DNN) that was trained on a diverse set of global images.
|
|
25
25
|
|
|
26
|
-
Supported input includes L1C SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.
|
|
26
|
+
Supported input includes Level-1C (L1C) SAFE files and ACOLITE-processed L2R netCDF files. The output geotiff contains probabilities of water pixels being optically shallow and deep.
|
|
27
27
|
|
|
28
28
|
Originally coded by by Galen Richardson and Anders Knudby, modified and packaged by Yulun Wu
|
|
29
29
|
|
|
@@ -47,7 +47,6 @@ For mac OS:
|
|
|
47
47
|
```bash
|
|
48
48
|
conda install -c apple tensorflow-deps
|
|
49
49
|
python -m pip install tensorflow-macos
|
|
50
|
-
|
|
51
50
|
```
|
|
52
51
|
|
|
53
52
|
|
|
@@ -55,14 +54,6 @@ For windows:
|
|
|
55
54
|
|
|
56
55
|
```bash
|
|
57
56
|
pip3 install tensorflow==2.13.0
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
In case of compatibility issues, please try the newest version of tensorflow:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
pip3 install --upgrade --force-reinstall tensorflow
|
|
65
|
-
|
|
66
57
|
```
|
|
67
58
|
|
|
68
59
|
|
|
@@ -106,16 +97,23 @@ file_L2R = 'test_folder_in/L2R.nc'
|
|
|
106
97
|
folder_out = 'folder/test_folder_out'
|
|
107
98
|
|
|
108
99
|
# Run the OSW/ODW classifier
|
|
109
|
-
osd.run(
|
|
100
|
+
osd.run(file_L1C, folder_out, file_L2R=file_L2R)
|
|
110
101
|
```
|
|
111
102
|
|
|
112
|
-
The L1C file is always required as it contains a cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.
|
|
103
|
+
The L1C file is always required as it contains a built-in cloud mask. Pixels within 8 pixels of the cloud mask are masked to reduce the impact of clouds.
|
|
113
104
|
|
|
114
105
|
|
|
115
|
-
Output is a 1-band geotiff, with values of prediction probability of OSW
|
|
106
|
+
Output is a 1-band geotiff, with values of prediction probability of optically shallow water (OSW): 100 means most likely OSW, 0 means most likely optically deep water (ODW). Non-water pixels are masked. It is recommended to treat pixels between 0 and 40 as ODW, and pixels between 60 and 100 as OSW (publication in review).
|
|
116
107
|
|
|
117
108
|
A log file, an intermediate multi-band geotiff, and a preview PNG are also generated in the output folder. They can be deleted after the processing.
|
|
118
109
|
|
|
110
|
+
|
|
111
|
+
**Sample Sentinel-2 scene and output:**
|
|
112
|
+
|
|
113
|
+
<img src="images/TOA.jpeg" height="500">
|
|
114
|
+
|
|
115
|
+
<img src="images/OSW.jpeg" height="500">
|
|
116
|
+
|
|
119
117
|
## Training, test, and validation data
|
|
120
118
|
|
|
121
119
|
All annotated shapefiles used in training, testing, and validating the DNN model are in the annotated_shapefiles folder, grouped by Sentinel-2 Scene ID.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/check_transpose.py
RENAMED
|
File without changes
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/cloud_mask.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/models/TOA.h5
RENAMED
|
File without changes
|
|
File without changes
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/parse_string.py
RENAMED
|
File without changes
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep/write_georef_image.py
RENAMED
|
File without changes
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{opticallyshallowdeep-1.2.0 → opticallyshallowdeep-1.2.1}/opticallyshallowdeep.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|