|
9 | 9 |
|
10 | 10 | A Python package for spatial resampling and binning of geospatial data, specifically designed for oceanographic datasets. This tool enables efficient downsampling of high-resolution gridded data onto coarser grids while preserving spatial accuracy through intelligent neighborhood averaging. |
11 | 11 |
|
| 12 | +## Citation |
| 13 | +[](https://doi.org/10.5281/zenodo.17095448) |
| 14 | + |
| 15 | +If you use this tool in your research, please cite: |
| 16 | + |
| 17 | +```bibtex |
| 18 | +@software{map_binning_2025, |
| 19 | + author = {Chia-Wei Hsu}, |
| 20 | + title = {Map Binning Tool: Spatial Resampling for Oceanographic Data}, |
| 21 | + url = {https://github.com/chiaweh2/map_binning}, |
| 22 | + doi = {10.5281/zenodo.17095448}, |
| 23 | + year = {2025} |
| 24 | +} |
| 25 | +``` |
| 26 | + |
12 | 27 | ## Overview |
13 | 28 |
|
14 | 29 | The Map Binning Tool provides a robust solution for spatial data aggregation, particularly useful for: |
@@ -52,16 +67,6 @@ pip install map-binning[dev] |
52 | 67 |
|
53 | 68 | ## Developer Installation |
54 | 69 |
|
55 | | -### Using conda environment |
56 | | -```bash |
57 | | -# Create and activate conda environment |
58 | | -conda env create -f environment.yml |
59 | | -conda activate map-binning |
60 | | - |
61 | | -# Install the package in development mode |
62 | | -pip install -e . |
63 | | -``` |
64 | | - |
65 | 70 | ### From source |
66 | 71 | ```bash |
67 | 72 | git clone <repository-url> |
@@ -173,52 +178,6 @@ COPERNICUSMARINE_SERVICE_USERNAME=<your_username> |
173 | 178 | COPERNICUSMARINE_SERVICE_PASSWORD=<your_password> |
174 | 179 | ``` |
175 | 180 |
|
176 | | -### Dependencies |
177 | | - |
178 | | -Core dependencies: |
179 | | -- `numpy`: Numerical computing |
180 | | -- `scipy`: Scientific computing (k-d tree algorithms) |
181 | | -- `xarray`: Labeled multi-dimensional arrays |
182 | | -- `netcdf4`: NetCDF file I/O |
183 | | -- `python-dotenv`: Environment variable management |
184 | | - |
185 | | -Development dependencies: |
186 | | -- `pytest`: Unit testing framework |
187 | | -- `black`: Code formatting |
188 | | -- `flake8`: Code linting |
189 | | -- `mypy`: Static type checking |
190 | | - |
191 | | -## Examples |
192 | | - |
193 | | -### Working with CMEMS Data |
194 | | - |
195 | | -```python |
196 | | -import xarray as xr |
197 | | -from map_binning import Binning |
198 | | - |
199 | | -# Example with Copernicus Marine data |
200 | | -ds_high = xr.open_dataset('cmems_high_res_sla.nc') |
201 | | -ds_low = xr.open_dataset('cmems_low_res_grid.nc') |
202 | | - |
203 | | -# Initialize for sea level anomaly processing |
204 | | -sla_binning = Binning( |
205 | | - ds_high=ds_high, |
206 | | - ds_low=ds_low, |
207 | | - var_name='sla', |
208 | | - xdim_name='longitude', |
209 | | - ydim_name='latitude' |
210 | | -) |
211 | | - |
212 | | -# Process and cache the result |
213 | | -binned_sla = sla_binning.mean_binning( |
214 | | - pickle_filename="cmems_sla_index.pkl", |
215 | | - pickle_location="./cache" |
216 | | -) |
217 | | - |
218 | | -# Save the result |
219 | | -binned_sla.to_netcdf('binned_sla_data.nc') |
220 | | -``` |
221 | | - |
222 | 181 | ### Time Series Processing |
223 | 182 |
|
224 | 183 | The tool automatically handles time dimensions: |
@@ -267,36 +226,11 @@ black map_binning/ |
267 | 226 | mypy map_binning/ |
268 | 227 | ``` |
269 | 228 |
|
270 | | -## Testing |
271 | | - |
272 | | -```bash |
273 | | -# Run all tests |
274 | | -pytest |
275 | | - |
276 | | -# Run with coverage |
277 | | -pytest --cov=map_binning |
278 | | - |
279 | | -# Run specific test file |
280 | | -pytest tests/test_main.py |
281 | | -``` |
282 | 229 |
|
283 | 230 | ## License |
284 | 231 |
|
285 | 232 | This project is licensed under the MIT License - see the LICENSE file for details. |
286 | 233 |
|
287 | | -## Citation |
288 | | - |
289 | | -If you use this tool in your research, please cite: |
290 | | - |
291 | | -```bibtex |
292 | | -@software{map_binning_2025, |
293 | | - author = {Chia-Wei Hsu}, |
294 | | - title = {Map Binning Tool: Spatial Resampling for Oceanographic Data}, |
295 | | - url = {https://github.com/chiaweh2/map_binning}, |
296 | | - version = {0.3.2}, |
297 | | - year = {2025} |
298 | | -} |
299 | | -``` |
300 | 234 |
|
301 | 235 | ## Support |
302 | 236 |
|
|
0 commit comments