Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: cannot pull CellBudgetFile records for a single package instance when there are multiple packages of the same type #2178

Closed
jknightusgs opened this issue May 3, 2024 · 2 comments
Labels

Comments

@jknightusgs
Copy link

I have 2 drain packages in a MF6 (v6.4.0) model.
I assigned the pname variable "drnts" for one and "drnws" for the other.
they show up in the name file as such:
drn6 blrm.drnts drnts
drn6 blrm.drnws drnws

flows for each package are saved to the cell budget binary output file.
I instantiate the CellBudgetFile object.
cbc = flopy.utils.CellBudgetFile(cbcfile, precision='double', verbose=True)
cbc.get_unique_record_names()
[b' STO-SS',
b' STO-SY',
b' FLOW-JA-FACE',
b' DATA-SPDIS',
b' WEL',
b' DRN',
b' GHB',
b' RCH',
b' RCHA',
b' SFR']
get_unique_package_names():
[b'', b'NPF ', b'BLRM ']

the get_data() function only allows using "text" or "paknam" to find records.
cbc.get_data(text="DRN")
Returning DRN as a numpy recarray of size (655, 2)
Returning DRN as a numpy recarray of size (409, 2)
Returning DRN as a numpy recarray of size (655, 2)
Returning DRN as a numpy recarray of size (409, 2)
...the 2 drn packages are returned for each stress period of the model

Is there a way to pull records for just one of the DRN packages?
In the cbc recordarray I see that the pnames I assigned are saved in the "paknam2" field:
image

but there doesn't seem to be a way to search cbc records based on the paknam2 field.
alternatively, is there a way when building the model in flopy to get the pname variable assigned to "paknam" instead of "paknam2" so that I can pull cbc data with the paknam argument instead of the text argument?

thanks!

@jknightusgs jknightusgs added the bug label May 3, 2024
@langevin-usgs
Copy link
Contributor

A recent addition through this PR should help. You should be able to specify paknam2 in the get_data() method. It is relatively new, so you may need to use the develop version. Will this work?

@jknightusgs
Copy link
Author

jknightusgs commented May 3, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants