RadGEEToolbox 1.6.2__tar.gz → 1.6.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RadGEEToolbox
3
- Version: 1.6.2
3
+ Version: 1.6.4
4
4
  Summary: Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API
5
5
  Home-page: https://github.com/radwinskis/RadGEEToolbox
6
6
  Author: Mark Radwin
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Topic :: Scientific/Engineering :: GIS
17
17
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
18
18
  Classifier: Operating System :: OS Independent
19
- Requires-Python: >=3.6
19
+ Requires-Python: >=3.8
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE.txt
22
22
  Requires-Dist: earthengine-api
@@ -31,7 +31,7 @@ Dynamic: requires-python
31
31
 
32
32
  # RadGEEToolbox 🛠
33
33
 
34
- ![](image-1.png)
34
+ ![](ReadMeCover.png)
35
35
 
36
36
  ### 🌎 Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API
37
37
 
@@ -41,6 +41,69 @@ Dynamic: requires-python
41
41
 
42
42
  Designed for both new and advanced users of Google Earth Engine, RadGEEToolbox minimizes repetitive scripting, accelerates common remote sensing workflows, and aims to maximize efficiency within the constraints of the Google Earth Engine API. Whether you’re building a time series of vegetation indices or extracting surface properties along transects, this package helps get results faster.
43
43
 
