Skip to content

Commit 5b00e5a

Browse files
Merge pull request #16 from supathdhitalGEO/main
update the geoglows data handling
2 parents 0be247c + ed57d83 commit 5b00e5a

File tree

6 files changed

+262
-239
lines changed

6 files changed

+262
-239
lines changed

dist/fimserve-0.1.78-py3-none-any.whl

41.4 KB
Binary file not shown.

dist/fimserve-0.1.78.tar.gz

37.1 KB
Binary file not shown.

poetry.lock

Lines changed: 252 additions & 237 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "fimserve"
3-
version = "0.1.77"
3+
version = "0.1.78"
44
description = "Framework which is developed with the purpose of quickly generating Flood Inundation Maps (FIM) for emergency response and risk assessment. It is developed under Surface Dynamics Modeling Lab (SDML)."
55
authors = ["Supath Dhital <sdhital@crimson.ua.edu>"]
66
license = "GPL-3.0"

src/fimserve/streamflowdata/geoglows.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ def getGLOWS_data(
3232
"""
3333
Get GLOWS data for a specific event time and save it to a CSV file.
3434
"""
35-
35+
36+
value_time = pd.to_datetime(event_time)
37+
3638
if start_date is None or end_date is None:
3739
value_time = pd.to_datetime(event_time)
3840

@@ -66,11 +68,13 @@ def getGLOWS_data(
6668
out_dir = Path(output_dir) / "GEOGLOWS"
6769
out_dir.mkdir(parents=True, exist_ok=True)
6870
output_file = out_dir / f"{huc}_{start_date}_{end_date}_streamflow.csv"
71+
output_df["feature_id"] = output_df["feature_id"].astype(int)
6972
output_df.to_csv(output_file, index=False)
7073

7174
# Filter based on value_time
7275
value_time_df = output_df[output_df["time"] == value_time]
7376
value_time_df = value_time_df[["feature_id", "discharge"]]
77+
value_time_df["feature_id"] = value_time_df["feature_id"].astype(int)
7478

7579
# Export the value_time data to a separate CSV file
7680
value_timeSTR = pd.to_datetime(value_time).strftime("%Y%m%d")

tests/test_geoglows.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@
1414
event_time="2016-10-15",
1515
hydrotable=hydrotable_dir,
1616
)
17+
18+
# run the FIM model
19+
fm.runOWPHANDFIM(huc)
20+

0 commit comments

Comments
 (0)