Closed dbrakenhoff closed 10 months ago
Without knowing how this may impact the code, I am more in favor of adding an extra argument called column
with a default value of "q" to get_budget_da
:
qz = nlmod.gwf.output.get_budget_da("DATA-SPDIS", column="qz", ds=ds)
That also works but requires a few more lines of code (passing along the column key). But I guess that is more clear for users.
I agree that it is easier for the user to have an extra column
argument
Solved by PR #285
Currently, getting specific discharge information as a data-array is not possible with nlmod.
Since we always use the create3D option in our binary read files we currently cannot access any other data than
["q"]
in the budget rec-array. This works fine for most budget terms but will not work on budget datasets like"DATA-SPDIS"
, where"q"
is filled with all zeros, and other variables["qx", "qy", "qz"]
contain the actual interesting data.One option to deal with this would be to introduce some logic in the parsing of the
text
argument toget_budget_da()
. For example:Here the
".qz"
indicates we want to load the data not from the default "q" variable in the rec-array, but the "qz" variable. This requires a minimal change to the current code, and allows you to access other data from more complex budget files. If no"."
is present in the text, it defaults to theq
variable (the current (flopy) default). This does require some knowledge about the budget rec-array, which users will have to figure out using flopy.Perhaps we should also include a warning when loading
DATA-SPDIS
as currently the code completes just fine, but you're left with a data-array filled with zeros.What do you think about introducing this
.
-logic to the text argument @rubencalje, @OnnoEbbens ?