44
+ _________
45
+ ## Getting Started with Google Earth Engine
46
+
47
+ **RadGEEToolbox requires [access](https://developers.google.com/earth-engine/guides/access) to [Google Earth Engine (GEE)](https://earthengine.google.com/) and proper [authentication](https://developers.google.com/earth-engine/guides/auth) with the Python API.**
48
+
49
+ For more details, see the official [Google Earth Engine Python API Getting Started Guide](https://developers.google.com/earth-engine/guides/quickstart_python) or [Python Installation Guide](https://developers.google.com/earth-engine/guides/python_install).
50
+
51
+
52
+ ### 1. Sign Up for Earth Engine
53
+ Apply for access here: [https://earthengine.google.com/signup/](https://earthengine.google.com/signup/) using a Google account. Approval typically takes a few days.
54
+
55
+ ### 2. Install the Earth Engine Python API
56
+ **The Earth Engine API is installed automatically when you install `RadGEEToolbox`.** However, if you would like to install manually:
57
+
58
+ ```bash
59
+ pip install earthengine-api
60
+ ```
61
+
62
+ ### 3. Authenticate & Initialize
63
+ Prior to using the Earth Engine Python client library, you need to authenticate and use the resultant credentials to initialize the Python client. The authentication flows use Cloud Projects to authenticate, and they're used for unpaid (free, noncommercial) use as well as paid use.
64
+
65
+
66
+ **Run the following during your first use:**
67
+ ```python
68
+ import ee
69
+ ee.Authenticate()
70
+ ```
71
+ ***NOTE: Your GEE credentials will not permanantly be stored on your PC and you will periodically need to re-run `ee.Authenticate()` when `ee.Initialize()` returns an authentication error.***
72
+
73
+ `ee.Autheticate()` will select the best authentication mode for your environment, and prompt you to confirm access for your scripts. To initialize, you will need to provide a project that you own, or have permissions to use. This project will be used for running all Earth Engine operations:
74
+
75
+ ```python
76
+ ee.Initialize(project='my-project')
77
+ ```
78
+ Replacing 'my-project' with the name of the Google Cloud Project you created on sign-up or any Google Cloud Project that has the GEE API enabled.
79
+
80
+ ### 4. Authentication Best Practices
81
+ It is reccomended to use the following authentication procedure once you have completed your initial authentication:
82
+ ```python
83
+ import ee
84
+
85
+ try:
86
+ ee.Initialize()
87
+ except Exception as e:
88
+ ee.Authenticate()
89
+ ee.Initialize()
90
+ ```
91
+
92
+ ### 5. Troubleshooting
93
+ `AttributeError: module 'ee' has no attribute 'Initialize'`
94
+
95
+ ➤ Ensure that earthengine-api is installed properly.
96
+
97
+ `403 Access Denied`
98
+
99
+ ➤ Your GEE account might not be approved, or the API is not enabled for your project.
100
+
101
+ `Initialization fails`
102
+
103
+ ➤ Try using `ee.Initialize(project='your-project-id')` explicitly in case you are just calling `ee.Initialize()`
104
+
105
+ See the official [GEE documentation for authentication »](https://developers.google.com/earth-engine/guides/auth)
106
+
44
107
  _________
45
108
 
46
109
  ## Key Features
@@ -67,15 +130,15 @@ _____________
67
130
 
68
131
  ### Installing via pip
69
132
 
70
- To install `RadGEEToolbox` version 1.6.2 using pip (NOTE: it is recommended to create a new virtual environment):
133
+ To install `RadGEEToolbox` version 1.6.4 using pip (NOTE: it is recommended to create a new virtual environment):
71
134
 
72
135
  ```bash
73
- pip install RadGEEToolbox==1.6.2
136
+ pip install RadGEEToolbox==1.6.4
74
137
  ```
75
138
 
76
139
  ### Installing via Conda
77
140
 
78
- To install `RadGEEToolbox` version 1.6.2 using conda-forge (NOTE: it is recommended to create a new virtual environment):
141
+ To install `RadGEEToolbox` version 1.6.4 using conda-forge (NOTE: it is recommended to create a new virtual environment):
79
142
 
80
143
  ```bash
81
144
  conda install conda-forge::radgeetoolbox
@@ -106,8 +169,32 @@ To verify that `RadGEEToolbox` was installed correctly:
106
169
  python -c "import RadGEEToolbox; print(RadGEEToolbox.__version__)"
107
170
  ```
108
171
 
109
- You should see `1.6.2` printed as the version number.
172
+ You should see `1.6.4` printed as the version number.
173
+
174
+ ### Want to Visualize Data? Install These Too
175
+
176
+ The core functionality of this package is focused on the processing of geospatial and remote sensing data using Google Earth Engine. It does **not** include interactive mapping functionality by default.
110
177
 
178
+ **If you wish to view GEE data on interactive maps (e.g., following along with the mapping portions of the [example notebooks](https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks)), you will need to install the [optional `geemap` package](https://geemap.org) in the environment that `RadGEEToolbox` is installed:**
179
+
180
+ ```python
181
+ pip install geemap
182
+ ```
183
+ or
184
+
185
+ ```bash
186
+ conda install conda-forge::geemap
187
+ ```
188
+ **If you plan to use `geemap` in a Jupyter Notebook, you will also need to install `ipykernel`:**
189
+
190
+ ```python
191
+ pip install ipykernel
192
+ ```
193
+ or
194
+
195
+ ```bash
196
+ conda install anaconda::ipykernel
197
+ ```
111
198
  ________
112
199
  # Usage Example
113
200
 
@@ -122,7 +209,7 @@ from RadGEEToolbox import LandsatCollection
122
209
 
123
210
  # 2. Authenticate & Initialize GEE API
124
211
  ee.Authenticate()
125
- ee.Initialize()
212
+ ee.Initialize(project='my-cloud-project-ID) #replace with your Google Cloud project ID
126
213
 
127
214
  # 3. Define study area boundary - in this case Lake Powell, Utah
128
215
  study_area = ee.Geometry.Polygon(
@@ -145,6 +232,9 @@ collection = LandsatCollection(
145
232
  dates = collection.dates
146
233
  print(dates)
147
234
  ```
235
+ ```
236
+ ['2020-01-13', '2020-02-14', '2020-05-04', '2020-05-20', '2020-07-07', '2020-08-08', '2020-08-24', '2020-09-25', '2020-10-11', '2020-10-27', '2020-11-28', '2020-12-30', '2021-01-15', '2021-01-31', '2021-04-05', '2021-05-07', '2021-06-08', '2021-07-10', '2021-08-27', '2021-10-30', '2021-11-10', '2021-11-10', '2021-12-01', '2021-12-17', '2022-01-02', '2022-01-10', '2022-01-26', '2022-02-11', '2022-02-19', '2022-02-27', '2022-03-23', '2022-04-08', '2022-05-02', '2022-05-18', '2022-05-26', '2022-06-11', '2022-06-27', '2022-07-13', '2022-08-06', '2022-08-22', '2022-08-30', '2022-09-07', '2022-09-23', '2022-10-01', '2022-10-09', '2022-10-17', '2022-10-25', '2022-11-10', '2023-01-21', '2023-03-18', '2023-04-11', '2023-06-22', '2023-06-30', '2023-07-08', '2023-07-16', '2023-09-18', '2023-09-26', '2023-10-04', '2023-10-20', '2023-11-13', '2023-11-21', '2023-12-07', '2023-12-15', '2023-12-31', '2024-01-16', '2024-03-20', '2024-04-13', '2024-04-21', '2024-05-07', '2024-05-23', '2024-06-08', '2024-06-16', '2024-07-02', '2024-07-10', '2024-07-26', '2024-08-19', '2024-08-27', '2024-09-04', '2024-09-12', '2024-09-20', '2024-09-28', '2024-10-06', '2024-10-22', '2024-10-30', '2024-11-07', '2024-11-15', '2024-12-01']
237
+ ```
148
238
  ### 2. Apply a Cloud Mask and Compute NDWI
149
239
  ```python
150
240
  # 1. Mask clouds
@@ -156,15 +246,16 @@ water_classification_maps = cloud_masked_collection.ndwi_collection(
156
246
  threshold=0
157
247
  )
158
248
  ```
159
- ![Visualization of true color and classified water (in blue) from one of the dates in the collection](image-3.png)
160
249
 
161
- Visualization of true color and classified water (in blue) from one of the dates in the collection
250
+ ![Visualization of true color and classified water (in blue) from one of the dates in the collection](LakePowellNDWI.png)
251
+
252
+ ***Visualization of true color and classified water (in blue) from one of the dates in the collection. To see the code used to display this image, please view [this Example Notebook](https://github.com/radwinskis/RadGEEToolbox/blob/main/Example%20Notebooks/Complete_ReadMe_Example.ipynb)***
162
253
 
163
254
  ### 3. Calculate Water Area Time Series
164
255
  ```python
165
256
  calculate_water_area = cloud_masked_NDWI_collection.PixelAreaSumCollection(
166
257
  band_name='ndwi', #specify band to use from collection
167
- geometry=study_area), #ee.Geometry() of your study area
258
+ geometry=study_area, #ee.Geometry() of your study area
168
259
  threshold=0, #binary classification threshold for unclassified rasters,
169
260
  scale=90 #pixel size for zonal statistics
170
261
  )
@@ -172,9 +263,9 @@ water_area_time_series = calculate_water_area.aggregate_array('ndwi').getInfo()
172
263
  print('List of square meters of water in images:', water_area_time_series)
173
264
  ```
174
265
 
175
- ![Plotted Results from Above Example - All Processed in Less Than 5 Seconds!](image-4.png)
266
+ ![Plotted Results from Above Example - All Processed in Less Than 5 Seconds!](LakePowellPlot.png)
176
267
 
177
- Plotted Results from Above Example - All Processed in Less Than 5 Seconds!
268
+ ***To see the code used to display this plot, please view [this Example Notebook](https://github.com/radwinskis/RadGEEToolbox/blob/main/Example%20Notebooks/Complete_ReadMe_Example.ipynb)***
178
269
 
179
270
  For details about Sentinel-1 SAR and Sentinel-2 MSI modules, and all other available Landsat or cross-module functions, please refer to the [RadGEEToolbox documentation](https://radgeetoolbox.readthedocs.io/en/latest/). You can also explore [`/Example Notebooks`](https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks) for more usage examples.
180
271
 
@@ -0,0 +1,256 @@
1
+ [![PyPI version](https://badge.fury.io/py/RadGEEToolbox.svg)](https://pypi.org/project/RadGEEToolbox/)
2
+
3
+ # RadGEEToolbox 🛠
4
+
5
+ ![](ReadMeCover.png)
6
+
7
+ ### 🌎 Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API
8
+
9
+ ### [See documentation here](https://radgeetoolbox.readthedocs.io/en/latest/)
10
+
11
+ **RadGEEToolbox** is an open-source Python package that simplifies the processing and analysis of satellite imagery using the Google Earth Engine Python API. It provides ready-to-use tools for filtering, masking, mosaicking, spectral index calculations, and extracting statistics from multispectral (Landsat, Sentinel-2) and SAR (Sentinel-1) datasets.
12
+
13
+ Designed for both new and advanced users of Google Earth Engine, RadGEEToolbox minimizes repetitive scripting, accelerates common remote sensing workflows, and aims to maximize efficiency within the constraints of the Google Earth Engine API. Whether you’re building a time series of vegetation indices or extracting surface properties along transects, this package helps get results faster.
14
+
15
+ _________
16
+ ## Getting Started with Google Earth Engine
17
+
18
+ **RadGEEToolbox requires [access](https://developers.google.com/earth-engine/guides/access) to [Google Earth Engine (GEE)](https://earthengine.google.com/) and proper [authentication](https://developers.google.com/earth-engine/guides/auth) with the Python API.**
19
+
20
+ For more details, see the official [Google Earth Engine Python API Getting Started Guide](https://developers.google.com/earth-engine/guides/quickstart_python) or [Python Installation Guide](https://developers.google.com/earth-engine/guides/python_install).
21
+
22
+
23
+ ### 1. Sign Up for Earth Engine
24
+ Apply for access here: [https://earthengine.google.com/signup/](https://earthengine.google.com/signup/) using a Google account. Approval typically takes a few days.
25
+
26
+ ### 2. Install the Earth Engine Python API
27
+ **The Earth Engine API is installed automatically when you install `RadGEEToolbox`.** However, if you would like to install manually:
28
+
29
+ ```bash
30
+ pip install earthengine-api
31
+ ```
32
+
33
+ ### 3. Authenticate & Initialize
34
+ Prior to using the Earth Engine Python client library, you need to authenticate and use the resultant credentials to initialize the Python client. The authentication flows use Cloud Projects to authenticate, and they're used for unpaid (free, noncommercial) use as well as paid use.
35
+
36
+
37
+ **Run the following during your first use:**
38
+ ```python
39
+ import ee
40
+ ee.Authenticate()
41
+ ```
42
+ ***NOTE: Your GEE credentials will not permanantly be stored on your PC and you will periodically need to re-run `ee.Authenticate()` when `ee.Initialize()` returns an authentication error.***
43
+
44
+ `ee.Autheticate()` will select the best authentication mode for your environment, and prompt you to confirm access for your scripts. To initialize, you will need to provide a project that you own, or have permissions to use. This project will be used for running all Earth Engine operations:
45
+
46
+ ```python
47
+ ee.Initialize(project='my-project')
48
+ ```
49
+ Replacing 'my-project' with the name of the Google Cloud Project you created on sign-up or any Google Cloud Project that has the GEE API enabled.
50
+
51
+ ### 4. Authentication Best Practices
52
+ It is reccomended to use the following authentication procedure once you have completed your initial authentication:
53
+ ```python
54
+ import ee
55
+
56
+ try:
57
+ ee.Initialize()
58
+ except Exception as e:
59
+ ee.Authenticate()
60
+ ee.Initialize()
61
+ ```
62
+
63
+ ### 5. Troubleshooting
64
+ `AttributeError: module 'ee' has no attribute 'Initialize'`
65
+
66
+ ➤ Ensure that earthengine-api is installed properly.
67
+
68
+ `403 Access Denied`
69
+
70
+ ➤ Your GEE account might not be approved, or the API is not enabled for your project.
71
+
72
+ `Initialization fails`
73
+
74
+ ➤ Try using `ee.Initialize(project='your-project-id')` explicitly in case you are just calling `ee.Initialize()`
75
+
76
+ See the official [GEE documentation for authentication »](https://developers.google.com/earth-engine/guides/auth)
77
+
78
+ _________
79
+
80
+ ## Key Features
81
+
82
+ - Modular tools for processing **Landsat, Sentinel-1 SAR, and Sentinel-2** imagery
83
+ - Efficient filtering, masking, and mosaicking of Earth Engine image collections
84
+ - Built-in support for computing **spectral indices** (NDWI, NDVI, LST, turbidity, chlorophyll, etc.)
85
+ - SAR utilities for **multilooking**, **speckle filtering**, and **backscatter conversion**
86
+ - Automated extraction of **transect and zonal statistics** across image collections
87
+ - Easy conversion between RadGEEToolbox and standard Earth Engine objects
88
+ - Server-side–friendly workflows and caching for faster, scalable processing
89
+
90
+ 🔍 For a full breakdown of available tools, see the [RadGEEToolbox documentation »](https://radgeetoolbox.readthedocs.io/en/latest/)
91
+
92
+ _____________
93
+
94
+ ## Installation Instructions
95
+
96
+ ### Prerequisites
97
+
98
+ - **Python**: Ensure you have version 3.6 or higher installed.
99
+ - **pip**: This is Python's package installer.
100
+ - **conda-forge**: Community led Conda package installer channel
101
+
102
+ ### Installing via pip
103
+
104
+ To install `RadGEEToolbox` version 1.6.4 using pip (NOTE: it is recommended to create a new virtual environment):
105
+
106
+ ```bash
107
+ pip install RadGEEToolbox==1.6.4
108
+ ```
109
+
110
+ ### Installing via Conda
111
+
112
+ To install `RadGEEToolbox` version 1.6.4 using conda-forge (NOTE: it is recommended to create a new virtual environment):
113
+
114
+ ```bash
115
+ conda install conda-forge::radgeetoolbox
116
+ ```
117
+
118
+ ### Manual Installation from Source
119
+
120
+ 1. **Clone the Repository**:
121
+ ```bash
122
+ git clone https://github.com/radwinskis/RadGEEToolbox.git
123
+ ```
124
+
125
+ 2. **Navigate to Directory**:
126
+ ```bash
127
+ cd RadGEEToolbox
128
+ ```
129
+
130
+ 3. **Install the Package**:
131
+ ```bash
132
+ pip install .
133
+ ```
134
+
135
+ ### ✅ Verifying the Installation
136
+
137
+ To verify that `RadGEEToolbox` was installed correctly:
138
+
139
+ ```python
140
+ python -c "import RadGEEToolbox; print(RadGEEToolbox.__version__)"
141
+ ```
142
+
143
+ You should see `1.6.4` printed as the version number.
144
+
145
+ ### Want to Visualize Data? Install These Too
146
+
147
+ The core functionality of this package is focused on the processing of geospatial and remote sensing data using Google Earth Engine. It does **not** include interactive mapping functionality by default.
148
+
149
+ **If you wish to view GEE data on interactive maps (e.g., following along with the mapping portions of the [example notebooks](https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks)), you will need to install the [optional `geemap` package](https://geemap.org) in the environment that `RadGEEToolbox` is installed:**
150
+
151
+ ```python
152
+ pip install geemap
153
+ ```
154
+ or
155
+
156
+ ```bash
157
+ conda install conda-forge::geemap
158
+ ```
159
+ **If you plan to use `geemap` in a Jupyter Notebook, you will also need to install `ipykernel`:**
160
+
161
+ ```python
162
+ pip install ipykernel
163
+ ```
164
+ or
165
+
166
+ ```bash
167
+ conda install anaconda::ipykernel
168
+ ```
169
+ ________
170
+ # Usage Example
171
+
172
+ Below is an example use case using the `LandsatCollection` module to create an NDWI image collection, create water classification maps, and create a time series of water area.
173
+
174
+ ### 1. Create a Filtered Landsat Image Collection
175
+
176
+ ```python
177
+ # 1. Import necessary packages and modules
178
+ import ee
179
+ from RadGEEToolbox import LandsatCollection
180
+
181
+ # 2. Authenticate & Initialize GEE API
182
+ ee.Authenticate()
183
+ ee.Initialize(project='my-cloud-project-ID) #replace with your Google Cloud project ID
184
+
185
+ # 3. Define study area boundary - in this case Lake Powell, Utah
186
+ study_area = ee.Geometry.Polygon(
187
+ [[[-111.35875055487008, 37.19999663127137],
188
+ [-111.35875055487008, 37.00119876939416],
189
+ [-111.12048456365915, 37.00119876939416],
190
+ [-111.12048456365915, 37.19999663127137]]])
191
+
192
+ # 3. Create a Landsat image collection for a given time range and study area
193
+ # includes filtering imagery based on areal percentage of cloud cover
194
+ # WRS-2 tile(s) can also be used for filtering instead of an ROI geometry
195
+ collection = LandsatCollection(
196
+ start_date='2020-01-01', #date formats of 'YYYY-MM-DD'
197
+ end_date='2025-01-01',
198
+ cloud_percentage_threshold=10, #filtering to <10% cloud coverage
199
+ boundary=study_area #ee.Geometry() of your study area
200
+ )
201
+
202
+ # 4. Check collection by printing the dates of all images in the collection
203
+ dates = collection.dates
204
+ print(dates)
205
+ ```
206
+ ```
207
+ ['2020-01-13', '2020-02-14', '2020-05-04', '2020-05-20', '2020-07-07', '2020-08-08', '2020-08-24', '2020-09-25', '2020-10-11', '2020-10-27', '2020-11-28', '2020-12-30', '2021-01-15', '2021-01-31', '2021-04-05', '2021-05-07', '2021-06-08', '2021-07-10', '2021-08-27', '2021-10-30', '2021-11-10', '2021-11-10', '2021-12-01', '2021-12-17', '2022-01-02', '2022-01-10', '2022-01-26', '2022-02-11', '2022-02-19', '2022-02-27', '2022-03-23', '2022-04-08', '2022-05-02', '2022-05-18', '2022-05-26', '2022-06-11', '2022-06-27', '2022-07-13', '2022-08-06', '2022-08-22', '2022-08-30', '2022-09-07', '2022-09-23', '2022-10-01', '2022-10-09', '2022-10-17', '2022-10-25', '2022-11-10', '2023-01-21', '2023-03-18', '2023-04-11', '2023-06-22', '2023-06-30', '2023-07-08', '2023-07-16', '2023-09-18', '2023-09-26', '2023-10-04', '2023-10-20', '2023-11-13', '2023-11-21', '2023-12-07', '2023-12-15', '2023-12-31', '2024-01-16', '2024-03-20', '2024-04-13', '2024-04-21', '2024-05-07', '2024-05-23', '2024-06-08', '2024-06-16', '2024-07-02', '2024-07-10', '2024-07-26', '2024-08-19', '2024-08-27', '2024-09-04', '2024-09-12', '2024-09-20', '2024-09-28', '2024-10-06', '2024-10-22', '2024-10-30', '2024-11-07', '2024-11-15', '2024-12-01']
208
+ ```
209
+ ### 2. Apply a Cloud Mask and Compute NDWI
210
+ ```python
211
+ # 1. Mask clouds
212
+ cloud_masked_collection = collection.masked_clouds_collection
213
+ # 2. Create a collection of singleband NDWI images with band names of 'ndwi'
214
+ cloud_masked_NDWI_collection = cloud_masked_collection.ndwi
215
+ # BONUS - 3. Create water classification maps using a user-set binary NDWI threshold
216
+ water_classification_maps = cloud_masked_collection.ndwi_collection(
217
+ threshold=0
218
+ )
219
+ ```
220
+
221
+ ![Visualization of true color and classified water (in blue) from one of the dates in the collection](LakePowellNDWI.png)
222
+
223
+ ***Visualization of true color and classified water (in blue) from one of the dates in the collection. To see the code used to display this image, please view [this Example Notebook](https://github.com/radwinskis/RadGEEToolbox/blob/main/Example%20Notebooks/Complete_ReadMe_Example.ipynb)***
224
+
225
+ ### 3. Calculate Water Area Time Series
226
+ ```python
227
+ calculate_water_area = cloud_masked_NDWI_collection.PixelAreaSumCollection(
228
+ band_name='ndwi', #specify band to use from collection
229
+ geometry=study_area, #ee.Geometry() of your study area
230
+ threshold=0, #binary classification threshold for unclassified rasters,
231
+ scale=90 #pixel size for zonal statistics
232
+ )
233
+ water_area_time_series = calculate_water_area.aggregate_array('ndwi').getInfo()
234
+ print('List of square meters of water in images:', water_area_time_series)
235
+ ```
236
+
237
+ ![Plotted Results from Above Example - All Processed in Less Than 5 Seconds!](LakePowellPlot.png)
238
+
239
+ ***To see the code used to display this plot, please view [this Example Notebook](https://github.com/radwinskis/RadGEEToolbox/blob/main/Example%20Notebooks/Complete_ReadMe_Example.ipynb)***
240
+
241
+ For details about Sentinel-1 SAR and Sentinel-2 MSI modules, and all other available Landsat or cross-module functions, please refer to the [RadGEEToolbox documentation](https://radgeetoolbox.readthedocs.io/en/latest/). You can also explore [`/Example Notebooks`](https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks) for more usage examples.
242
+
243
+ ________
244
+
245
+
246
+ ## Contributing
247
+
248
+ Contributions are welcome! If you’d like to suggest a feature, report a bug, or contribute code or documentation, please visit the [GitHub Issues](https://github.com/radwinskis/RadGEEToolbox/issues) page to get started or view the `CONTRIBUTING.md` file in the main directory.
249
+
250
+ ____
251
+
252
+ ## License
253
+
254
+ RadGEEToolbox is released under the MIT License.
255
+
256
+
@@ -0,0 +1,18 @@
1
+ __version__ = "1.6.4"
2
+
3
+ from .CollectionStitch import CollectionStitch, MosaicByDate
4
+ from .GetPalette import get_palette
5
+ from .LandsatCollection import LandsatCollection
6
+ from .Sentinel1Collection import Sentinel1Collection
7
+ from .Sentinel2Collection import Sentinel2Collection
8
+ from .VisParams import get_visualization_params
9
+
10
+ __all__ = [
11
+ "CollectionStitch",
12
+ "MosaicByDate",
13
+ "get_palette",
14
+ "LandsatCollection",
15
+ "Sentinel1Collection",
16
+ "Sentinel2Collection",
17
+ "get_visualization_params"
18
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: RadGEEToolbox
3
- Version: 1.6.2
3
+ Version: 1.6.4
4
4
  Summary: Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API
5
5
  Home-page: https://github.com/radwinskis/RadGEEToolbox
6
6
  Author: Mark Radwin
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Topic :: Scientific/Engineering :: GIS
17
17
  Classifier: Topic :: Scientific/Engineering :: Information Analysis
18
18
  Classifier: Operating System :: OS Independent
19
- Requires-Python: >=3.6
19
+ Requires-Python: >=3.8
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE.txt
22
22
  Requires-Dist: earthengine-api
@@ -31,7 +31,7 @@ Dynamic: requires-python
31
31
 
32
32
  # RadGEEToolbox 🛠
33
33
 
34
- ![](image-1.png)
34
+ ![](ReadMeCover.png)
35
35
 
36
36
  ### 🌎 Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API
37
37
 
@@ -41,6 +41,69 @@ Dynamic: requires-python
41
41
 
42
42
  Designed for both new and advanced users of Google Earth Engine, RadGEEToolbox minimizes repetitive scripting, accelerates common remote sensing workflows, and aims to maximize efficiency within the constraints of the Google Earth Engine API. Whether you’re building a time series of vegetation indices or extracting surface properties along transects, this package helps get results faster.
43
43
 
44
+ _________
45
+ ## Getting Started with Google Earth Engine
46
+
47
+ **RadGEEToolbox requires [access](https://developers.google.com/earth-engine/guides/access) to [Google Earth Engine (GEE)](https://earthengine.google.com/) and proper [authentication](https://developers.google.com/earth-engine/guides/auth) with the Python API.**
48
+
49
+ For more details, see the official [Google Earth Engine Python API Getting Started Guide](https://developers.google.com/earth-engine/guides/quickstart_python) or [Python Installation Guide](https://developers.google.com/earth-engine/guides/python_install).
50
+
51
+
52
+ ### 1. Sign Up for Earth Engine
53
+ Apply for access here: [https://earthengine.google.com/signup/](https://earthengine.google.com/signup/) using a Google account. Approval typically takes a few days.
54
+
55
+ ### 2. Install the Earth Engine Python API
56
+ **The Earth Engine API is installed automatically when you install `RadGEEToolbox`.** However, if you would like to install manually:
57
+
58
+ ```bash
59
+ pip install earthengine-api
60
+ ```
61
+
62
+ ### 3. Authenticate & Initialize
63
+ Prior to using the Earth Engine Python client library, you need to authenticate and use the resultant credentials to initialize the Python client. The authentication flows use Cloud Projects to authenticate, and they're used for unpaid (free, noncommercial) use as well as paid use.
64
+
65
+
66
+ **Run the following during your first use:**
67
+ ```python
68
+ import ee
69
+ ee.Authenticate()
70
+ ```
71
+ ***NOTE: Your GEE credentials will not permanantly be stored on your PC and you will periodically need to re-run `ee.Authenticate()` when `ee.Initialize()` returns an authentication error.***
72
+
73
+ `ee.Autheticate()` will select the best authentication mode for your environment, and prompt you to confirm access for your scripts. To initialize, you will need to provide a project that you own, or have permissions to use. This project will be used for running all Earth Engine operations:
74
+
75
+ ```python
76
+ ee.Initialize(project='my-project')
77
+ ```
78
+ Replacing 'my-project' with the name of the Google Cloud Project you created on sign-up or any Google Cloud Project that has the GEE API enabled.
79
+
80
+ ### 4. Authentication Best Practices
81
+ It is reccomended to use the following authentication procedure once you have completed your initial authentication:
82
+ ```python
83
+ import ee
84
+
85
+ try:
86
+ ee.Initialize()
87
+ except Exception as e:
88
+ ee.Authenticate()
89
+ ee.Initialize()
90
+ ```
91
+
92
+ ### 5. Troubleshooting
93
+ `AttributeError: module 'ee' has no attribute 'Initialize'`
94
+
95
+ ➤ Ensure that earthengine-api is installed properly.
96
+
97
+ `403 Access Denied`
98
+
99
+ ➤ Your GEE account might not be approved, or the API is not enabled for your project.
100
+
101
+ `Initialization fails`
102
+
103
+ ➤ Try using `ee.Initialize(project='your-project-id')` explicitly in case you are just calling `ee.Initialize()`
104
+
105
+ See the official [GEE documentation for authentication »](https://developers.google.com/earth-engine/guides/auth)
106
+
44
107
  _________
45
108
 
46
109
  ## Key Features
@@ -67,15 +130,15 @@ _____________
67
130
 
68
131
  ### Installing via pip
69
132
 
70
- To install `RadGEEToolbox` version 1.6.2 using pip (NOTE: it is recommended to create a new virtual environment):
133
+ To install `RadGEEToolbox` version 1.6.4 using pip (NOTE: it is recommended to create a new virtual environment):
71
134
 
72
135
  ```bash
73
- pip install RadGEEToolbox==1.6.2
136
+ pip install RadGEEToolbox==1.6.4
74
137
  ```
75
138
 
76
139
  ### Installing via Conda
77
140
 
78
- To install `RadGEEToolbox` version 1.6.2 using conda-forge (NOTE: it is recommended to create a new virtual environment):
141
+ To install `RadGEEToolbox` version 1.6.4 using conda-forge (NOTE: it is recommended to create a new virtual environment):
79
142
 
80
143
  ```bash
81
144
  conda install conda-forge::radgeetoolbox
@@ -106,8 +169,32 @@ To verify that `RadGEEToolbox` was installed correctly:
106
169
  python -c "import RadGEEToolbox; print(RadGEEToolbox.__version__)"
107
170
  ```
108
171
 
109
- You should see `1.6.2` printed as the version number.
172
+ You should see `1.6.4` printed as the version number.
173
+
174
+ ### Want to Visualize Data? Install These Too
175
+
176
+ The core functionality of this package is focused on the processing of geospatial and remote sensing data using Google Earth Engine. It does **not** include interactive mapping functionality by default.
110
177
 
178
+ **If you wish to view GEE data on interactive maps (e.g., following along with the mapping portions of the [example notebooks](https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks)), you will need to install the [optional `geemap` package](https://geemap.org) in the environment that `RadGEEToolbox` is installed:**
179
+
180
+ ```python
181
+ pip install geemap
182
+ ```
183
+ or
184
+
185
+ ```bash
186
+ conda install conda-forge::geemap
187
+ ```
188
+ **If you plan to use `geemap` in a Jupyter Notebook, you will also need to install `ipykernel`:**
189
+
190
+ ```python
191
+ pip install ipykernel
192
+ ```
193
+ or
194
+
195
+ ```bash
196
+ conda install anaconda::ipykernel
197
+ ```
111
198
  ________
112
199
  # Usage Example
113
200
 
@@ -122,7 +209,7 @@ from RadGEEToolbox import LandsatCollection
122
209
 
123
210
  # 2. Authenticate & Initialize GEE API
124
211
  ee.Authenticate()
125
- ee.Initialize()
212
+ ee.Initialize(project='my-cloud-project-ID) #replace with your Google Cloud project ID
126
213
 
127
214
  # 3. Define study area boundary - in this case Lake Powell, Utah
128
215
  study_area = ee.Geometry.Polygon(
@@ -145,6 +232,9 @@ collection = LandsatCollection(
145
232
  dates = collection.dates
146
233
  print(dates)
147
234
  ```
235
+ ```
236
+ ['2020-01-13', '2020-02-14', '2020-05-04', '2020-05-20', '2020-07-07', '2020-08-08', '2020-08-24', '2020-09-25', '2020-10-11', '2020-10-27', '2020-11-28', '2020-12-30', '2021-01-15', '2021-01-31', '2021-04-05', '2021-05-07', '2021-06-08', '2021-07-10', '2021-08-27', '2021-10-30', '2021-11-10', '2021-11-10', '2021-12-01', '2021-12-17', '2022-01-02', '2022-01-10', '2022-01-26', '2022-02-11', '2022-02-19', '2022-02-27', '2022-03-23', '2022-04-08', '2022-05-02', '2022-05-18', '2022-05-26', '2022-06-11', '2022-06-27', '2022-07-13', '2022-08-06', '2022-08-22', '2022-08-30', '2022-09-07', '2022-09-23', '2022-10-01', '2022-10-09', '2022-10-17', '2022-10-25', '2022-11-10', '2023-01-21', '2023-03-18', '2023-04-11', '2023-06-22', '2023-06-30', '2023-07-08', '2023-07-16', '2023-09-18', '2023-09-26', '2023-10-04', '2023-10-20', '2023-11-13', '2023-11-21', '2023-12-07', '2023-12-15', '2023-12-31', '2024-01-16', '2024-03-20', '2024-04-13', '2024-04-21', '2024-05-07', '2024-05-23', '2024-06-08', '2024-06-16', '2024-07-02', '2024-07-10', '2024-07-26', '2024-08-19', '2024-08-27', '2024-09-04', '2024-09-12', '2024-09-20', '2024-09-28', '2024-10-06', '2024-10-22', '2024-10-30', '2024-11-07', '2024-11-15', '2024-12-01']
237
+ ```
148
238
  ### 2. Apply a Cloud Mask and Compute NDWI
149
239
  ```python
150
240
  # 1. Mask clouds
@@ -156,15 +246,16 @@ water_classification_maps = cloud_masked_collection.ndwi_collection(
156
246
  threshold=0
157
247
  )
158
248
  ```
159
- ![Visualization of true color and classified water (in blue) from one of the dates in the collection](image-3.png)
160
249
 
161
- Visualization of true color and classified water (in blue) from one of the dates in the collection
250
+ ![Visualization of true color and classified water (in blue) from one of the dates in the collection](LakePowellNDWI.png)
251
+
252
+ ***Visualization of true color and classified water (in blue) from one of the dates in the collection. To see the code used to display this image, please view [this Example Notebook](https://github.com/radwinskis/RadGEEToolbox/blob/main/Example%20Notebooks/Complete_ReadMe_Example.ipynb)***
162
253
 
163
254
  ### 3. Calculate Water Area Time Series
164
255
  ```python
165
256
  calculate_water_area = cloud_masked_NDWI_collection.PixelAreaSumCollection(
166
257
  band_name='ndwi', #specify band to use from collection
167
- geometry=study_area), #ee.Geometry() of your study area
258
+ geometry=study_area, #ee.Geometry() of your study area
168
259
  threshold=0, #binary classification threshold for unclassified rasters,
169
260
  scale=90 #pixel size for zonal statistics
170
261
  )
@@ -172,9 +263,9 @@ water_area_time_series = calculate_water_area.aggregate_array('ndwi').getInfo()
172
263
  print('List of square meters of water in images:', water_area_time_series)
173
264
  ```
174
265
 
175
- ![Plotted Results from Above Example - All Processed in Less Than 5 Seconds!](image-4.png)
266
+ ![Plotted Results from Above Example - All Processed in Less Than 5 Seconds!](LakePowellPlot.png)
176
267
 
177
- Plotted Results from Above Example - All Processed in Less Than 5 Seconds!
268
+ ***To see the code used to display this plot, please view [this Example Notebook](https://github.com/radwinskis/RadGEEToolbox/blob/main/Example%20Notebooks/Complete_ReadMe_Example.ipynb)***
178
269
 
179
270
  For details about Sentinel-1 SAR and Sentinel-2 MSI modules, and all other available Landsat or cross-module functions, please refer to the [RadGEEToolbox documentation](https://radgeetoolbox.readthedocs.io/en/latest/). You can also explore [`/Example Notebooks`](https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks) for more usage examples.
180
271
 
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "RadGEEToolbox"
7
- version = "1.6.2"
7
+ version = "1.6.4"
8
8
  description = "Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API"
9
9
  authors = [
10
10
  {name = "Mark Radwin", email = "markradwin@gmail.com"}
11
11
  ]
12
12
  license = {text = "MIT"}
13
13
  readme = "README.md"
14
- requires-python = ">=3.6"
14
+ requires-python = ">=3.8"
15
15
  dependencies = [
16
16
  "earthengine-api",
17
17
  "numpy",
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="RadGEEToolbox",
5
- version="1.6.2",
5
+ version="1.6.4",
6
6
  author="Mark Radwin",
7
7
  author_email="markradwin@gmail.com",
8
8
  description="Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API",
@@ -23,5 +23,5 @@ setup(
23
23
  "numpy",
24
24
  "pandas"
25
25
  ],
26
- python_requires=">=3.6",
26
+ python_requires=">=3.8",
27
27
  )
@@ -1,165 +0,0 @@
1
- [![PyPI version](https://badge.fury.io/py/RadGEEToolbox.svg)](https://pypi.org/project/RadGEEToolbox/)
2
-
3
- # RadGEEToolbox 🛠
4
-
5
- ![](image-1.png)
6
-
7
- ### 🌎 Streamlined Multispectral & SAR Analysis for Google Earth Engine Python API
8
-
9
- ### [See documentation here](https://radgeetoolbox.readthedocs.io/en/latest/)
10
-
11
- **RadGEEToolbox** is an open-source Python package that simplifies the processing and analysis of satellite imagery using the Google Earth Engine Python API. It provides ready-to-use tools for filtering, masking, mosaicking, spectral index calculations, and extracting statistics from multispectral (Landsat, Sentinel-2) and SAR (Sentinel-1) datasets.
12
-
13
- Designed for both new and advanced users of Google Earth Engine, RadGEEToolbox minimizes repetitive scripting, accelerates common remote sensing workflows, and aims to maximize efficiency within the constraints of the Google Earth Engine API. Whether you’re building a time series of vegetation indices or extracting surface properties along transects, this package helps get results faster.
14
-
15
- _________
16
-
17
- ## Key Features
18
-
19
- - Modular tools for processing **Landsat, Sentinel-1 SAR, and Sentinel-2** imagery
20
- - Efficient filtering, masking, and mosaicking of Earth Engine image collections
21
- - Built-in support for computing **spectral indices** (NDWI, NDVI, LST, turbidity, chlorophyll, etc.)
22
- - SAR utilities for **multilooking**, **speckle filtering**, and **backscatter conversion**
23
- - Automated extraction of **transect and zonal statistics** across image collections
24
- - Easy conversion between RadGEEToolbox and standard Earth Engine objects
25
- - Server-side–friendly workflows and caching for faster, scalable processing
26
-
27
- 🔍 For a full breakdown of available tools, see the [RadGEEToolbox documentation »](https://radgeetoolbox.readthedocs.io/en/latest/)
28
-
29
- _____________
30
-
31
- ## Installation Instructions
32
-
33
- ### Prerequisites
34
-
35
- - **Python**: Ensure you have version 3.6 or higher installed.
36
- - **pip**: This is Python's package installer.
37
- - **conda-forge**: Community led Conda package installer channel
38
-
39
- ### Installing via pip
40
-
41
- To install `RadGEEToolbox` version 1.6.2 using pip (NOTE: it is recommended to create a new virtual environment):
42
-
43
- ```bash
44
- pip install RadGEEToolbox==1.6.2
45
- ```
46
-
47
- ### Installing via Conda
48
-
49
- To install `RadGEEToolbox` version 1.6.2 using conda-forge (NOTE: it is recommended to create a new virtual environment):
50
-
51
- ```bash
52
- conda install conda-forge::radgeetoolbox
53
- ```
54
-
55
- ### Manual Installation from Source
56
-
57
- 1. **Clone the Repository**:
58
- ```bash
59
- git clone https://github.com/radwinskis/RadGEEToolbox.git
60
- ```
61
-
62
- 2. **Navigate to Directory**:
63
- ```bash
64
- cd RadGEEToolbox
65
- ```
66
-
67
- 3. **Install the Package**:
68
- ```bash
69
- pip install .
70
- ```
71
-
72
- ### ✅ Verifying the Installation
73
-
74
- To verify that `RadGEEToolbox` was installed correctly:
75
-
76
- ```python
77
- python -c "import RadGEEToolbox; print(RadGEEToolbox.__version__)"
78
- ```
79
-
80
- You should see `1.6.2` printed as the version number.
81
-
82
- ________
83
- # Usage Example
84
-
85
- Below is an example use case using the `LandsatCollection` module to create an NDWI image collection, create water classification maps, and create a time series of water area.
86
-
87
- ### 1. Create a Filtered Landsat Image Collection
88
-
89
- ```python
90
- # 1. Import necessary packages and modules
91
- import ee
92
- from RadGEEToolbox import LandsatCollection
93
-
94
- # 2. Authenticate & Initialize GEE API
95
- ee.Authenticate()
96
- ee.Initialize()
97
-
98
- # 3. Define study area boundary - in this case Lake Powell, Utah
99
- study_area = ee.Geometry.Polygon(
100
- [[[-111.35875055487008, 37.19999663127137],
101
- [-111.35875055487008, 37.00119876939416],
102
- [-111.12048456365915, 37.00119876939416],
103
- [-111.12048456365915, 37.19999663127137]]])
104
-
105
- # 3. Create a Landsat image collection for a given time range and study area
106
- # includes filtering imagery based on areal percentage of cloud cover
107
- # WRS-2 tile(s) can also be used for filtering instead of an ROI geometry
108
- collection = LandsatCollection(
109
- start_date='2020-01-01', #date formats of 'YYYY-MM-DD'
110
- end_date='2025-01-01',
111
- cloud_percentage_threshold=10, #filtering to <10% cloud coverage
112
- boundary=study_area #ee.Geometry() of your study area
113
- )
114
-
115
- # 4. Check collection by printing the dates of all images in the collection
116
- dates = collection.dates
117
- print(dates)
118
- ```
119
- ### 2. Apply a Cloud Mask and Compute NDWI
120
- ```python
121
- # 1. Mask clouds
122
- cloud_masked_collection = collection.masked_clouds_collection
123
- # 2. Create a collection of singleband NDWI images with band names of 'ndwi'
124
- cloud_masked_NDWI_collection = cloud_masked_collection.ndwi
125
- # BONUS - 3. Create water classification maps using a user-set binary NDWI threshold
126
- water_classification_maps = cloud_masked_collection.ndwi_collection(
127
- threshold=0
128
- )
129
- ```
130
- ![Visualization of true color and classified water (in blue) from one of the dates in the collection](image-3.png)
131
-
132
- Visualization of true color and classified water (in blue) from one of the dates in the collection
133
-
134
- ### 3. Calculate Water Area Time Series
135
- ```python
136
- calculate_water_area = cloud_masked_NDWI_collection.PixelAreaSumCollection(
137
- band_name='ndwi', #specify band to use from collection
138
- geometry=study_area), #ee.Geometry() of your study area
139
- threshold=0, #binary classification threshold for unclassified rasters,
140
- scale=90 #pixel size for zonal statistics
141
- )
142
- water_area_time_series = calculate_water_area.aggregate_array('ndwi').getInfo()
143
- print('List of square meters of water in images:', water_area_time_series)
144
- ```
145
-
146
- ![Plotted Results from Above Example - All Processed in Less Than 5 Seconds!](image-4.png)
147
-
148
- Plotted Results from Above Example - All Processed in Less Than 5 Seconds!
149
-
150
- For details about Sentinel-1 SAR and Sentinel-2 MSI modules, and all other available Landsat or cross-module functions, please refer to the [RadGEEToolbox documentation](https://radgeetoolbox.readthedocs.io/en/latest/). You can also explore [`/Example Notebooks`](https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks) for more usage examples.
151
-
152
- ________
153
-
154
-
155
- ## Contributing
156
-
157
- Contributions are welcome! If you’d like to suggest a feature, report a bug, or contribute code or documentation, please visit the [GitHub Issues](https://github.com/radwinskis/RadGEEToolbox/issues) page to get started or view the `CONTRIBUTING.md` file in the main directory.
158
-
159
- ____
160
-
161
- ## License
162
-
163
- RadGEEToolbox is released under the MIT License.
164
-
165
-
@@ -1,6 +0,0 @@
1
- from .CollectionStitch import CollectionStitch, MosaicByDate
2
- from .GetPalette import get_palette
3
- from .LandsatCollection import LandsatCollection
4
- from .Sentinel1Collection import Sentinel1Collection
5
- from .Sentinel2Collection import Sentinel2Collection
6
- from .VisParams import get_visualization_params
File without changes
File without changes