Closed philipbaileynar closed 2 weeks ago
This old video where I explain the NSS database is just for my reference.
FYI related to #277
Full results for Task 2: most_common.txt
Results for Task 1: updated_equations.csv
There are a few problems that could prevent the new last column from running smoothly in a python eval()
.
e#^(...)
. While one may presume this is equivalent to exp(...)
, the syntax does not match any known format that I or chatGPT could find. As such, this has been left unchanged.LogN(...)
was replaced by math.log(...)
. These should be equivalent, but note that the math
library must be imported.round()
, LogN()
) are surrounded by double quotes. This may or may not cause a problem.round()
in the equations matches how it functions in pythonThank you!
We want a more automated approach for defining streamflow for the hydrologic context project type (that feeds into BRAT). I have downloaded all the peak (2yr recurrence interval) and low flow equations from the National Stream Stats database:
2024_08_26_nss_depvars.csv
Tasks 1
Add a column to this CSV called
python_equation
and convert these "Excel" equations into Python syntax that will run with the eval command. This should be fairly straightforward. The exponent operation is different etc, but most of the syntax should be unchanged. Here's where we do this in hydro:https://github.com/Riverscapes/riverscapes-tools/blob/a64481874e269a9e7e592a0da543c17e00847549/packages/hydro/hydro/utils/hydrology.py#L118
Task 2
This is hard... abort if it gets out of hand...
The "equations" listed refer to parameters, such as
PRECIP
for precipitation andFORESTPC
for percent forested. Is it possible to strip out all the parameter names and then rank them by the decending frequency with which they occur? So I expect the result to be something like the following. The values to the right of the variable names are counts that they occur in the equations.Essentially I want to know the top 10 to 20 parameters that occur in these equations. The next step will be adding the calculation of these parameters to Riverscapes Context model.
FYI @jtgilbert