pywr / pycatchmod

A Cython implementation of the rainfall runoff model CATCHMOD (Wilby, 1994)
GNU General Public License v3.0
6 stars 5 forks source link

output area flow timeseries #39

Closed laurenpetch closed 5 years ago

laurenpetch commented 5 years ago

can there be an option to output the flow for each of the areas in the catchment as well as the total flow?

jetuk commented 5 years ago

Do you mean via the CLI?

This is certainly possible and probably not too much effort.

laurenpetch commented 5 years ago

from the run_catchmod function or a new similar function. But may as well be added to CLI as well. I can have a go at this. Do you have a preference for adding to run_catchmod or a new function?

jetuk commented 5 years ago

I would add it to the run_catchmod function. It looks like it's almost there. The flows variable is setup to store outputs for multiple sub-catchments but only one scenario. It should probably be a 3D array with shape (time, subcatchment, scenario).

You could then provide a new keyword (e.g. 'output_total=True'), and do a flows.sum(axis=1) before returning if that was true, otherwise return the full 3D array.

laurenpetch commented 5 years ago

I've done the changes but it's not letting me push to the repository - it says:

remote: Permission to pywr/pycatchmod.git denied to laurenpetch. fatal: unable to access 'https://github.com/pywr/pycatchmod.git/': The requested URL returned error: 403

Could this be something to do with who has permissions to push to pyCatchmod or just me failing at github?

jetuk commented 5 years ago

I expect this is a permission issue. @snorfalorpagus can you add the pushers group to this repo?

@laurenpetch if you want to do it now you can always fork this repo to your account, push the branch to the fork and then open a PR here.

jetuk commented 5 years ago

Fixed in #42