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

flopy.utils.binaryfile.HeadFile will not read Henry.hds binary #46

Closed
Huite opened this issue Aug 5, 2015 · 2 comments
Closed

flopy.utils.binaryfile.HeadFile will not read Henry.hds binary #46

Huite opened this issue Aug 5, 2015 · 2 comments

Comments

@Huite
Copy link

Huite commented Aug 5, 2015

When I run the Henry Saltwater Intrusion Problem script, I can't seem to read the .hds file using flopy.utils.binaryfile.HeadFile. Everything else works just like in the example, I can get the concentrations and cell budgets and make the plot as shown in the example.

When reading a different .hds file, e.g. the lake example or tutorial 2, it works fine.

Running the following snippet

import flopy.utils.binaryfile as bf
bf.HeadFile('lake_example.hds')

gives, as expected

Out[55]:
<flopy.utils.binaryfile.HeadFile at 0x15eba8d0>

But from

import flopy.utils.binaryfile as bf
bf.HeadFile('henry.hds')

I get the following error:

Traceback (most recent call last):

  File "<ipython-input-48-7d116619a952>", line 1, in <module>
    bf.HeadFile('henry.hds')

  File "C:\Anaconda\lib\site-packages\flopy\utils\binaryfile.py", line 562, in __init__
    super(HeadFile, self).__init__(filename, precision, verbose)

  File "C:\Anaconda\lib\site-packages\flopy\utils\binaryfile.py", line 218, in __init__
    self._build_index()

  File "C:\Anaconda\lib\site-packages\flopy\utils\binaryfile.py", line 253, in _build_index
    self.file.seek(self.databytes, 1)

IOError: [Errno 22] Invalid argument

Maybe it has something to do with SEAWAT, since bf.HeadFile works for steady state and transient MODFLOW. Incidentally, none of the examples seem to feature getting the heads from SEAWAT (I'm just starting out though, so my intuitions probably aren't worth much).

It this error reproducible, or is it something on my side?

@langevin-usgs
Copy link
Contributor

Yes, this is a problem with the notebook. The issue is that ipakcb is set to 51 for the well package. So the well budgets are being written to the heads file. If you remove "ipakcb=51" from the well constructor, then it works fine. We will fix the notebook. Thanks for the note.

@Huite
Copy link
Author

Huite commented Aug 6, 2015

Great, that fixes it. Thanks.

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

No branches or pull requests

2 participants