civicmapper / peak-flow-calculator

Calculate peak flow at a point on a DEM using the TR55 methodology and NOAA climate data
MIT License
7 stars 2 forks source link

Simplify the calculator logic and de-couple from input data structures #12

Open gassc opened 5 years ago

gassc commented 5 years ago

Currently the calculator expects a 1D array of precip estimates values and a corresponding header array of the same length, where the array position in each corresponds (among other things). The values are read into a NumPy array and all subsequent calculations are effectively batched over each value in the array. This is a holdover from the original codebase and perhaps a bit more complicated than necessary. It makes running an individual calculation needlessly compex.

The core calculator logic should operate just on

To run on multiple storm event frequencies, we run the calculation in a loop. It's not a complicated or long running equation--just some pretty basic math--so efficiency isn't really an issue here.

Anything related to data structures, reading/writing to a table, etc., should be handled outside of the core script.

gassc commented 5 years ago

Started to address in 39162ba1c3b77fe1c04af18f212c1092e7b84481