0
# Land Indicators
1
2
Land surface climate indicators focusing on snow, streamflow, and terrestrial processes for hydrological and agricultural applications. These indicators are essential for water resource management, flood forecasting, and agricultural planning.
3
4
## Capabilities
5
6
### Snow Indicators
7
8
Snow depth and snow water equivalent analysis for hydrological modeling and water resource assessment.
9
10
```python { .api }
11
def snow_depth(snd, freq="YS"):
12
"""
13
Mean snow depth over specified period.
14
15
Parameters:
16
- snd: xr.DataArray, daily snow depth data
17
- freq: str, resampling frequency (default "YS" for yearly)
18
19
Returns:
20
xr.DataArray: Mean snow depth
21
"""
22
23
def snd_max(snd, freq="YS"):
24
"""
25
Maximum snow depth over specified period.
26
27
Parameters:
28
- snd: xr.DataArray, daily snow depth data
29
- freq: str, resampling frequency
30
31
Returns:
32
xr.DataArray: Maximum snow depth
33
"""
34
35
def snd_season_length(snd, thresh="2 cm", freq="YS"):
36
"""
37
Length of snow season based on snow depth threshold.
38
39
Parameters:
40
- snd: xr.DataArray, daily snow depth data
41
- thresh: str or float, snow depth threshold (default "2 cm")
42
- freq: str, resampling frequency
43
44
Returns:
45
xr.DataArray: Snow season length in days
46
"""
47
48
def continuous_snow_season_start(snd, thresh="2 cm", window=5, freq="YS"):
49
"""
50
Start date of continuous snow season.
51
52
Parameters:
53
- snd: xr.DataArray, daily snow depth data
54
- thresh: str or float, snow depth threshold (default "2 cm")
55
- window: int, minimum number of consecutive days (default 5)
56
- freq: str, resampling frequency
57
58
Returns:
59
xr.DataArray: Snow season start day of year
60
"""
61
62
def continuous_snow_season_end(snd, thresh="2 cm", window=5, freq="YS"):
63
"""
64
End date of continuous snow season.
65
66
Parameters:
67
- snd: xr.DataArray, daily snow depth data
68
- thresh: str or float, snow depth threshold (default "2 cm")
69
- window: int, minimum number of consecutive days (default 5)
70
- freq: str, resampling frequency
71
72
Returns:
73
xr.DataArray: Snow season end day of year
74
"""
75
76
def snw_max(snw, freq="YS"):
77
"""
78
Maximum snow water equivalent.
79
80
Parameters:
81
- snw: xr.DataArray, daily snow water equivalent data
82
- freq: str, resampling frequency
83
84
Returns:
85
xr.DataArray: Maximum snow water equivalent
86
"""
87
88
def melt_and_precip_max(snw, pr, window=3, freq="YS"):
89
"""
90
Maximum snow melt and precipitation sum over window.
91
92
Parameters:
93
- snw: xr.DataArray, daily snow water equivalent data
94
- pr: xr.DataArray, daily precipitation data
95
- window: int, window size in days (default 3)
96
- freq: str, resampling frequency
97
98
Returns:
99
xr.DataArray: Maximum combined melt and precipitation
100
"""
101
```
102
103
### Streamflow Indicators
104
105
Streamflow characteristics and hydrological indices for river flow analysis and flood risk assessment.
106
107
```python { .api }
108
def base_flow_index(q, freq="YS"):
109
"""
110
Base flow index (ratio of base flow to total flow).
111
112
Parameters:
113
- q: xr.DataArray, daily streamflow data
114
- freq: str, resampling frequency
115
116
Returns:
117
xr.DataArray: Base flow index (0-1)
118
"""
119
120
def rb_flashiness_index(q, freq="YS"):
121
"""
122
Richards-Baker flashiness index for flow variability.
123
124
Parameters:
125
- q: xr.DataArray, daily streamflow data
126
- freq: str, resampling frequency
127
128
Returns:
129
xr.DataArray: Flashiness index
130
"""
131
132
def snd_storm_days(snd, thresh="10 cm", freq="YS"):
133
"""
134
Number of snow storm days (large daily snow depth increases).
135
136
Parameters:
137
- snd: xr.DataArray, daily snow depth data
138
- thresh: str or float, storm threshold (default "10 cm")
139
- freq: str, resampling frequency
140
141
Returns:
142
xr.DataArray: Number of snow storm days
143
"""
144
145
def high_flow_frequency(q, thresh="90%", freq="YS"):
146
"""
147
Frequency of high flow events above threshold.
148
149
Parameters:
150
- q: xr.DataArray, daily streamflow data
151
- thresh: str or float, flow threshold (default "90%" for 90th percentile)
152
- freq: str, resampling frequency
153
154
Returns:
155
xr.DataArray: Number of high flow events
156
"""
157
158
def low_flow_frequency(q, thresh="10%", freq="YS"):
159
"""
160
Frequency of low flow events below threshold.
161
162
Parameters:
163
- q: xr.DataArray, daily streamflow data
164
- thresh: str or float, flow threshold (default "10%" for 10th percentile)
165
- freq: str, resampling frequency
166
167
Returns:
168
xr.DataArray: Number of low flow events
169
"""
170
```
171
172
## Usage Examples
173
174
### Snow Analysis
175
176
```python
177
import xarray as xr
178
import xclim.land as xcl
179
180
# Load snow depth data
181
snd = xr.open_dataset("snow_data.nc").snd
182
183
# Calculate snow indicators
184
max_snow = xcl.snd_max(snd, freq="YS")
185
season_length = xcl.snd_season_length(snd, thresh="5 cm", freq="YS")
186
season_start = xcl.continuous_snow_season_start(
187
snd, thresh="5 cm", window=10, freq="YS"
188
)
189
```
190
191
### Streamflow Analysis
192
193
```python
194
# Load streamflow data
195
q = xr.open_dataset("streamflow.nc").discharge
196
197
# Calculate streamflow indicators
198
base_flow = xcl.base_flow_index(q, freq="YS")
199
flashiness = xcl.rb_flashiness_index(q, freq="YS")
200
high_flows = xcl.high_flow_frequency(q, thresh="95%", freq="YS")
201
```