SnowMapPy 1.0.1__tar.gz → 1.0.2__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.
- snowmappy-1.0.2/LICENSE +21 -0
- snowmappy-1.0.2/PKG-INFO +188 -0
- snowmappy-1.0.2/README.md +148 -0
- snowmappy-1.0.2/SnowMapPy.egg-info/PKG-INFO +188 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/SnowMapPy.egg-info/SOURCES.txt +2 -0
- snowmappy-1.0.2/SnowMapPy.egg-info/requires.txt +11 -0
- snowmappy-1.0.2/pyproject.toml +39 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/requirements.txt +6 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/setup.py +5 -18
- snowmappy-1.0.1/PKG-INFO +0 -242
- snowmappy-1.0.1/README.md +0 -182
- snowmappy-1.0.1/SnowMapPy.egg-info/PKG-INFO +0 -242
- snowmappy-1.0.1/SnowMapPy.egg-info/requires.txt +0 -24
- {snowmappy-1.0.1 → snowmappy-1.0.2}/MANIFEST.in +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/SnowMapPy.egg-info/dependency_links.txt +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/SnowMapPy.egg-info/top_level.txt +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/TESTING.md +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/cloud/__init__.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/cloud/auth.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/cloud/loader.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/cloud/processor.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/core/__init__.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/core/data_io.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/core/quality.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/core/spatial.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/core/temporal.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/core/utils.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/local/__init__.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/local/file_handler.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/local/preparator.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/local/processor.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/setup.cfg +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/tests/__init__.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/tests/test_cloud/__init__.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/tests/test_cloud/real_cloud_test.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/tests/test_cloud/test_basic_cloud.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/tests/test_core/__init__.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/tests/test_core/test_quality.py +0 -0
- {snowmappy-1.0.1 → snowmappy-1.0.2}/tests/test_local/__init__.py +0 -0
snowmappy-1.0.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Haytam Elyoussfi
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
snowmappy-1.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: SnowMapPy
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: A comprehensive Python package for processing MODIS NDSI data from local files and Google Earth Engine
|
|
5
|
+
Home-page: https://github.com/haytamelyo/SnowMapPy
|
|
6
|
+
Author: Haytam Elyoussfi
|
|
7
|
+
Author-email: Haytam Elyoussfi <haytam.elyoussfi@um6p.ma>, Hatim Bechri <Hatim.bechri@usms.ac.ma>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Project-URL: Bug Reports, https://github.com/haytamelyo/SnowMapPy/issues
|
|
10
|
+
Project-URL: Source, https://github.com/haytamelyo/SnowMapPy
|
|
11
|
+
Project-URL: Documentation, https://github.com/haytamelyo/SnowMapPy#readme
|
|
12
|
+
Keywords: modis,snow,remote sensing,earth engine,gis,hydrology
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: pandas
|
|
28
|
+
Requires-Dist: xarray
|
|
29
|
+
Requires-Dist: rasterio
|
|
30
|
+
Requires-Dist: geopandas
|
|
31
|
+
Requires-Dist: earthengine-api
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
34
|
+
Requires-Dist: flake8>=3.8; extra == "dev"
|
|
35
|
+
Requires-Dist: black>=21.0; extra == "dev"
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: home-page
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
|
|
41
|
+
# SnowMapPy 🌨️
|
|
42
|
+
|
|
43
|
+
A Python package for processing MODIS NDSI (Normalized Difference Snow Index) data from local files and Google Earth Engine. Designed for hydrologists, geographers, and water resource managers, SnowMapPy simplifies snow cover analysis with minimal Python expertise required.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📋 Table of Contents
|
|
48
|
+
|
|
49
|
+
- [Features](#features)
|
|
50
|
+
- [Installation](#installation)
|
|
51
|
+
- [Option 1: Install with Conda (Recommended)](#option-1-install-with-conda-recommended)
|
|
52
|
+
- [Option 2: Install with pip](#option-2-install-with-pip)
|
|
53
|
+
- [Option 3: Run with Docker](#option-3-run-with-docker)
|
|
54
|
+
- [Quick Start](#quick-start)
|
|
55
|
+
- [Troubleshooting](#troubleshooting)
|
|
56
|
+
- [Contributing](#contributing)
|
|
57
|
+
- [License](#license)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ✨ Features
|
|
62
|
+
|
|
63
|
+
- **Cloud Processing**: Process MODIS NDSI data directly from Google Earth Engine.
|
|
64
|
+
- **Local Processing**: Handle locally stored MODIS NDSI files.
|
|
65
|
+
- **Quality Control**: Mask invalid data using advanced techniques.
|
|
66
|
+
- **Temporal Interpolation**: Fill missing data points efficiently.
|
|
67
|
+
- **Spatial Operations**: Clip data to regions of interest.
|
|
68
|
+
- **Data Export**: Save processed data in Zarr format.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🚀 Installation
|
|
73
|
+
|
|
74
|
+
SnowMapPy requires Python 3.8 or higher. We recommend using **Conda** for managing dependencies, especially for Windows users.
|
|
75
|
+
|
|
76
|
+
### Option 1: Install with Conda (Recommended)
|
|
77
|
+
|
|
78
|
+
Install SnowMapPy directly from Conda-Forge:
|
|
79
|
+
```bash
|
|
80
|
+
conda install -c conda-forge snowmappy
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Option 2: Install with pip
|
|
84
|
+
|
|
85
|
+
1. **Create a Virtual Environment**
|
|
86
|
+
```bash
|
|
87
|
+
python -m venv snowmappy_env
|
|
88
|
+
source snowmappy_env/bin/activate # macOS/Linux
|
|
89
|
+
snowmappy_env\Scripts\activate # Windows
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
2. **Install SnowMapPy**
|
|
93
|
+
```bash
|
|
94
|
+
pip install SnowMapPy
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Option 3: Run with Docker
|
|
98
|
+
|
|
99
|
+
1. **Pull the Docker Image**
|
|
100
|
+
```bash
|
|
101
|
+
docker pull your-dockerhub-username/snowmappy:1.0.2
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
2. **Run the Container**
|
|
105
|
+
```bash
|
|
106
|
+
docker run -it your-dockerhub-username/snowmappy:1.0.2
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. **Mount Local Data (Optional)**
|
|
110
|
+
To process local files, mount your data directory:
|
|
111
|
+
```bash
|
|
112
|
+
docker run -it -v /path/to/data:/app/data your-dockerhub-username/snowmappy:1.0.2
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 🎯 Quick Start
|
|
118
|
+
|
|
119
|
+
### Cloud Processing Example
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from SnowMapPy.cloud.processor import process_modis_ndsi_cloud
|
|
123
|
+
|
|
124
|
+
# Process MODIS NDSI data from Google Earth Engine
|
|
125
|
+
result = process_modis_ndsi_cloud(
|
|
126
|
+
project_name="your-gee-project",
|
|
127
|
+
shapefile_path="path/to/roi.shp",
|
|
128
|
+
start_date="2023-01-01",
|
|
129
|
+
end_date="2023-01-31",
|
|
130
|
+
output_path="output/",
|
|
131
|
+
file_name="snow_cover"
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Local Processing Example
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from SnowMapPy.local.processor import process_modis_ndsi_local
|
|
139
|
+
|
|
140
|
+
# Process locally stored MODIS NDSI files
|
|
141
|
+
result = process_modis_ndsi_local(
|
|
142
|
+
mod_dir="path/to/MOD/files/",
|
|
143
|
+
myd_dir="path/to/MYD/files/",
|
|
144
|
+
dem_file="path/to/dem.tif",
|
|
145
|
+
output_path="output/",
|
|
146
|
+
file_name="local_snow_cover"
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 🔧 Troubleshooting
|
|
153
|
+
|
|
154
|
+
### Common Issues and Solutions
|
|
155
|
+
|
|
156
|
+
#### 1. **GDAL or Proj Library Not Found**
|
|
157
|
+
- **Solution for Conda**: Ensure you installed the package from Conda-Forge:
|
|
158
|
+
```bash
|
|
159
|
+
conda install -c conda-forge snowmappy
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### 2. **Earth Engine Authentication Fails**
|
|
163
|
+
- **Solution**: Re-authenticate:
|
|
164
|
+
```bash
|
|
165
|
+
earthengine authenticate --force
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### 3. **Memory Errors During Processing**
|
|
169
|
+
- **Solutions**:
|
|
170
|
+
- Reduce the date range or spatial extent.
|
|
171
|
+
- Increase virtual memory/swap space.
|
|
172
|
+
- Use a machine with more RAM.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 🤝 Contributing
|
|
177
|
+
|
|
178
|
+
1. Fork the repository.
|
|
179
|
+
2. Create a feature branch.
|
|
180
|
+
3. Commit your changes.
|
|
181
|
+
4. Push to the branch.
|
|
182
|
+
5. Open a Pull Request.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 📄 License
|
|
187
|
+
|
|
188
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# SnowMapPy 🌨️
|
|
2
|
+
|
|
3
|
+
A Python package for processing MODIS NDSI (Normalized Difference Snow Index) data from local files and Google Earth Engine. Designed for hydrologists, geographers, and water resource managers, SnowMapPy simplifies snow cover analysis with minimal Python expertise required.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📋 Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Features](#features)
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [Option 1: Install with Conda (Recommended)](#option-1-install-with-conda-recommended)
|
|
12
|
+
- [Option 2: Install with pip](#option-2-install-with-pip)
|
|
13
|
+
- [Option 3: Run with Docker](#option-3-run-with-docker)
|
|
14
|
+
- [Quick Start](#quick-start)
|
|
15
|
+
- [Troubleshooting](#troubleshooting)
|
|
16
|
+
- [Contributing](#contributing)
|
|
17
|
+
- [License](#license)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## ✨ Features
|
|
22
|
+
|
|
23
|
+
- **Cloud Processing**: Process MODIS NDSI data directly from Google Earth Engine.
|
|
24
|
+
- **Local Processing**: Handle locally stored MODIS NDSI files.
|
|
25
|
+
- **Quality Control**: Mask invalid data using advanced techniques.
|
|
26
|
+
- **Temporal Interpolation**: Fill missing data points efficiently.
|
|
27
|
+
- **Spatial Operations**: Clip data to regions of interest.
|
|
28
|
+
- **Data Export**: Save processed data in Zarr format.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 🚀 Installation
|
|
33
|
+
|
|
34
|
+
SnowMapPy requires Python 3.8 or higher. We recommend using **Conda** for managing dependencies, especially for Windows users.
|
|
35
|
+
|
|
36
|
+
### Option 1: Install with Conda (Recommended)
|
|
37
|
+
|
|
38
|
+
Install SnowMapPy directly from Conda-Forge:
|
|
39
|
+
```bash
|
|
40
|
+
conda install -c conda-forge snowmappy
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Option 2: Install with pip
|
|
44
|
+
|
|
45
|
+
1. **Create a Virtual Environment**
|
|
46
|
+
```bash
|
|
47
|
+
python -m venv snowmappy_env
|
|
48
|
+
source snowmappy_env/bin/activate # macOS/Linux
|
|
49
|
+
snowmappy_env\Scripts\activate # Windows
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
2. **Install SnowMapPy**
|
|
53
|
+
```bash
|
|
54
|
+
pip install SnowMapPy
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Option 3: Run with Docker
|
|
58
|
+
|
|
59
|
+
1. **Pull the Docker Image**
|
|
60
|
+
```bash
|
|
61
|
+
docker pull your-dockerhub-username/snowmappy:1.0.2
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
2. **Run the Container**
|
|
65
|
+
```bash
|
|
66
|
+
docker run -it your-dockerhub-username/snowmappy:1.0.2
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
3. **Mount Local Data (Optional)**
|
|
70
|
+
To process local files, mount your data directory:
|
|
71
|
+
```bash
|
|
72
|
+
docker run -it -v /path/to/data:/app/data your-dockerhub-username/snowmappy:1.0.2
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## 🎯 Quick Start
|
|
78
|
+
|
|
79
|
+
### Cloud Processing Example
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from SnowMapPy.cloud.processor import process_modis_ndsi_cloud
|
|
83
|
+
|
|
84
|
+
# Process MODIS NDSI data from Google Earth Engine
|
|
85
|
+
result = process_modis_ndsi_cloud(
|
|
86
|
+
project_name="your-gee-project",
|
|
87
|
+
shapefile_path="path/to/roi.shp",
|
|
88
|
+
start_date="2023-01-01",
|
|
89
|
+
end_date="2023-01-31",
|
|
90
|
+
output_path="output/",
|
|
91
|
+
file_name="snow_cover"
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Local Processing Example
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from SnowMapPy.local.processor import process_modis_ndsi_local
|
|
99
|
+
|
|
100
|
+
# Process locally stored MODIS NDSI files
|
|
101
|
+
result = process_modis_ndsi_local(
|
|
102
|
+
mod_dir="path/to/MOD/files/",
|
|
103
|
+
myd_dir="path/to/MYD/files/",
|
|
104
|
+
dem_file="path/to/dem.tif",
|
|
105
|
+
output_path="output/",
|
|
106
|
+
file_name="local_snow_cover"
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 🔧 Troubleshooting
|
|
113
|
+
|
|
114
|
+
### Common Issues and Solutions
|
|
115
|
+
|
|
116
|
+
#### 1. **GDAL or Proj Library Not Found**
|
|
117
|
+
- **Solution for Conda**: Ensure you installed the package from Conda-Forge:
|
|
118
|
+
```bash
|
|
119
|
+
conda install -c conda-forge snowmappy
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
#### 2. **Earth Engine Authentication Fails**
|
|
123
|
+
- **Solution**: Re-authenticate:
|
|
124
|
+
```bash
|
|
125
|
+
earthengine authenticate --force
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
#### 3. **Memory Errors During Processing**
|
|
129
|
+
- **Solutions**:
|
|
130
|
+
- Reduce the date range or spatial extent.
|
|
131
|
+
- Increase virtual memory/swap space.
|
|
132
|
+
- Use a machine with more RAM.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 🤝 Contributing
|
|
137
|
+
|
|
138
|
+
1. Fork the repository.
|
|
139
|
+
2. Create a feature branch.
|
|
140
|
+
3. Commit your changes.
|
|
141
|
+
4. Push to the branch.
|
|
142
|
+
5. Open a Pull Request.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 📄 License
|
|
147
|
+
|
|
148
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: SnowMapPy
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: A comprehensive Python package for processing MODIS NDSI data from local files and Google Earth Engine
|
|
5
|
+
Home-page: https://github.com/haytamelyo/SnowMapPy
|
|
6
|
+
Author: Haytam Elyoussfi
|
|
7
|
+
Author-email: Haytam Elyoussfi <haytam.elyoussfi@um6p.ma>, Hatim Bechri <Hatim.bechri@usms.ac.ma>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Project-URL: Bug Reports, https://github.com/haytamelyo/SnowMapPy/issues
|
|
10
|
+
Project-URL: Source, https://github.com/haytamelyo/SnowMapPy
|
|
11
|
+
Project-URL: Documentation, https://github.com/haytamelyo/SnowMapPy#readme
|
|
12
|
+
Keywords: modis,snow,remote sensing,earth engine,gis,hydrology
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: GIS
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: numpy
|
|
27
|
+
Requires-Dist: pandas
|
|
28
|
+
Requires-Dist: xarray
|
|
29
|
+
Requires-Dist: rasterio
|
|
30
|
+
Requires-Dist: geopandas
|
|
31
|
+
Requires-Dist: earthengine-api
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
34
|
+
Requires-Dist: flake8>=3.8; extra == "dev"
|
|
35
|
+
Requires-Dist: black>=21.0; extra == "dev"
|
|
36
|
+
Dynamic: author
|
|
37
|
+
Dynamic: home-page
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
Dynamic: requires-python
|
|
40
|
+
|
|
41
|
+
# SnowMapPy 🌨️
|
|
42
|
+
|
|
43
|
+
A Python package for processing MODIS NDSI (Normalized Difference Snow Index) data from local files and Google Earth Engine. Designed for hydrologists, geographers, and water resource managers, SnowMapPy simplifies snow cover analysis with minimal Python expertise required.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📋 Table of Contents
|
|
48
|
+
|
|
49
|
+
- [Features](#features)
|
|
50
|
+
- [Installation](#installation)
|
|
51
|
+
- [Option 1: Install with Conda (Recommended)](#option-1-install-with-conda-recommended)
|
|
52
|
+
- [Option 2: Install with pip](#option-2-install-with-pip)
|
|
53
|
+
- [Option 3: Run with Docker](#option-3-run-with-docker)
|
|
54
|
+
- [Quick Start](#quick-start)
|
|
55
|
+
- [Troubleshooting](#troubleshooting)
|
|
56
|
+
- [Contributing](#contributing)
|
|
57
|
+
- [License](#license)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## ✨ Features
|
|
62
|
+
|
|
63
|
+
- **Cloud Processing**: Process MODIS NDSI data directly from Google Earth Engine.
|
|
64
|
+
- **Local Processing**: Handle locally stored MODIS NDSI files.
|
|
65
|
+
- **Quality Control**: Mask invalid data using advanced techniques.
|
|
66
|
+
- **Temporal Interpolation**: Fill missing data points efficiently.
|
|
67
|
+
- **Spatial Operations**: Clip data to regions of interest.
|
|
68
|
+
- **Data Export**: Save processed data in Zarr format.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 🚀 Installation
|
|
73
|
+
|
|
74
|
+
SnowMapPy requires Python 3.8 or higher. We recommend using **Conda** for managing dependencies, especially for Windows users.
|
|
75
|
+
|
|
76
|
+
### Option 1: Install with Conda (Recommended)
|
|
77
|
+
|
|
78
|
+
Install SnowMapPy directly from Conda-Forge:
|
|
79
|
+
```bash
|
|
80
|
+
conda install -c conda-forge snowmappy
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Option 2: Install with pip
|
|
84
|
+
|
|
85
|
+
1. **Create a Virtual Environment**
|
|
86
|
+
```bash
|
|
87
|
+
python -m venv snowmappy_env
|
|
88
|
+
source snowmappy_env/bin/activate # macOS/Linux
|
|
89
|
+
snowmappy_env\Scripts\activate # Windows
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
2. **Install SnowMapPy**
|
|
93
|
+
```bash
|
|
94
|
+
pip install SnowMapPy
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Option 3: Run with Docker
|
|
98
|
+
|
|
99
|
+
1. **Pull the Docker Image**
|
|
100
|
+
```bash
|
|
101
|
+
docker pull your-dockerhub-username/snowmappy:1.0.2
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
2. **Run the Container**
|
|
105
|
+
```bash
|
|
106
|
+
docker run -it your-dockerhub-username/snowmappy:1.0.2
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. **Mount Local Data (Optional)**
|
|
110
|
+
To process local files, mount your data directory:
|
|
111
|
+
```bash
|
|
112
|
+
docker run -it -v /path/to/data:/app/data your-dockerhub-username/snowmappy:1.0.2
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 🎯 Quick Start
|
|
118
|
+
|
|
119
|
+
### Cloud Processing Example
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
from SnowMapPy.cloud.processor import process_modis_ndsi_cloud
|
|
123
|
+
|
|
124
|
+
# Process MODIS NDSI data from Google Earth Engine
|
|
125
|
+
result = process_modis_ndsi_cloud(
|
|
126
|
+
project_name="your-gee-project",
|
|
127
|
+
shapefile_path="path/to/roi.shp",
|
|
128
|
+
start_date="2023-01-01",
|
|
129
|
+
end_date="2023-01-31",
|
|
130
|
+
output_path="output/",
|
|
131
|
+
file_name="snow_cover"
|
|
132
|
+
)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Local Processing Example
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
from SnowMapPy.local.processor import process_modis_ndsi_local
|
|
139
|
+
|
|
140
|
+
# Process locally stored MODIS NDSI files
|
|
141
|
+
result = process_modis_ndsi_local(
|
|
142
|
+
mod_dir="path/to/MOD/files/",
|
|
143
|
+
myd_dir="path/to/MYD/files/",
|
|
144
|
+
dem_file="path/to/dem.tif",
|
|
145
|
+
output_path="output/",
|
|
146
|
+
file_name="local_snow_cover"
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 🔧 Troubleshooting
|
|
153
|
+
|
|
154
|
+
### Common Issues and Solutions
|
|
155
|
+
|
|
156
|
+
#### 1. **GDAL or Proj Library Not Found**
|
|
157
|
+
- **Solution for Conda**: Ensure you installed the package from Conda-Forge:
|
|
158
|
+
```bash
|
|
159
|
+
conda install -c conda-forge snowmappy
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### 2. **Earth Engine Authentication Fails**
|
|
163
|
+
- **Solution**: Re-authenticate:
|
|
164
|
+
```bash
|
|
165
|
+
earthengine authenticate --force
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
#### 3. **Memory Errors During Processing**
|
|
169
|
+
- **Solutions**:
|
|
170
|
+
- Reduce the date range or spatial extent.
|
|
171
|
+
- Increase virtual memory/swap space.
|
|
172
|
+
- Use a machine with more RAM.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 🤝 Contributing
|
|
177
|
+
|
|
178
|
+
1. Fork the repository.
|
|
179
|
+
2. Create a feature branch.
|
|
180
|
+
3. Commit your changes.
|
|
181
|
+
4. Push to the branch.
|
|
182
|
+
5. Open a Pull Request.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## 📄 License
|
|
187
|
+
|
|
188
|
+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=40.8.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "SnowMapPy"
|
|
7
|
+
version = "1.0.2"
|
|
8
|
+
description = "A comprehensive Python package for processing MODIS NDSI data from local files and Google Earth Engine"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "Haytam Elyoussfi", email = "haytam.elyoussfi@um6p.ma" },
|
|
13
|
+
{ name = "Hatim Bechri", email = "Hatim.bechri@usms.ac.ma" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["modis", "snow", "remote sensing", "earth engine", "gis", "hydrology"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.8",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Topic :: Scientific/Engineering :: GIS",
|
|
26
|
+
"Topic :: Scientific/Engineering :: Atmospheric Science"
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"numpy",
|
|
30
|
+
"pandas",
|
|
31
|
+
"xarray",
|
|
32
|
+
"rasterio",
|
|
33
|
+
"geopandas",
|
|
34
|
+
"earthengine-api"
|
|
35
|
+
]
|
|
36
|
+
requires-python = ">=3.8"
|
|
37
|
+
urls = { "Bug Reports" = "https://github.com/haytamelyo/SnowMapPy/issues", "Source" = "https://github.com/haytamelyo/SnowMapPy", "Documentation" = "https://github.com/haytamelyo/SnowMapPy#readme" }
|
|
38
|
+
optional-dependencies = { dev = ["pytest>=6.0", "flake8>=3.8", "black>=21.0"] }
|
|
39
|
+
dynamic = []
|
|
@@ -3,8 +3,13 @@ numpy==2.1.0
|
|
|
3
3
|
scipy==1.15.2
|
|
4
4
|
pandas==2.2.3
|
|
5
5
|
|
|
6
|
+
# Python packaging and utilities
|
|
7
|
+
setuptools==75.1.0
|
|
8
|
+
pycrs==1.0.2
|
|
9
|
+
|
|
6
10
|
# Geospatial processing
|
|
7
11
|
rasterio==1.4.3
|
|
12
|
+
rioxarray==0.19.0
|
|
8
13
|
geopandas==1.0.1
|
|
9
14
|
pyproj==3.7.1
|
|
10
15
|
shapely==2.1.0
|
|
@@ -20,6 +25,7 @@ netCDF4==1.7.2
|
|
|
20
25
|
# Google Earth Engine
|
|
21
26
|
earthengine-api==1.5.9
|
|
22
27
|
geemap==0.35.3
|
|
28
|
+
xee==0.0.20
|
|
23
29
|
|
|
24
30
|
# Progress bars and utilities
|
|
25
31
|
tqdm==4.66.4
|
|
@@ -8,27 +8,14 @@ with open("requirements.txt", "r", encoding="utf-8") as fh:
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name="SnowMapPy",
|
|
11
|
-
version="1.0.
|
|
11
|
+
version="1.0.2", # Updated version
|
|
12
12
|
author="Haytam Elyoussfi",
|
|
13
13
|
author_email="haytam.elyoussfi@um6p.ma",
|
|
14
14
|
description="A comprehensive Python package for processing MODIS NDSI data from local files and Google Earth Engine",
|
|
15
15
|
long_description=long_description,
|
|
16
16
|
long_description_content_type="text/markdown",
|
|
17
|
-
url="https://github.com/
|
|
17
|
+
url="https://github.com/haytamelyo/SnowMapPy",
|
|
18
18
|
packages=find_packages(),
|
|
19
|
-
classifiers=[
|
|
20
|
-
"Development Status :: 4 - Beta",
|
|
21
|
-
"Intended Audience :: Science/Research",
|
|
22
|
-
"License :: OSI Approved :: MIT License",
|
|
23
|
-
"Operating System :: OS Independent",
|
|
24
|
-
"Programming Language :: Python :: 3",
|
|
25
|
-
"Programming Language :: Python :: 3.8",
|
|
26
|
-
"Programming Language :: Python :: 3.9",
|
|
27
|
-
"Programming Language :: Python :: 3.10",
|
|
28
|
-
"Programming Language :: Python :: 3.11",
|
|
29
|
-
"Topic :: Scientific/Engineering :: GIS",
|
|
30
|
-
"Topic :: Scientific/Engineering :: Atmospheric Science",
|
|
31
|
-
],
|
|
32
19
|
python_requires=">=3.8",
|
|
33
20
|
install_requires=requirements,
|
|
34
21
|
extras_require={
|
|
@@ -40,8 +27,8 @@ setup(
|
|
|
40
27
|
},
|
|
41
28
|
keywords="modis, snow, remote sensing, earth engine, gis, hydrology",
|
|
42
29
|
project_urls={
|
|
43
|
-
"Bug Reports": "https://github.com/
|
|
44
|
-
"Source": "https://github.com/
|
|
45
|
-
"Documentation": "https://github.com/
|
|
30
|
+
"Bug Reports": "https://github.com/haytamelyo/SnowMapPy/issues",
|
|
31
|
+
"Source": "https://github.com/haytamelyo/SnowMapPy",
|
|
32
|
+
"Documentation": "https://github.com/haytamelyo/SnowMapPy#readme",
|
|
46
33
|
},
|
|
47
34
|
)
|