forked from parflow/parflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration of new PFB IO functionality and xarray compatibility (par…
…flow#365) Add simple and fast pure-python based readers and writers of PFB files, done by myself and Bill Hasling (@wh3248). This eliminates the need for the external ParflowIO dependency. Implemented a new backend for the xarray package that let's you open both .pfb files as well as .pfmetadata files directly into xarray datastructures. These are very useful for data wrangling and scientific analysis Basic usage of the new functionality: import parflow as pf # Read a pfb file as numpy array: x = pf.read_pfb('/path/to/file.pfb') # Read a pfb file as an xarray dataset: ds = xr.open_dataset('/path/to/file.pfb', name='example') # Write a pfb file with distfile: pf.write_pfb('/path/to/new_file.pfb', x, p=p, q=q, r=r, dist=True)
- Loading branch information
Showing
26 changed files
with
2,006 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
"""parflow.tools module | ||
Export Run() object | ||
Export Run() object and IO functions | ||
""" | ||
from .core import Run | ||
from .io import ParflowBinaryReader, read_pfb, read_pfb_sequence, write_pfb | ||
|
||
__all__ = ['Run'] | ||
__all__ = [ | ||
'Run', | ||
'ParflowBinaryReader', | ||
'read_pfb', | ||
'write_pfb', | ||
'read_pfb_sequence', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.