ngiab-data-preprocess 4.4.0__py3-none-any.whl → 4.5.1__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.
@@ -1,23 +1,22 @@
1
1
  import json
2
2
  import logging
3
3
  import multiprocessing
4
+ import os
4
5
  import shutil
5
6
  import sqlite3
6
7
  from datetime import datetime
7
8
  from pathlib import Path
8
9
  from typing import Dict, Optional
9
- import psutil
10
- import os
11
10
 
11
+ import numpy as np
12
12
  import pandas
13
+ import psutil
13
14
  import requests
14
15
  import s3fs
15
16
  import xarray as xr
16
17
  from data_processing.dask_utils import temp_cluster
17
18
  from data_processing.file_paths import file_paths
18
19
  from data_processing.gpkg_utils import (
19
- GeoPackage,
20
- get_cat_to_nex_flowpairs,
21
20
  get_cat_to_nhd_feature_id,
22
21
  get_table_crs_short,
23
22
  )
@@ -91,7 +90,6 @@ def make_cfe_config(
91
90
  def make_noahowp_config(
92
91
  base_dir: Path, divide_conf_df: pandas.DataFrame, start_time: datetime, end_time: datetime
93
92
  ) -> None:
94
- divide_conf_df.set_index("divide_id", inplace=True)
95
93
  start_datetime = start_time.strftime("%Y%m%d%H%M")
96
94
  end_datetime = end_time.strftime("%Y%m%d%H%M")
97
95
  with open(file_paths.template_noahowp_config, "r") as file:
@@ -100,155 +98,78 @@ def make_noahowp_config(
100
98
  cat_config_dir = base_dir / "cat_config" / "NOAH-OWP-M"
101
99
  cat_config_dir.mkdir(parents=True, exist_ok=True)
102
100
 
103
- for divide in divide_conf_df.index:
104
- with open(cat_config_dir / f"{divide}.input", "w") as file:
101
+ for _, row in divide_conf_df.iterrows():
102
+ with open(cat_config_dir / f"{row['divide_id']}.input", "w") as file:
105
103
  file.write(
106
104
  template.format(
107
105
  start_datetime=start_datetime,
108
106
  end_datetime=end_datetime,
109
- lat=divide_conf_df.loc[divide, "latitude"],
110
- lon=divide_conf_df.loc[divide, "longitude"],
111
- terrain_slope=divide_conf_df.loc[divide, "mean.slope_1km"],
112
- azimuth=divide_conf_df.loc[divide, "circ_mean.aspect"],
113
- ISLTYP=int(divide_conf_df.loc[divide, "mode.ISLTYP"]), # type: ignore
114
- IVGTYP=int(divide_conf_df.loc[divide, "mode.IVGTYP"]), # type: ignore
107
+ lat=row["latitude"],
108
+ lon=row["longitude"],
109
+ terrain_slope=row["mean.slope_1km"],
110
+ azimuth=row["circ_mean.aspect"],
111
+ ISLTYP=int(row["mode.ISLTYP"]), # type: ignore
112
+ IVGTYP=int(row["mode.IVGTYP"]), # type: ignore
115
113
  )
116
114
  )
117
115
 
118
116
 
119
- def get_model_attributes_modspatialite(hydrofabric: Path) -> pandas.DataFrame:
120
- # modspatialite is faster than pyproj but can't be added as a pip dependency
121
- # This incantation took a while
122
- with GeoPackage(hydrofabric) as conn:
123
- sql = """WITH source_crs AS (
124
- SELECT organization || ':' || organization_coordsys_id AS crs_string
125
- FROM gpkg_spatial_ref_sys
126
- WHERE srs_id = (
127
- SELECT srs_id
128
- FROM gpkg_geometry_columns
129
- WHERE table_name = 'divides'
130
- )
131
- )
132
- SELECT
133
- d.divide_id,
134
- d.areasqkm,
135
- da."mean.slope",
136
- da."mean.slope_1km",
137
- da."mean.elevation",
138
- ST_X(Transform(MakePoint(da.centroid_x, da.centroid_y), 4326, NULL,
139
- (SELECT crs_string FROM source_crs), 'EPSG:4326')) AS longitude,
140
- ST_Y(Transform(MakePoint(da.centroid_x, da.centroid_y), 4326, NULL,
141
- (SELECT crs_string FROM source_crs), 'EPSG:4326')) AS latitude
142
- FROM divides AS d
143
- JOIN 'divide-attributes' AS da ON d.divide_id = da.divide_id
144
- """
145
- divide_conf_df = pandas.read_sql_query(sql, conn)
146
- divide_conf_df.set_index("divide_id", inplace=True)
147
- return divide_conf_df
148
-
149
-
150
- def get_model_attributes_pyproj(hydrofabric: Path) -> pandas.DataFrame:
151
- # if modspatialite is not available, use pyproj
117
+ def get_model_attributes(hydrofabric: Path) -> pandas.DataFrame:
152
118
  with sqlite3.connect(hydrofabric) as conn:
153
- sql = """
154
- SELECT
155
- d.divide_id,
156
- d.areasqkm,
157
- da."mean.slope",
158
- da."mean.slope_1km",
159
- da."mean.elevation",
160
- da.centroid_x,
161
- da.centroid_y
162
- FROM divides AS d
163
- JOIN 'divide-attributes' AS da ON d.divide_id = da.divide_id
164
- """
165
- divide_conf_df = pandas.read_sql_query(sql, conn)
166
-
119
+ conf_df = pandas.read_sql_query(
120
+ """
121
+ SELECT
122
+ d.areasqkm,
123
+ da.*
124
+ FROM divides AS d
125
+ JOIN 'divide-attributes' AS da ON d.divide_id = da.divide_id
126
+ """,
127
+ conn,
128
+ )
167
129
  source_crs = get_table_crs_short(hydrofabric, "divides")
168
-
169
130
  transformer = Transformer.from_crs(source_crs, "EPSG:4326", always_xy=True)
170
-
171
- lon, lat = transformer.transform(
172
- divide_conf_df["centroid_x"].values, divide_conf_df["centroid_y"].values
173
- )
174
-
175
- divide_conf_df["longitude"] = lon
176
- divide_conf_df["latitude"] = lat
177
-
178
- divide_conf_df.drop(columns=["centroid_x", "centroid_y"], axis=1, inplace=True)
179
- divide_conf_df.set_index("divide_id", inplace=True)
180
-
181
- return divide_conf_df
182
-
183
-
184
- def get_model_attributes(hydrofabric: Path) -> pandas.DataFrame:
185
- try:
186
- with GeoPackage(hydrofabric) as conn:
187
- conf_df = pandas.read_sql_query(
188
- """WITH source_crs AS (
189
- SELECT organization || ':' || organization_coordsys_id AS crs_string
190
- FROM gpkg_spatial_ref_sys
191
- WHERE srs_id = (
192
- SELECT srs_id
193
- FROM gpkg_geometry_columns
194
- WHERE table_name = 'divides'
195
- )
196
- )
197
- SELECT
198
- *,
199
- ST_X(Transform(MakePoint(centroid_x, centroid_y), 4326, NULL,
200
- (SELECT crs_string FROM source_crs), 'EPSG:4326')) AS longitude,
201
- ST_Y(Transform(MakePoint(centroid_x, centroid_y), 4326, NULL,
202
- (SELECT crs_string FROM source_crs), 'EPSG:4326')) AS latitude FROM 'divide-attributes';""",
203
- conn,
204
- )
205
- except sqlite3.OperationalError:
206
- with sqlite3.connect(hydrofabric) as conn:
207
- conf_df = pandas.read_sql_query(
208
- "SELECT* FROM 'divide-attributes';",
209
- conn,
210
- )
211
- source_crs = get_table_crs_short(hydrofabric, "divides")
212
- transformer = Transformer.from_crs(source_crs, "EPSG:4326", always_xy=True)
213
- lon, lat = transformer.transform(conf_df["centroid_x"].values, conf_df["centroid_y"].values)
214
- conf_df["longitude"] = lon
215
- conf_df["latitude"] = lat
216
-
217
- conf_df.drop(columns=["centroid_x", "centroid_y"], axis=1, inplace=True)
131
+ lon, lat = transformer.transform(conf_df["centroid_x"].values, conf_df["centroid_y"].values)
132
+ conf_df["longitude"] = lon
133
+ conf_df["latitude"] = lat
218
134
  return conf_df
219
135
 
220
136
 
221
- def make_em_config(
137
+ def make_lstm_config(
222
138
  hydrofabric: Path,
223
139
  output_dir: Path,
224
- template_path: Path = file_paths.template_em_config,
140
+ template_path: Path = file_paths.template_lstm_config,
225
141
  ):
226
142
  # test if modspatialite is available
227
- try:
228
- divide_conf_df = get_model_attributes_modspatialite(hydrofabric)
229
- except Exception as e:
230
- logger.warning(f"mod_spatialite not available, using pyproj instead: {e}")
231
- logger.warning("Install mod_spatialite for improved performance")
232
- divide_conf_df = get_model_attributes_pyproj(hydrofabric)
233
-
234
- cat_config_dir = output_dir / "cat_config" / "empirical_model"
143
+
144
+ divide_conf_df = get_model_attributes(hydrofabric)
145
+
146
+ cat_config_dir = output_dir / "cat_config" / "lstm"
235
147
  if cat_config_dir.exists():
236
148
  shutil.rmtree(cat_config_dir)
237
149
  cat_config_dir.mkdir(parents=True, exist_ok=True)
238
150
 
151
+ # convert the mean.slope from degrees 0-90 where 90 is flat and 0 is vertical to m/km
152
+ # flip 0 and 90 degree values
153
+ divide_conf_df["flipped_mean_slope"] = abs(divide_conf_df["mean.slope"] - 90)
154
+ # Convert degrees to meters per kmmeter
155
+ divide_conf_df["mean_slope_mpkm"] = (
156
+ np.tan(np.radians(divide_conf_df["flipped_mean_slope"])) * 1000
157
+ )
158
+
239
159
  with open(template_path, "r") as file:
240
160
  template = file.read()
241
161
 
242
- for divide in divide_conf_df.index:
162
+ for _, row in divide_conf_df.iterrows():
163
+ divide = row["divide_id"]
243
164
  with open(cat_config_dir / f"{divide}.yml", "w") as file:
244
165
  file.write(
245
166
  template.format(
246
- area_sqkm=divide_conf_df.loc[divide, "areasqkm"],
167
+ area_sqkm=row["areasqkm"],
247
168
  divide_id=divide,
248
- lat=divide_conf_df.loc[divide, "latitude"],
249
- lon=divide_conf_df.loc[divide, "longitude"],
250
- slope_mean=divide_conf_df.loc[divide, "mean.slope"],
251
- elevation_mean=divide_conf_df.loc[divide, "mean.slope"],
169
+ lat=row["latitude"],
170
+ lon=row["longitude"],
171
+ slope_mean=row["mean_slope_mpkm"],
172
+ elevation_mean=row["mean.elevation"] / 100, # convert cm in hf to m
252
173
  )
253
174
  )
254
175
 
@@ -259,14 +180,16 @@ def configure_troute(
259
180
  with open(file_paths.template_troute_config, "r") as file:
260
181
  troute_template = file.read()
261
182
  time_step_size = 300
262
- gpkg_file_path=f"{config_dir}/{cat_id}_subset.gpkg"
183
+ gpkg_file_path = f"{config_dir}/{cat_id}_subset.gpkg"
263
184
  nts = (end_time - start_time).total_seconds() / time_step_size
264
185
  with sqlite3.connect(gpkg_file_path) as conn:
265
186
  ncats_df = pandas.read_sql_query("SELECT COUNT(id) FROM 'divides';", conn)
266
- ncats = ncats_df['COUNT(id)'][0]
187
+ ncats = ncats_df["COUNT(id)"][0]
267
188
 
268
- est_bytes_required = nts * ncats * 45 # extremely rough calculation based on about 3 tests :)
269
- local_ram_available = 0.8 * psutil.virtual_memory().available # buffer to not accidentally explode machine
189
+ est_bytes_required = nts * ncats * 45 # extremely rough calculation based on about 3 tests :)
190
+ local_ram_available = (
191
+ 0.8 * psutil.virtual_memory().available
192
+ ) # buffer to not accidentally explode machine
270
193
 
271
194
  if est_bytes_required > local_ram_available:
272
195
  max_loop_size = nts // (est_bytes_required // local_ram_available)
@@ -289,7 +212,7 @@ def configure_troute(
289
212
  start_datetime=start_time.strftime("%Y-%m-%d %H:%M:%S"),
290
213
  nts=nts,
291
214
  max_loop_size=max_loop_size,
292
- binary_nexus_file_folder_comment=binary_nexus_file_folder_comment
215
+ binary_nexus_file_folder_comment=binary_nexus_file_folder_comment,
293
216
  )
294
217
 
295
218
  with open(config_dir / "troute.yaml", "w") as file:
@@ -310,22 +233,14 @@ def make_ngen_realization_json(
310
233
  json.dump(realization, file, indent=4)
311
234
 
312
235
 
313
- def create_em_realization(cat_id: str, start_time: datetime, end_time: datetime):
236
+ def create_lstm_realization(cat_id: str, start_time: datetime, end_time: datetime):
314
237
  paths = file_paths(cat_id)
315
- template_path = file_paths.template_em_realization_config
316
- em_config = file_paths.template_em_model_config
317
- # move em_config to paths.config_dir
318
- with open(em_config, "r") as f:
319
- em_config = f.read()
320
- with open(paths.config_dir / "em-config.yml", "w") as f:
321
- f.write(em_config)
322
-
238
+ template_path = file_paths.template_lstm_realization_config
323
239
  configure_troute(cat_id, paths.config_dir, start_time, end_time)
324
240
  make_ngen_realization_json(paths.config_dir, template_path, start_time, end_time)
325
- make_em_config(paths.geopackage_path, paths.config_dir)
241
+ make_lstm_config(paths.geopackage_path, paths.config_dir)
326
242
  # create some partitions for parallelization
327
243
  paths.setup_run_folders()
328
- create_partitions(paths)
329
244
 
330
245
 
331
246
  def create_realization(
@@ -368,48 +283,3 @@ def create_realization(
368
283
 
369
284
  # create some partitions for parallelization
370
285
  paths.setup_run_folders()
371
- create_partitions(paths)
372
-
373
-
374
- def create_partitions(paths: file_paths, num_partitions: Optional[int] = None) -> None:
375
- if num_partitions is None:
376
- num_partitions = multiprocessing.cpu_count()
377
-
378
- cat_to_nex_pairs = get_cat_to_nex_flowpairs(hydrofabric=paths.geopackage_path)
379
- # nexus = defaultdict(list)
380
-
381
- # for cat, nex in cat_to_nex_pairs:
382
- # nexus[nex].append(cat)
383
-
384
- num_partitions = min(num_partitions, len(cat_to_nex_pairs))
385
- # partition_size = ceil(len(nexus) / num_partitions)
386
- # num_nexus = len(nexus)
387
- # nexus = list(nexus.items())
388
- # partitions = []
389
- # for i in range(0, num_nexus, partition_size):
390
- # part = {}
391
- # part["id"] = i // partition_size
392
- # part["cat-ids"] = []
393
- # part["nex-ids"] = []
394
- # part["remote-connections"] = []
395
- # for j in range(i, i + partition_size):
396
- # if j < num_nexus:
397
- # part["cat-ids"].extend(nexus[j][1])
398
- # part["nex-ids"].append(nexus[j][0])
399
- # partitions.append(part)
400
-
401
- # with open(paths.subset_dir / f"partitions_{num_partitions}.json", "w") as f:
402
- # f.write(json.dumps({"partitions": partitions}, indent=4))
403
-
404
- # write this to a metadata file to save on repeated file io to recalculate
405
- with open(paths.metadata_dir / "num_partitions", "w") as f:
406
- f.write(str(num_partitions))
407
-
408
-
409
- if __name__ == "__main__":
410
- cat_id = "cat-1643991"
411
- start_time = datetime(2010, 1, 1, 0, 0, 0)
412
- end_time = datetime(2010, 1, 2, 0, 0, 0)
413
- # output_interval = 3600
414
- # nts = 2592
415
- create_realization(cat_id, start_time, end_time)
@@ -1,6 +1,7 @@
1
+ from datetime import datetime
1
2
  from pathlib import Path
2
3
  from typing import Optional
3
- from datetime import datetime
4
+
4
5
 
5
6
  class file_paths:
6
7
  """
@@ -27,11 +28,10 @@ class file_paths:
27
28
  dev_file = Path(__file__).parent.parent.parent / ".dev"
28
29
  template_troute_config = data_sources / "ngen-routing-template.yaml"
29
30
  template_cfe_nowpm_realization_config = data_sources / "cfe-nowpm-realization-template.json"
30
- template_em_realization_config = data_sources / "em-realization-template.json"
31
+ template_lstm_realization_config = data_sources / "lstm-realization-template.json"
31
32
  template_noahowp_config = data_sources / "noah-owp-modular-init.namelist.input"
32
33
  template_cfe_config = data_sources / "cfe-template.ini"
33
- template_em_config = data_sources / "em-catchment-template.yml"
34
- template_em_model_config = data_sources / "em-config.yml"
34
+ template_lstm_config = data_sources / "lstm-catchment-template.yml"
35
35
 
36
36
  def __init__(self, folder_name: Optional[str] = None, output_dir: Optional[Path] = None):
37
37
  """
@@ -0,0 +1,17 @@
1
+ time_step: "1 hour"
2
+ area_sqkm: {area_sqkm} # areasqkm
3
+ basin_id: {divide_id}
4
+ basin_name: {divide_id}
5
+ elev_mean: {elevation_mean} # mean.elevation
6
+ initial_state: zero
7
+ lat: {lat} # needs calulating
8
+ lon: {lon} # needs calulating
9
+ slope_mean: {slope_mean} # mean.slope
10
+ train_cfg_file:
11
+ - /ngen/ngen/extern/lstm/trained_neuralhydrology_models/nh_AORC_hourly_25yr_1210_112435_7/config.yml
12
+ - /ngen/ngen/extern/lstm/trained_neuralhydrology_models/nh_AORC_hourly_25yr_1210_112435_8/config.yml
13
+ - /ngen/ngen/extern/lstm/trained_neuralhydrology_models/nh_AORC_hourly_25yr_1210_112435_9/config.yml
14
+ - /ngen/ngen/extern/lstm/trained_neuralhydrology_models/nh_AORC_hourly_25yr_seq999_seed101_0701_143442/config.yml
15
+ - /ngen/ngen/extern/lstm/trained_neuralhydrology_models/nh_AORC_hourly_25yr_seq999_seed103_2701_171540/config.yml
16
+ - /ngen/ngen/extern/lstm/trained_neuralhydrology_models/nh_AORC_hourly_slope_elev_precip_temp_seq999_seed101_2801_191806/config.yml
17
+ verbose: 0
@@ -5,25 +5,22 @@
5
5
  "name": "bmi_multi",
6
6
  "params": {
7
7
  "name": "bmi_multi",
8
- "model_type_name": "empirical_model",
8
+ "model_type_name": "lstm",
9
9
  "forcing_file": "",
10
10
  "init_config": "",
11
11
  "allow_exceed_end_time": true,
12
12
  "main_output_variable": "land_surface_water__runoff_depth",
13
- "modules": [
13
+ "modules": [
14
14
  {
15
15
  "name": "bmi_python",
16
16
  "params": {
17
17
  "name": "bmi_python",
18
18
  "python_type": "lstm.bmi_lstm.bmi_LSTM",
19
- "model_type_name": "bmi_empirical_model",
20
- "init_config": "./config/cat_config/empirical_model/{{id}}.yml",
19
+ "model_type_name": "bmi_lstm",
20
+ "init_config": "./config/cat_config/lstm/{{id}}.yml",
21
21
  "allow_exceed_end_time": true,
22
22
  "main_output_variable": "land_surface_water__runoff_depth",
23
- "uses_forcing_file": false,
24
- "variables_names_map": {
25
- "atmosphere_water__liquid_equivalent_precipitation_rate": "APCP_surface"
26
- }
23
+ "uses_forcing_file": false
27
24
  }
28
25
  }
29
26
  ]
@@ -8,9 +8,10 @@ with rich.status.Status("loading") as status:
8
8
  import logging
9
9
  import subprocess
10
10
  import time
11
+ from multiprocessing import cpu_count
11
12
 
12
13
  import geopandas as gpd
13
- from data_processing.create_realization import create_em_realization, create_realization
14
+ from data_processing.create_realization import create_lstm_realization, create_realization
14
15
  from data_processing.dask_utils import shutdown_cluster
15
16
  from data_processing.dataset_utils import save_and_clip_dataset
16
17
  from data_processing.datasets import load_aorc_zarr, load_v3_retrospective_zarr
@@ -22,6 +23,7 @@ with rich.status.Status("loading") as status:
22
23
  from data_sources.source_validation import validate_hydrofabric, validate_output_dir
23
24
  from ngiab_data_cli.arguments import parse_arguments
24
25
  from ngiab_data_cli.custom_logging import set_logging_to_critical_only, setup_logging
26
+
25
27
 
26
28
 
27
29
  def validate_input(args: argparse.Namespace) -> Tuple[str, str]:
@@ -184,8 +186,8 @@ def main() -> None:
184
186
  gage_id = None
185
187
  if args.gage:
186
188
  gage_id = args.input_feature
187
- if args.empirical_model:
188
- create_em_realization(
189
+ if args.lstm:
190
+ create_lstm_realization(
189
191
  output_folder, start_time=args.start_date, end_time=args.end_date
190
192
  )
191
193
  else:
@@ -200,17 +202,13 @@ def main() -> None:
200
202
 
201
203
  if args.run:
202
204
  logging.info("Running Next Gen using NGIAB...")
203
- # open the partitions.json file and get the number of partitions
204
- with open(paths.metadata_dir / "num_partitions", "r") as f:
205
- num_partitions = int(f.read())
206
-
205
+
207
206
  try:
208
207
  subprocess.run("docker pull awiciroh/ciroh-ngen-image:latest", shell=True)
209
208
  except:
210
209
  logging.error("Docker is not running, please start Docker and try again.")
211
210
  try:
212
- # command = f'docker run --rm -it -v "{str(paths.subset_dir)}:/ngen/ngen/data" joshcu/ngiab /ngen/ngen/data/ auto {num_partitions} local'
213
- command = f'docker run --rm -it -v "{str(paths.subset_dir)}:/ngen/ngen/data" awiciroh/ciroh-ngen-image:latest /ngen/ngen/data/ auto {num_partitions} local'
211
+ command = f'docker run --rm -it -v "{str(paths.subset_dir)}:/ngen/ngen/data" awiciroh/ciroh-ngen-image:latest /ngen/ngen/data/ auto {cpu_count()} local'
214
212
  subprocess.run(command, shell=True)
215
213
  logging.info("Next Gen run complete.")
216
214
  except:
@@ -106,10 +106,9 @@ def parse_arguments() -> argparse.Namespace:
106
106
  help="enable debug logging",
107
107
  )
108
108
  parser.add_argument(
109
- "--empirical_model",
110
- "--em",
109
+ "--lstm",
111
110
  action="store_true",
112
- help="enable empirical model realization and forcings",
111
+ help="enable LSTM model realization and forcings",
113
112
  )
114
113
  parser.add_argument(
115
114
  "--nwm_gw",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ngiab_data_preprocess
3
- Version: 4.4.0
3
+ Version: 4.5.1
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
@@ -1,8 +1,8 @@
1
- data_processing/create_realization.py,sha256=mdse8W2DgPg5Lj2_ErUsLJh-touTmShKwQrrOWO0jlY,15958
1
+ data_processing/create_realization.py,sha256=deRP3p4zfV9PF_vUikYKRiKA994bgj2GtPGCjQDSsTE,10795
2
2
  data_processing/dask_utils.py,sha256=A2IP94WAz8W9nek3etXKEKTOxGPf0NWSFLh8cZ5S-xU,2454
3
3
  data_processing/dataset_utils.py,sha256=AJOxE2nRfZnWYon_qqGcfkpRZuRW8Yy8YI86SxVDU3M,11168
4
4
  data_processing/datasets.py,sha256=_EJ1uZSWTU1HWpvF7TQSikneJqWZFikTrdo9usCV8A0,4665
5
- data_processing/file_paths.py,sha256=l2iCUFt_pk-jjzl7OS7npROAnQxwqFfZ7b2wRjViqiU,4720
5
+ data_processing/file_paths.py,sha256=MFUShBB1g9IGi9MaJwrl6fKIcsrhbmcYEdTHtmnphZo,4667
6
6
  data_processing/forcings.py,sha256=k-JhBncTnXcdjSieam1Q2cDx5Xt9hH5Aywv0gDY4O2U,19010
7
7
  data_processing/gpkg_utils.py,sha256=tSSIMlHeqqgxTJQyF3X9tPmunQTJYx0xrCNHqUBQxkg,20590
8
8
  data_processing/graph_utils.py,sha256=qvHw6JlzQxLi--eMsGgC_rUBP4nDatl6X9mSa03Xxyo,8306
@@ -10,10 +10,9 @@ data_processing/s3fs_utils.py,sha256=ki1EmA0ezV0r26re6dRWIGzL5FudGdwF9Qw1eVLR0Bc
10
10
  data_processing/subset.py,sha256=XoojOgWCwxOi5Q4KXHXARNQeoZlobJp-mqhIIvTRtTw,3793
11
11
  data_sources/cfe-nowpm-realization-template.json,sha256=8an6q1drWD8wU1ocvdPab-GvZDvlQ-0di_-NommH3QI,3528
12
12
  data_sources/cfe-template.ini,sha256=6e5-usqjWtm3MWVvtm8CTeZTJJMxO1ZswkOXq0L9mnc,2033
13
- data_sources/em-catchment-template.yml,sha256=M08ixazEUHYI2PNavtI0xPZeSzcQ9bg2g0XzNT-8_u4,292
14
- data_sources/em-config.yml,sha256=y0J8kEA70rxLWXJjz-CQ7sawcVyhQcayofeLlq4Svbo,1330
15
- data_sources/em-realization-template.json,sha256=DJvB7N8lCeS2vLFenmbTzysBDR-xPaJ09XA8heu1ijY,1466
16
13
  data_sources/forcing_template.nc,sha256=uRuVAqX3ngdlougZINavtwl_wC2VLD8fHqG7_CLim1s,85284
14
+ data_sources/lstm-catchment-template.yml,sha256=LtknqvxbWrtLLZIXxFgTfbQmM4x8XnHBDFvRIh2EIFI,965
15
+ data_sources/lstm-realization-template.json,sha256=ndz3h5NGhtUSnsZwscgNuXYBG9mlAuz7Lxx7iCw22UY,1270
17
16
  data_sources/ngen-routing-template.yaml,sha256=wM5v6jj0kwcJBVatLFuy2big6g8nlSXxzc8a23nwI5s,4655
18
17
  data_sources/noah-owp-modular-init.namelist.input,sha256=Vb7mp40hFpJogruOrXrDHwVW1bKi9h1ciDNyDvTzn20,3045
19
18
  data_sources/source_validation.py,sha256=RmvyPLjuDetpuNOUqCclgDfe8zd_Ojr7pfbUoUya2pQ,9498
@@ -31,13 +30,13 @@ map_app/static/js/main.js,sha256=_Yq1tuzyREqWU24rFQJSh5zIaXtAXEGlfZPo36QLHvI,969
31
30
  map_app/static/resources/loading.gif,sha256=ggdkZf1AD7rSwIpSJwfiIqANgmVV1WHlxGuKxQKv7uY,72191
32
31
  map_app/static/resources/screenshot.jpg,sha256=Ia358aX-OHM9BP4B8lX05cLnguF2fHUIimno9bnFLYw,253730
33
32
  map_app/templates/index.html,sha256=Jy2k1Ob2_et--BPpfmTYO22Yin3vrG6IOeNlwzUoEqY,7878
34
- ngiab_data_cli/__main__.py,sha256=13W3RnD73weQNYZdq6munx_0oMBgzc-yzluKEm5nSxg,10570
35
- ngiab_data_cli/arguments.py,sha256=yBULJnFgUvgP4YZmZ5HhR7g0EfdMtBCdQuDkDuYSXCQ,4322
33
+ ngiab_data_cli/__main__.py,sha256=io9YbZY65tQC66gpcP02ECRnGpM-fnjLxQHa1EKDKzc,10269
34
+ ngiab_data_cli/arguments.py,sha256=qS8RupcT3Ax7ZRT0uKKzFdUvkDdVugBlYyuzljY_bxo,4290
36
35
  ngiab_data_cli/custom_logging.py,sha256=iS2XozaxudcxQj17qAsrCgbVK9LJAYAPmarJuVWJo1k,1280
37
36
  ngiab_data_cli/forcing_cli.py,sha256=eIWRxRWUwPqR16fihFDEIV4VzGlNuvcD6lJW5VYjkPU,3635
38
- ngiab_data_preprocess-4.4.0.dist-info/licenses/LICENSE,sha256=6dMSprwwnsRzEm02mEDbKHD9dUbL8bPIt9Vhrhb0Ulk,1081
39
- ngiab_data_preprocess-4.4.0.dist-info/METADATA,sha256=8PlfoGwOJIpuKhFwtfWmfxdMaDeXBfFRz9CAeZ3sZKk,13344
40
- ngiab_data_preprocess-4.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
41
- ngiab_data_preprocess-4.4.0.dist-info/entry_points.txt,sha256=spwlhKEJ3ZnNETQsJGeTjD7Vwy8O_zGHb9GdX8ACCtw,128
42
- ngiab_data_preprocess-4.4.0.dist-info/top_level.txt,sha256=CjhYAUZrdveR2fOK6rxffU09VIN2IuPD7hk4V3l3pV0,52
43
- ngiab_data_preprocess-4.4.0.dist-info/RECORD,,
37
+ ngiab_data_preprocess-4.5.1.dist-info/licenses/LICENSE,sha256=6dMSprwwnsRzEm02mEDbKHD9dUbL8bPIt9Vhrhb0Ulk,1081
38
+ ngiab_data_preprocess-4.5.1.dist-info/METADATA,sha256=Sa-C8mvOi-1Qn5u27X2Dz5wYeMPLnjle-nuC_VJ2kZo,13344
39
+ ngiab_data_preprocess-4.5.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
40
+ ngiab_data_preprocess-4.5.1.dist-info/entry_points.txt,sha256=spwlhKEJ3ZnNETQsJGeTjD7Vwy8O_zGHb9GdX8ACCtw,128
41
+ ngiab_data_preprocess-4.5.1.dist-info/top_level.txt,sha256=CjhYAUZrdveR2fOK6rxffU09VIN2IuPD7hk4V3l3pV0,52
42
+ ngiab_data_preprocess-4.5.1.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- area_sqkm: {area_sqkm} # areasqkm
2
- basin_id: {divide_id}
3
- basin_name: {divide_id}
4
- elev_mean: {elevation_mean} # mean.elevation
5
- initial_state: zero
6
- lat: {lat} # needs calulating
7
- lon: {lon} # needs calulating
8
- slope_mean: {slope_mean} # mean.slope
9
- train_cfg_file: ./config/em-config.yml
10
- verbose: 0
@@ -1,60 +0,0 @@
1
- batch_size: 256
2
- clip_gradient_norm: 1
3
- clip_targets_to_zero:
4
- - QObs(mm/d)
5
- data_dir: ./data/
6
- dataset: hourly_camels_us
7
- device: cpu
8
- dynamic_inputs:
9
- - total_precipitation
10
- - temperature
11
- epochs: 9
12
- experiment_name: hourly_slope_mean_precip_temp
13
- forcings: nldas_hourly
14
- head: regression
15
- hidden_size: 64
16
- img_log_dir: /ngen/ngen/extern/lstm/trained_neuralhydrology_models/hourly_slope_mean_precip_temp/img_log
17
- initial_forget_bias: 3
18
- learning_rate:
19
- 0: 0.0005
20
- 10: 0.0001
21
- 25: 5e-05
22
- log_interval: 5
23
- log_n_figures: 0
24
- log_tensorboard: false
25
- loss: NSE
26
- mass_inputs:
27
- metrics:
28
- - NSE
29
- - KGE
30
- - Alpha-NSE
31
- - Beta-NSE
32
- model: cudalstm
33
- num_workers: 8
34
- number_of_basins: 516
35
- optimizer: Adam
36
- output_activation: linear
37
- output_dropout: 0.4
38
- package_version: 1.0.0-beta1
39
- predict_last_n: 24
40
- run_dir: /ngen/ngen/extern/lstm/trained_neuralhydrology_models/hourly_slope_mean_precip_temp
41
- save_weights_every: 1
42
- seed: 102
43
- seq_length: 336
44
- static_attributes:
45
- - elev_mean
46
- - slope_mean
47
- target_variables:
48
- - QObs(mm/d)
49
- test_basin_file: 516_basins.txt
50
- test_end_date: 31/12/2002
51
- test_start_date: 01/01/2000
52
- train_basin_file: 516_basins.txt
53
- train_dir: trained_elsewhere
54
- train_end_date: 30/09/2018
55
- train_start_date: 01/10/1980
56
- validate_every: 1
57
- validate_n_random_basins: 15
58
- validation_basin_file: 516_basins.txt
59
- validation_end_date: 30/09/2018
60
- validation_start_date: 01/10/1980