ngiab-data-preprocess 4.6.4__py3-none-any.whl → 4.6.5__py3-none-any.whl
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.
- data_processing/dataset_utils.py +9 -6
- data_processing/forcings.py +1 -1
- map_app/static/css/main.css +140 -32
- map_app/static/css/toggle.css +111 -20
- map_app/static/js/main.js +31 -43
- map_app/templates/index.html +55 -15
- {ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/METADATA +1 -3
- {ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/RECORD +12 -12
- {ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/WHEEL +0 -0
- {ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/entry_points.txt +0 -0
- {ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/licenses/LICENSE +0 -0
- {ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/top_level.txt +0 -0
data_processing/dataset_utils.py
CHANGED
|
@@ -115,11 +115,12 @@ def clip_dataset_to_bounds(
|
|
|
115
115
|
logger.info("Selected time range and clipped to bounds")
|
|
116
116
|
return dataset
|
|
117
117
|
|
|
118
|
+
|
|
118
119
|
@temp_cluster
|
|
119
120
|
def save_dataset(
|
|
120
121
|
ds_to_save: xr.Dataset,
|
|
121
122
|
target_path: Path,
|
|
122
|
-
engine: Literal["netcdf4", "scipy"
|
|
123
|
+
engine: Literal["netcdf4", "scipy"] = "netcdf4",
|
|
123
124
|
):
|
|
124
125
|
"""
|
|
125
126
|
Helper function to compute and save an xarray.Dataset (specifically, the raw
|
|
@@ -148,9 +149,7 @@ def save_dataset(
|
|
|
148
149
|
|
|
149
150
|
|
|
150
151
|
@no_cluster
|
|
151
|
-
def save_to_cache(
|
|
152
|
-
stores: xr.Dataset, cached_nc_path: Path
|
|
153
|
-
) -> xr.Dataset:
|
|
152
|
+
def save_to_cache(stores: xr.Dataset, cached_nc_path: Path) -> xr.Dataset:
|
|
154
153
|
"""
|
|
155
154
|
Compute the store and save it to a cached netCDF file. This is not required but will save time and bandwidth.
|
|
156
155
|
"""
|
|
@@ -164,7 +163,7 @@ def save_to_cache(
|
|
|
164
163
|
# save dataset locally before manipulating it
|
|
165
164
|
save_dataset(stores, cached_nc_path)
|
|
166
165
|
|
|
167
|
-
stores = xr.open_mfdataset(cached_nc_path, parallel=True, engine="
|
|
166
|
+
stores = xr.open_mfdataset(cached_nc_path, parallel=True, engine="netcdf4")
|
|
168
167
|
return stores
|
|
169
168
|
|
|
170
169
|
|
|
@@ -183,7 +182,11 @@ def check_local_cache(
|
|
|
183
182
|
|
|
184
183
|
logger.info("Found cached nc file")
|
|
185
184
|
# open the cached file and check that the time range is correct
|
|
186
|
-
|
|
185
|
+
try:
|
|
186
|
+
cached_data = xr.open_mfdataset(cached_nc_path, parallel=True, engine="netcdf4")
|
|
187
|
+
except:
|
|
188
|
+
logger.info("Cache produced with outdated backend, redownloading")
|
|
189
|
+
return
|
|
187
190
|
|
|
188
191
|
if "name" not in cached_data.attrs or "name" not in remote_dataset.attrs:
|
|
189
192
|
logger.warning("No name attribute found to compare datasets")
|
data_processing/forcings.py
CHANGED
|
@@ -117,7 +117,6 @@ def get_cell_weights(raster: xr.Dataset, gdf: gpd.GeoDataFrame, wkt: str) -> pd.
|
|
|
117
117
|
) # type: ignore
|
|
118
118
|
return output.set_index("divide_id")
|
|
119
119
|
|
|
120
|
-
|
|
121
120
|
def add_APCP_SURFACE_to_dataset(dataset: xr.Dataset) -> xr.Dataset:
|
|
122
121
|
"""Convert precipitation value to correct units."""
|
|
123
122
|
# precip_rate is mm/s
|
|
@@ -576,4 +575,5 @@ def create_forcings(dataset: xr.Dataset, output_folder_name: str) -> None:
|
|
|
576
575
|
gdf = gpd.read_file(forcing_paths.geopackage_path, layer="divides")
|
|
577
576
|
logger.debug(f"gdf bounds: {gdf.total_bounds}")
|
|
578
577
|
gdf = gdf.to_crs(dataset.crs)
|
|
578
|
+
dataset = dataset.isel(y=slice(None, None, -1)) # Flip y-axis: source data has y ordered from top-to-bottom (as in image arrays), but geospatial operations expect y to increase from bottom-to-top (increasing latitude).
|
|
579
579
|
compute_zonal_stats(gdf, dataset, forcing_paths.forcings_dir)
|
map_app/static/css/main.css
CHANGED
|
@@ -30,38 +30,6 @@ main {
|
|
|
30
30
|
background: var(--surface-color) !important;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
#toggle-button-gages, #toggle-button-camels, #toggle-button-nwm, #toggle-button-aorc {
|
|
34
|
-
position: relative;
|
|
35
|
-
top: 20px;
|
|
36
|
-
left: 20px;
|
|
37
|
-
background-color: light-dark(rgb(87, 27, 98), rgb(147, 51, 164));
|
|
38
|
-
color: light-dark(#f0ead6, #ffffff);
|
|
39
|
-
font-size: 1.2rem;
|
|
40
|
-
min-width: 70px;
|
|
41
|
-
border-radius: 5px;
|
|
42
|
-
border: none;
|
|
43
|
-
padding: 5px 10px;
|
|
44
|
-
transition: 0.3s;
|
|
45
|
-
z-index: 1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
#toggle-button-gages:hover, #toggle-button-camels:hover, #toggle-button-nwm:hover, #toggle-button-aorc:hover {
|
|
49
|
-
scale: 1.1;
|
|
50
|
-
box-shadow: var(--shadow-md);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
#toggle-button-camels {
|
|
54
|
-
left: 30px;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
#toggle-button-nwm {
|
|
58
|
-
left: 40px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
#toggle-button-aorc {
|
|
62
|
-
left: 50px;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
33
|
body {
|
|
66
34
|
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
|
67
35
|
margin: 0;
|
|
@@ -96,6 +64,25 @@ h2 {
|
|
|
96
64
|
margin: 16px 0;
|
|
97
65
|
}
|
|
98
66
|
|
|
67
|
+
h3 {
|
|
68
|
+
font-size: 1.5rem;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
color: var(--text-color);
|
|
71
|
+
margin: 12px 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
h4 {
|
|
75
|
+
font-size: 1rem;
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
color: var(--text-color);
|
|
78
|
+
margin: 12px 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
h4.menu-header {
|
|
82
|
+
position: relative;
|
|
83
|
+
top: -35px;
|
|
84
|
+
}
|
|
85
|
+
|
|
99
86
|
#map-container {
|
|
100
87
|
background: var(--surface-color);
|
|
101
88
|
border-radius: var(--border-radius);
|
|
@@ -358,4 +345,125 @@ input[type="datetime-local"] {
|
|
|
358
345
|
margin: auto;
|
|
359
346
|
width: 100%;
|
|
360
347
|
text-align: center;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/* Menu code starts here */
|
|
351
|
+
|
|
352
|
+
#menuToggle
|
|
353
|
+
{
|
|
354
|
+
display: block;
|
|
355
|
+
/* You can also use relative/absolute here if you want to stay on the top */
|
|
356
|
+
position: absolute;
|
|
357
|
+
top: 20px;
|
|
358
|
+
left: 20px;
|
|
359
|
+
pointer-events: none;
|
|
360
|
+
z-index: 1;
|
|
361
|
+
pointer-events: none;
|
|
362
|
+
-webkit-user-select: none;
|
|
363
|
+
user-select: none;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
#menuToggle input
|
|
367
|
+
{
|
|
368
|
+
display: block;
|
|
369
|
+
width: 45px;
|
|
370
|
+
height: 45px;
|
|
371
|
+
position: absolute;
|
|
372
|
+
top: -7px;
|
|
373
|
+
left: -7px;
|
|
374
|
+
pointer-events: auto;
|
|
375
|
+
cursor: pointer;
|
|
376
|
+
pointer-events: auto;
|
|
377
|
+
|
|
378
|
+
opacity: 0; /* hide this */
|
|
379
|
+
z-index: 2; /* and place it over the hamburger */
|
|
380
|
+
|
|
381
|
+
-webkit-touch-callout: none;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
#menu
|
|
385
|
+
{
|
|
386
|
+
position: relative;
|
|
387
|
+
width: 300px;
|
|
388
|
+
height: 375px;
|
|
389
|
+
margin: -120px 0 0 -50px;
|
|
390
|
+
padding-left: 50px;
|
|
391
|
+
padding-top: 75px;
|
|
392
|
+
padding-bottom: 30px;
|
|
393
|
+
box-sizing: border-box;
|
|
394
|
+
/* overflow-y: auto; */
|
|
395
|
+
background: light-dark(rgba(237,237,237,0.85), rgba(102,102,102,0.85));
|
|
396
|
+
backdrop-filter: blur(1px);
|
|
397
|
+
border-radius: var(--border-radius);
|
|
398
|
+
list-style-type: none;
|
|
399
|
+
-webkit-font-smoothing: antialiased;
|
|
400
|
+
/* to stop flickering of text in safari */
|
|
401
|
+
transform-origin: 0% 0%;
|
|
402
|
+
transform: translate(-100%, 0);
|
|
403
|
+
|
|
404
|
+
transition: transform 0.5s cubic-bezier(0.77,0.2,0.05,1.0);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
#menu li
|
|
408
|
+
{
|
|
409
|
+
padding: 10px 0;
|
|
410
|
+
font-size: 22px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
#menu li label
|
|
414
|
+
{
|
|
415
|
+
cursor: pointer;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/*
|
|
419
|
+
* And let's slide it in from the left
|
|
420
|
+
*/
|
|
421
|
+
#menuToggle input:checked ~ ul
|
|
422
|
+
{
|
|
423
|
+
transform: none;
|
|
424
|
+
pointer-events: auto;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.icons {
|
|
428
|
+
position: relative;
|
|
429
|
+
width: 40px;
|
|
430
|
+
height: 40px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.icons svg {
|
|
434
|
+
|
|
435
|
+
width: 100%;
|
|
436
|
+
height: 100%;
|
|
437
|
+
transition: opacity 0.3s ease, z-index 0.3s;
|
|
438
|
+
fill: light-dark(#1e293b, #f1f5f9);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
.icons .chevron-left {
|
|
443
|
+
position: absolute;
|
|
444
|
+
top: -45px;
|
|
445
|
+
left: 195px;
|
|
446
|
+
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
#menuToggle input:checked ~ .icons .gear {
|
|
450
|
+
opacity: 0;
|
|
451
|
+
z-index: 0;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
#menuToggle input:checked
|
|
455
|
+
{
|
|
456
|
+
display: block;
|
|
457
|
+
width: 45px;
|
|
458
|
+
height: 45px;
|
|
459
|
+
position: absolute;
|
|
460
|
+
top: -7px;
|
|
461
|
+
left: 190px;
|
|
462
|
+
|
|
463
|
+
cursor: pointer;
|
|
464
|
+
|
|
465
|
+
opacity: 0; /* hide this */
|
|
466
|
+
z-index: 2; /* and place it over the hamburger */
|
|
467
|
+
|
|
468
|
+
-webkit-touch-callout: none;
|
|
361
469
|
}
|
map_app/static/css/toggle.css
CHANGED
|
@@ -84,31 +84,122 @@
|
|
|
84
84
|
color: #888; /* Grey color for non-selected text */
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
z-index: 10;
|
|
93
|
-
width: 240px;
|
|
87
|
+
.menu-switch {
|
|
88
|
+
margin: 5px;
|
|
89
|
+
position: relative;
|
|
90
|
+
display: block;
|
|
91
|
+
top: -40px;
|
|
94
92
|
}
|
|
95
93
|
|
|
96
|
-
.
|
|
97
|
-
|
|
94
|
+
.menu-switch__input {
|
|
95
|
+
opacity: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
appearance: none;
|
|
99
|
+
position: absolute;
|
|
98
100
|
}
|
|
99
101
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
left: 20px;
|
|
102
|
+
.menu-switch__input:checked ~ .menu-switch__label::before {
|
|
103
|
+
background: #007bff;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
.menu-switch__input:checked ~ .menu-switch__label::after {
|
|
107
|
+
border-color: #007bff;
|
|
108
|
+
transform: translate(23px, -50%);
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
.menu-switch__label {
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
padding-left: 60px;
|
|
114
|
+
position: relative;
|
|
115
|
+
display: inline-block;
|
|
116
|
+
font-size: 0.9rem;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.menu-switch__label::before,
|
|
120
|
+
.menu-switch__label::after {
|
|
121
|
+
content: '';
|
|
122
|
+
left: 0;
|
|
123
|
+
position: absolute;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.menu-switch__label::before {
|
|
127
|
+
top: 50%;
|
|
128
|
+
width: 30px;
|
|
129
|
+
height: 12px;
|
|
130
|
+
border-radius: 20px;
|
|
131
|
+
transform: translateY(-50%);
|
|
132
|
+
background: #ccc;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.menu-switch__label::after {
|
|
136
|
+
top: 50%;
|
|
137
|
+
width: 16px;
|
|
138
|
+
height: 16px;
|
|
139
|
+
border-radius: 100%;
|
|
140
|
+
transition: transform .3s;
|
|
141
|
+
background: #fff;
|
|
142
|
+
transform: translate(0, -50%);
|
|
143
|
+
border: 2px solid #ccc;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.radio {
|
|
147
|
+
margin: 0.5rem;
|
|
148
|
+
font-size: 0.9rem;
|
|
149
|
+
top: -35px;
|
|
150
|
+
position: relative;
|
|
151
|
+
input[type="radio"] {
|
|
152
|
+
position: absolute;
|
|
153
|
+
opacity: 0;
|
|
154
|
+
+ .radio-label {
|
|
155
|
+
&:before {
|
|
156
|
+
content: '';
|
|
157
|
+
background: #ccc;
|
|
158
|
+
border-radius: 100%;
|
|
159
|
+
border: 1px solid darken(#ccc, 25%);
|
|
160
|
+
display: inline-block;
|
|
161
|
+
width: 1.4em;
|
|
162
|
+
height: 1.4em;
|
|
163
|
+
position: relative;
|
|
164
|
+
top: -0.2em;
|
|
165
|
+
margin-right: 1em;
|
|
166
|
+
vertical-align: top;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
text-align: center;
|
|
169
|
+
transition: all 250ms ease;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
&:checked {
|
|
173
|
+
+ .radio-label {
|
|
174
|
+
&:before {
|
|
175
|
+
background-color: #007bff;
|
|
176
|
+
box-shadow: inset 0 0 0 4px #ccc;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
&:focus {
|
|
181
|
+
+ .radio-label {
|
|
182
|
+
&:before {
|
|
183
|
+
outline: none;
|
|
184
|
+
border-color: #ccc;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
&:disabled {
|
|
189
|
+
+ .radio-label {
|
|
190
|
+
&:before {
|
|
191
|
+
box-shadow: inset 0 0 0 4px #ccc;
|
|
192
|
+
border-color: darken(#ccc, 25%);
|
|
193
|
+
background: darken(#007bff, 25%);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
+ .radio-label {
|
|
198
|
+
&:empty {
|
|
199
|
+
&:before {
|
|
200
|
+
margin-right: 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
map_app/static/js/main.js
CHANGED
|
@@ -135,7 +135,7 @@ function update_map(cat_id, e) {
|
|
|
135
135
|
map.setFilter('upstream-catchments', ['any', ['in', 'divide_id', ""]])
|
|
136
136
|
// get the position of the subset toggle
|
|
137
137
|
// false means subset by nexus, true means subset by catchment
|
|
138
|
-
var nexus_catchment = document.getElementById('
|
|
138
|
+
var nexus_catchment = document.getElementById('radio-catchment').checked;
|
|
139
139
|
var subset_type = nexus_catchment ? 'catchment' : 'nexus';
|
|
140
140
|
console.log('subset_type:', subset_type);
|
|
141
141
|
|
|
@@ -180,8 +180,16 @@ map.on('click', 'catchments', (e) => {
|
|
|
180
180
|
update_map(cat_id, e);
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
184
|
-
document.getElementById("
|
|
183
|
+
// if subset radio buttons changed while there's already a subset displayed
|
|
184
|
+
document.getElementById("radio-catchment").addEventListener('change', function() {
|
|
185
|
+
const cat_id = document.getElementById('selected-basins').textContent;
|
|
186
|
+
if (cat_id && cat_id !== 'None - get clicking!' && lastClickedLngLat) {
|
|
187
|
+
// Create a fake event with the last clicked location
|
|
188
|
+
const fakeEvent = { lngLat: lastClickedLngLat };
|
|
189
|
+
update_map(cat_id, fakeEvent);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
document.getElementById("radio-nexus").addEventListener('change', function() {
|
|
185
193
|
const cat_id = document.getElementById('selected-basins').textContent;
|
|
186
194
|
if (cat_id && cat_id !== 'None - get clicking!' && lastClickedLngLat) {
|
|
187
195
|
// Create a fake event with the last clicked location
|
|
@@ -258,58 +266,38 @@ function initializeToggleSwitches() {
|
|
|
258
266
|
}
|
|
259
267
|
document.addEventListener("DOMContentLoaded", initializeToggleSwitches);
|
|
260
268
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
map.setFilter("conus_gages", ["any", ["==", "hl_uri", ""]]);
|
|
266
|
-
toggleButtonGages.innerText = "Show gages";
|
|
267
|
-
showGages = false;
|
|
269
|
+
const toggleSwitchGages = document.querySelector("#gages__input");
|
|
270
|
+
toggleSwitchGages.addEventListener("change", function () {
|
|
271
|
+
if (toggleSwitchGages.checked) {
|
|
272
|
+
map.setFilter("conus_gages", null); // show gages
|
|
268
273
|
} else {
|
|
269
|
-
map.setFilter("conus_gages",
|
|
270
|
-
toggleButtonGages.innerText = "Hide gages";
|
|
271
|
-
showGages = true;
|
|
274
|
+
map.setFilter("conus_gages", ["any", ["==", "hl_uri", ""]]); // hide gages
|
|
272
275
|
}
|
|
273
276
|
});
|
|
274
277
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
map.setFilter("camels", ["any", ["==", "hru_id", ""]]);
|
|
280
|
-
toggleButtonCamels.innerText = "Show CAMELS basins";
|
|
281
|
-
showCamels = false;
|
|
278
|
+
const toggleSwitchCamels = document.querySelector("#camels__input");
|
|
279
|
+
toggleSwitchCamels.addEventListener("change", function () {
|
|
280
|
+
if (toggleSwitchCamels.checked) {
|
|
281
|
+
map.setFilter("camels", null);
|
|
282
282
|
} else {
|
|
283
|
-
map.setFilter("camels",
|
|
284
|
-
toggleButtonCamels.innerText = "Hide CAMELS basins";
|
|
285
|
-
showCamels = true;
|
|
283
|
+
map.setFilter("camels", ["any", ["==", "hl_uri", ""]]);
|
|
286
284
|
}
|
|
287
285
|
});
|
|
288
286
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
map.setFilter("nwm_zarr_chunks", ["any"]);
|
|
294
|
-
toggleButtonNwm.innerText = "Overlay NWM chunks";
|
|
295
|
-
showNwm = false;
|
|
287
|
+
const toggleSwitchNwm = document.querySelector("#nwm__input");
|
|
288
|
+
toggleSwitchNwm.addEventListener("change", function () {
|
|
289
|
+
if (toggleSwitchNwm.checked) {
|
|
290
|
+
map.setFilter("nwm_zarr_chunks", null);
|
|
296
291
|
} else {
|
|
297
|
-
map.setFilter("nwm_zarr_chunks",
|
|
298
|
-
toggleButtonNwm.innerText = "Hide NWM chunks";
|
|
299
|
-
showNwm = true;
|
|
292
|
+
map.setFilter("nwm_zarr_chunks", ["any", ["==", "hl_uri", ""]]);
|
|
300
293
|
}
|
|
301
294
|
});
|
|
302
295
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
map.setFilter("aorc_zarr_chunks", ["any"]);
|
|
308
|
-
toggleButtonAorc.innerText = "Overlay AORC chunks";
|
|
309
|
-
showAorc = false;
|
|
296
|
+
const toggleSwitchAorc = document.querySelector("#aorc__input");
|
|
297
|
+
toggleSwitchAorc.addEventListener("change", function () {
|
|
298
|
+
if (toggleSwitchAorc.checked) {
|
|
299
|
+
map.setFilter("aorc_zarr_chunks", null);
|
|
310
300
|
} else {
|
|
311
|
-
map.setFilter("aorc_zarr_chunks",
|
|
312
|
-
toggleButtonAorc.innerText = "Hide AORC chunks";
|
|
313
|
-
showAorc = true;
|
|
301
|
+
map.setFilter("aorc_zarr_chunks", ["any", ["==", "hl_uri", ""]]);
|
|
314
302
|
}
|
|
315
303
|
});
|
map_app/templates/index.html
CHANGED
|
@@ -23,19 +23,59 @@
|
|
|
23
23
|
<main>
|
|
24
24
|
<section id="map-container">
|
|
25
25
|
<div id="map">
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
<nav role="navigation">
|
|
27
|
+
<div id="menuToggle">
|
|
28
|
+
<!--
|
|
29
|
+
A fake / hidden checkbox is used as click reciever,
|
|
30
|
+
so you can use the :checked selector on it.
|
|
31
|
+
-->
|
|
32
|
+
<input type="checkbox" id="menuCheckbox" />
|
|
33
|
+
<div class="icons">
|
|
34
|
+
<svg class="gear" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
|
35
|
+
<path d="M195.1 9.5C198.1-5.3 211.2-16 226.4-16l59.8 0c15.2 0 28.3 10.7 31.3 25.5L332 79.5c14.1 6 27.3 13.7 39.3 22.8l67.8-22.5c14.4-4.8 30.2 1.2 37.8 14.4l29.9 51.8c7.6 13.2 4.9 29.8-6.5 39.9L447 233.3c.9 7.4 1.3 15 1.3 22.7s-.5 15.3-1.3 22.7l53.4 47.5c11.4 10.1 14 26.8 6.5 39.9l-29.9 51.8c-7.6 13.1-23.4 19.2-37.8 14.4l-67.8-22.5c-12.1 9.1-25.3 16.7-39.3 22.8l-14.4 69.9c-3.1 14.9-16.2 25.5-31.3 25.5l-59.8 0c-15.2 0-28.3-10.7-31.3-25.5l-14.4-69.9c-14.1-6-27.2-13.7-39.3-22.8L73.5 432.3c-14.4 4.8-30.2-1.2-37.8-14.4L5.8 366.1c-7.6-13.2-4.9-29.8 6.5-39.9l53.4-47.5c-.9-7.4-1.3-15-1.3-22.7s.5-15.3 1.3-22.7L12.3 185.8c-11.4-10.1-14-26.8-6.5-39.9L35.7 94.1c7.6-13.2 23.4-19.2 37.8-14.4l67.8 22.5c12.1-9.1 25.3-16.7 39.3-22.8L195.1 9.5zM256.3 336a80 80 0 1 0 -.6-160 80 80 0 1 0 .6 160z"/>
|
|
36
|
+
</svg>
|
|
37
|
+
</div>
|
|
38
|
+
<ul id="menu"> <h2>Map Settings</h2>
|
|
39
|
+
<div class="icons">
|
|
40
|
+
<svg class="chevron-left" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.0.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.-->
|
|
41
|
+
<path d="M169.4 297.4C156.9 309.9 156.9 330.2 169.4 342.7L361.4 534.7C373.9 547.2 394.2 547.2 406.7 534.7C419.2 522.2 419.2 501.9 406.7 489.4L237.3 320L406.6 150.6C419.1 138.1 419.1 117.8 406.6 105.3C394.1 92.8 373.8 92.8 361.3 105.3L169.3 297.3z"/>
|
|
42
|
+
</svg>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="menu-switch">
|
|
45
|
+
<input type="checkbox" class="menu-switch__input gages__input" id="gages__input">
|
|
46
|
+
<label for="gages__input" class="menu-switch__label">Show gages</label>
|
|
47
|
+
</div>
|
|
48
|
+
<div class="menu-switch">
|
|
49
|
+
<input type="checkbox" class="menu-switch__input camels__input" id="camels__input">
|
|
50
|
+
<label for="camels__input" class="menu-switch__label">Show CAMELS basins</label>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="menu-switch">
|
|
53
|
+
<input type="checkbox" class="menu-switch__input nwm__input" id="nwm__input">
|
|
54
|
+
<label for="nwm__input" class="menu-switch__label">Show NWM chunks</label>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="menu-switch">
|
|
57
|
+
<input type="checkbox" class="menu-switch__input aorc__input" id="aorc__input">
|
|
58
|
+
<label for="aorc__input" class="menu-switch__label">Show AORC chunks</label>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<h4 class="menu-header">Subset type</h4>
|
|
62
|
+
<div class="radio">
|
|
63
|
+
<input id="radio-nexus" name="radio" type="radio" checked>
|
|
64
|
+
<label for="radio-nexus" class="radio-label">Subset by nexus</label>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="radio">
|
|
68
|
+
<input id="radio-catchment" name="radio" type="radio">
|
|
69
|
+
<label for="radio-catchment" class="radio-label">Subset by catchment</label>
|
|
70
|
+
</div>
|
|
71
|
+
<!-- <button id="toggle-button-gages">Show gages</button>
|
|
72
|
+
<button id="toggle-button-camels">Show CAMELS basins</button>
|
|
73
|
+
<button id="toggle-button-nwm">Overlay NWM chunks</button>
|
|
74
|
+
<button id="toggle-button-aorc">Overlay AORC chunks</button> -->
|
|
75
|
+
</ul>
|
|
76
|
+
</div>
|
|
77
|
+
</nav>
|
|
78
|
+
|
|
39
79
|
</div>
|
|
40
80
|
|
|
41
81
|
<div class="command-container">
|
|
@@ -58,8 +98,8 @@
|
|
|
58
98
|
</button>
|
|
59
99
|
</div>
|
|
60
100
|
<div id="command-builder">
|
|
61
|
-
<
|
|
62
|
-
<
|
|
101
|
+
<span id="cli-prefix" class="command-content">uvx --from ngiab_data_preprocess cli </span>
|
|
102
|
+
<span id="cli-command" class="command-content"></span>
|
|
63
103
|
</div>
|
|
64
104
|
</div>
|
|
65
105
|
<script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ngiab_data_preprocess
|
|
3
|
-
Version: 4.6.
|
|
3
|
+
Version: 4.6.5
|
|
4
4
|
Summary: Graphical Tools for creating Next Gen Water model input data.
|
|
5
5
|
Author-email: Josh Cunningham <jcunningham8@ua.edu>
|
|
6
6
|
Project-URL: Homepage, https://github.com/CIROH-UA/NGIAB_data_preprocess
|
|
@@ -23,7 +23,6 @@ Requires-Dist: zarr==2.17.1
|
|
|
23
23
|
Requires-Dist: netCDF4<1.7.3,>=1.6.5
|
|
24
24
|
Requires-Dist: dask==2024.4.1
|
|
25
25
|
Requires-Dist: dask[distributed]==2024.4.1
|
|
26
|
-
Requires-Dist: h5netcdf==1.3.0
|
|
27
26
|
Requires-Dist: exactextract==0.2.0
|
|
28
27
|
Requires-Dist: numpy>=1.26.4
|
|
29
28
|
Requires-Dist: tqdm==4.66.4
|
|
@@ -33,7 +32,6 @@ Requires-Dist: bokeh==3.5.1
|
|
|
33
32
|
Requires-Dist: boto3
|
|
34
33
|
Requires-Dist: numcodecs<0.16.0
|
|
35
34
|
Requires-Dist: scipy>=1.15.3
|
|
36
|
-
Requires-Dist: h5py<=3.11
|
|
37
35
|
Provides-Extra: eval
|
|
38
36
|
Requires-Dist: ngiab_eval; extra == "eval"
|
|
39
37
|
Provides-Extra: plot
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
data_processing/create_realization.py,sha256=b1a9Wuld9saJ-zzVDPY_kba3-ZOVbRuobyR-QiHLXyY,11550
|
|
2
2
|
data_processing/dask_utils.py,sha256=A2IP94WAz8W9nek3etXKEKTOxGPf0NWSFLh8cZ5S-xU,2454
|
|
3
|
-
data_processing/dataset_utils.py,sha256=
|
|
3
|
+
data_processing/dataset_utils.py,sha256=pZpY4xvOKp4Sd44olRvEHi4dXP-kmOylWzVqU9QT69w,8407
|
|
4
4
|
data_processing/datasets.py,sha256=_EJ1uZSWTU1HWpvF7TQSikneJqWZFikTrdo9usCV8A0,4665
|
|
5
5
|
data_processing/file_paths.py,sha256=7MpwfIQewLRrDpAw1dxTjTperUwOk3EC_kthmnJSRII,4851
|
|
6
|
-
data_processing/forcings.py,sha256=
|
|
6
|
+
data_processing/forcings.py,sha256=G_g3VSM_YN-k4FrbnUByrDR4n3fk1GVfv74kamit2CI,21775
|
|
7
7
|
data_processing/gpkg_utils.py,sha256=VoQG53zaGcdmkU9M_7kRrk_vygRGJV9E-wX-T48Rzj8,20576
|
|
8
8
|
data_processing/graph_utils.py,sha256=4D72wMSiCRKCPC7JUz7XCoaISRGLuqDx6wpeO_VP8fk,8301
|
|
9
9
|
data_processing/s3fs_utils.py,sha256=ki1EmA0ezV0r26re6dRWIGzL5FudGdwF9Qw1eVLR0Bc,2747
|
|
@@ -23,21 +23,21 @@ map_app/__init__.py,sha256=OarJao9X98kcbLyiwewN4ObWNAYkKDichcxbuWywTsA,818
|
|
|
23
23
|
map_app/__main__.py,sha256=5qJGypfesfdWDWRsbTQiMs3uL5zPZKRZQq31l7qXqCc,1649
|
|
24
24
|
map_app/views.py,sha256=AxLsXL8ZSnRJzg5zVYDGfVFA_6amgae41AO_E1G7W58,7923
|
|
25
25
|
map_app/static/css/console.css,sha256=xN6G2MMFyKc9YW9HEVpUUTUjx2o2nokBR4nCX5c18UM,803
|
|
26
|
-
map_app/static/css/main.css,sha256=
|
|
27
|
-
map_app/static/css/toggle.css,sha256=
|
|
26
|
+
map_app/static/css/main.css,sha256=pYIIk-dXW6YMpliSJKATdvgPhFVY6K26NeUuHoYyJqg,8736
|
|
27
|
+
map_app/static/css/toggle.css,sha256=W-qopD2OYbciPuxtUvvQZpzAc75ps3404JhtPJ621K8,4140
|
|
28
28
|
map_app/static/js/console.js,sha256=BnG0pED5B9d563sLWshDNt_q-SyoTY48sETvVoOVJkU,1377
|
|
29
29
|
map_app/static/js/data_processing.js,sha256=sfeXvfPtiOvEN1kDFFtibLDOjwyudOpeOjmfXuTcR7Y,8583
|
|
30
|
-
map_app/static/js/main.js,sha256=
|
|
30
|
+
map_app/static/js/main.js,sha256=wtLZ18hPZbnyo28dRGsOf-CAHCGxqe1PWEAGa6-S4tg,10932
|
|
31
31
|
map_app/static/resources/loading.gif,sha256=ggdkZf1AD7rSwIpSJwfiIqANgmVV1WHlxGuKxQKv7uY,72191
|
|
32
32
|
map_app/static/resources/screenshot.jpg,sha256=Ia358aX-OHM9BP4B8lX05cLnguF2fHUIimno9bnFLYw,253730
|
|
33
|
-
map_app/templates/index.html,sha256=
|
|
33
|
+
map_app/templates/index.html,sha256=qgQxvaJgkU8Ul57dMLX5n0O3BrwMow-CxGPH7_8yjXc,12195
|
|
34
34
|
ngiab_data_cli/__main__.py,sha256=_8IFqL2CGZGMsC71uutqHOIjZpfYBD91yKTk4dvEa3c,11318
|
|
35
35
|
ngiab_data_cli/arguments.py,sha256=97BFzlj68tt9tRCR3rTPnK6o7zd7dUCdPg8Cypa2aKA,4782
|
|
36
36
|
ngiab_data_cli/custom_logging.py,sha256=iS2XozaxudcxQj17qAsrCgbVK9LJAYAPmarJuVWJo1k,1280
|
|
37
37
|
ngiab_data_cli/forcing_cli.py,sha256=eIWRxRWUwPqR16fihFDEIV4VzGlNuvcD6lJW5VYjkPU,3635
|
|
38
|
-
ngiab_data_preprocess-4.6.
|
|
39
|
-
ngiab_data_preprocess-4.6.
|
|
40
|
-
ngiab_data_preprocess-4.6.
|
|
41
|
-
ngiab_data_preprocess-4.6.
|
|
42
|
-
ngiab_data_preprocess-4.6.
|
|
43
|
-
ngiab_data_preprocess-4.6.
|
|
38
|
+
ngiab_data_preprocess-4.6.5.dist-info/licenses/LICENSE,sha256=6dMSprwwnsRzEm02mEDbKHD9dUbL8bPIt9Vhrhb0Ulk,1081
|
|
39
|
+
ngiab_data_preprocess-4.6.5.dist-info/METADATA,sha256=lBHx8b6aXyJkAx5W937aJ7oATzozN7XL7rY05M8UZ8Y,14337
|
|
40
|
+
ngiab_data_preprocess-4.6.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
41
|
+
ngiab_data_preprocess-4.6.5.dist-info/entry_points.txt,sha256=spwlhKEJ3ZnNETQsJGeTjD7Vwy8O_zGHb9GdX8ACCtw,128
|
|
42
|
+
ngiab_data_preprocess-4.6.5.dist-info/top_level.txt,sha256=CjhYAUZrdveR2fOK6rxffU09VIN2IuPD7hk4V3l3pV0,52
|
|
43
|
+
ngiab_data_preprocess-4.6.5.dist-info/RECORD,,
|
|
File without changes
|
{ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{ngiab_data_preprocess-4.6.4.dist-info → ngiab_data_preprocess-4.6.5.dist-info}/top_level.txt
RENAMED
|
File without changes
|