Skip to content
Snippets Groups Projects
Commit 34ab0642 authored by Rufai Omowunmi Balogun's avatar Rufai Omowunmi Balogun
Browse files

update sm_anomaly functions

parent 213c07ca
No related branches found
No related tags found
2 merge requests!3Dev-clean up,!1update test for sm_climatology module
...@@ -129,12 +129,12 @@ def compute_anomalies( ...@@ -129,12 +129,12 @@ def compute_anomalies(
start_year = datetime.strptime(reference[0], "%Y-%m-%d").year start_year = datetime.strptime(reference[0], "%Y-%m-%d").year
end_year = datetime.strptime(reference[1], "%Y-%m-%d").year end_year = datetime.strptime(reference[1], "%Y-%m-%d").year
clim_avg = xr.open_dataset( clim_avg = xr.open_dataset(
clim_path + f"ERA5_clim_avg_{start_year}_{end_year}.nc", decode_cf=True clim_path + f"/ERA5_clim_avg_{start_year}_{end_year}.nc", decode_cf=True
).astype(np.float64) ).astype(np.float64)
clim_std = xr.open_dataset( clim_std = xr.open_dataset(
clim_path + f"ERA5_clim_std_{start_year}_{end_year}.nc", decode_cf=True clim_path + f"/ERA5_clim_std_{start_year}_{end_year}.nc", decode_cf=True
).astype(np.float64) ).astype(np.float64)
sm_year = xr.open_dataset(in_path + f"ERA5_SM_{c_year}.nc", decode_cf=True).astype(np.float64) sm_year = xr.open_dataset(in_path + f"/ERA5_SM_{c_year}.nc", decode_cf=True).astype(np.float64)
sm_year = sm_year.resample(time="1D").mean().dropna("time") sm_year = sm_year.resample(time="1D").mean().dropna("time")
sm_year = sm_year.rename({"longitude": "lon", "latitude": "lat"}) sm_year = sm_year.rename({"longitude": "lon", "latitude": "lat"})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment