Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor interactive notebook #20

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions hat/clock.py

This file was deleted.

2 changes: 1 addition & 1 deletion hat/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def filter_timeseries(sims_ds: xr.DataArray, obs_ds: xr.DataArray, threshold=80)
obs_ds = obs_ds.sel(station=matching_stations)
obs_ds = obs_ds.sel(time=sims_ds.time)

obs_ds = obs_ds.dropna(dim='station', how='all')
obs_ds = obs_ds.dropna(dim="station", how="all")
sims_ds = sims_ds.sel(station=obs_ds.station)

# Only keep observations in the same time period as the simulations
Expand Down
30 changes: 0 additions & 30 deletions hat/graphs.py

This file was deleted.

9 changes: 5 additions & 4 deletions hat/hydrostats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import folium
import geopandas as gpd
import pandas as pd
import numpy as np
import xarray as xr
from branca.colormap import linear
Expand All @@ -17,7 +16,9 @@ def run_analysis(
sims_ds: xr.DataArray,
obs_ds: xr.DataArray,
) -> xr.Dataset:
"""Run statistical analysis on simulation and observation timeseries"""
"""
Run statistical analysis on simulation and observation timeseries
"""

# list of stations
stations = sims_ds.coords["station"].values
Expand All @@ -35,7 +36,7 @@ def run_analysis(
for station in stations:
sims = sims_ds.sel(station=station).to_numpy()
obs = obs_ds.sel(station=station).to_numpy()

stat = func(sims, obs)
if stat is None:
print(f"Warning! All NaNs for station {station}")
Expand All @@ -44,7 +45,7 @@ def run_analysis(
statistics = np.array(statistics)

# Add the Series to the DataFrame
ds[name] = xr.DataArray(statistics, coords={'station': stations})
ds[name] = xr.DataArray(statistics, coords={"station": stations})

return ds

Expand Down
29 changes: 0 additions & 29 deletions hat/images.py

This file was deleted.

Empty file added hat/interactive/__init__.py
Empty file.
Loading