Skip to content

Commit 797f7d0

Browse files
committed
feat: implement Fekete grid generation with parallel optimization
1 parent add67b4 commit 797f7d0

8 files changed

Lines changed: 1839 additions & 0 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# In-development notebooks
2+
tests/notebooks/dev_*.ipynb
3+
14
# logs
25
*.log
36
tests/logs/

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ The name **DOMINO-SEE** represents our approach to detecting and analyzing inter
3838
- **Multi-dimensional Support**: Native support for `xarray` DataArrays to handle multi-dimensional gridded climate data
3939
- **Parallel Processing**: `dask` integration for efficient processing of large-scale climate datasets
4040
- **Blockwise Computation**: Utilities for splitting large spatial datasets into manageable blocks of netCDF datasets (see `dominosee/utils/blocking.py`).
41+
- **Grid Generation**: Various grid types for spatial analysis including regular, Gaussian, Fibonacci, and Fekete grids.
42+
43+
<!-- ## Development Status
44+
45+
This project is under active development. Current implementation status:
46+
47+
- ✅ **FeketeGrid**: Equidistant grid on a sphere - fully implemented and tested -->
48+
49+
The grid module is being uploaded as a work-in-progress to facilitate collaborative development. Only `BaseGrid` and `FeketeGrid` are currently recommended for production use.
4150

4251
## Getting Started
4352

ROADMAP.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This document outlines the planned future development for the DOMINO-SEE package
99
- [x] Add basic tests to examine the correctness of calculations (In progress)
1010
- [ ] Add advanced tests to examine the bugs in various working environments
1111
- [x] Add basic documentation
12+
- [x] Implement BaseGrid and FeketeGrid classes
13+
- [ ] Complete and test grid implementation
1214
- [ ] Add regrid utilities for remapping to Fekete grid
1315
- [ ] Introduce `xclim` for time period subsetting (specific months/days)
1416
- [ ] Introduce `xclim` for event sub-selection

dominosee/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from . import eca
88
from . import es
99
from . import eventorize
10+
from . import grid
1011
from . import network
1112
from . import utils
1213

dominosee/grid/__init__.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
"""
2+
Grid generation and manipulation utilities for climate data analysis.
3+
4+
This module provides various grid types for spatial analysis including:
5+
- Regular grids (lat/lon)
6+
- Gaussian grids
7+
- Fibonacci sphere grids
8+
- Fekete point grids
9+
10+
The grids are designed to work with climate data and support operations like
11+
regridding, spatial sampling, and network analysis.
12+
"""
13+
14+
# Import main grid classes
15+
from .grid import (
16+
BaseGrid,
17+
RegularGrid,
18+
GaussianGrid,
19+
FibonacciGrid,
20+
FeketeGrid,
21+
)
22+
23+
# Import utility functions from grid module
24+
from .grid import (
25+
grid_num_to_distance,
26+
distance_to_grid_num,
27+
cart_to_geo,
28+
geo_to_cart,
29+
geo_distance,
30+
deg_to_eq_spacing,
31+
eq_spacing_to_deg,
32+
neighbour_distance,
33+
)
34+
35+
# Note: fekete functions are available via .fekete module but not exposed at package level
36+
37+
# Define what gets imported with "from dominosee.grid import *"
38+
__all__ = [
39+
# Main grid classes
40+
'BaseGrid',
41+
'RegularGrid',
42+
'GaussianGrid',
43+
'FibonacciGrid',
44+
'FeketeGrid',
45+
# Utility functions
46+
'grid_num_to_distance',
47+
'distance_to_grid_num',
48+
'cart_to_geo',
49+
'geo_to_cart',
50+
'geo_distance',
51+
'deg_to_eq_spacing',
52+
'eq_spacing_to_deg',
53+
'neighbour_distance',
54+
]

0 commit comments

Comments
 (0)