Replies: 1 comment
-
Hi @SQPaul, I am really glad you find this package helpful! 🙂 No, I am afraid there is no straightforward way to output the SFCs per year with I was about to suggest you do a
For example, something like this should work: from datetime import datetime, timedelta
import numpy as np
import eflowcalc as efc
times = np.array([datetime(2010, 10, 1) + timedelta(days=d) for d in range(3653)]) # 10-year period
flows = np.random.uniform(3, 50, (3653, 100)) # 100 made up streamflow time series
area = 120.7 # km2
hydro_year = '01/10'
sfcs = (efc.ma41, efc.dh4, efc.ra7)
per_year = np.zeros((len(sfcs), 10, 100))
for i, y in enumerate(range(2010, 2020)):
s = datetime.strptime(f'{hydro_year}/{y}', '%d/%m/%Y')
e = datetime.strptime(f'{hydro_year}/{y+1}', '%d/%m/%Y')
mask = (times >= s) & (times < e)
per_year[:, i, :] = efc.calculator(sfcs, times[mask], flows[mask], area, hydro_year=hydro_year) Hope this helps, |
Beta Was this translation helpful? Give feedback.
-
Hello,
First of everything thanks for the package, it's very helpful. My question is if there is an option to get the streamflow characteristics per year instead of all the years?
Cheers!
Paul
Beta Was this translation helpful? Give feedback.
All reactions