At OWI, we opened-up some of our internal Python to read our WIN/PRE ascii formats, which are referred to as OWI or NWS12 files by the ADCIRC community.
The code is broken up into the following components:
- An owiWinPre Python module: https://gitlab.com/oceanweather/Python-Sub/owiWinPre
- A winpre_to_nws13.py Python script for converting formats NWS12 to NWS13: https://gitlab.com/oceanweather/Python-Scripts/wind/winpre_to_nws13
These components have been assembled into a Docker container image with the Dockerfile and repository available on Gitlab as well. This container image has the required publically available Python dependencies already installed, and running from Docker will execute the winpre_to_nws13.py script.
Using the container image’s convert command #
Call with the following:
|
|
Converting multiple NWS12 overlays would look like the following example.
|
|
The Gitlab container registry has been populated with my builds of the image.
|
|
Available build tags for the image can be found on Gitlab.
Format Converter CLI #
usage: [-h] -w WIN [WIN ...] -p PRE [PRE ...] -o OUTPUT
[-g GROUP [GROUP ...]] [-a] [-v]
Convert a series of OWI WIN/PRE files to an ADCIRC NWS13 Netcdf file.
optional arguments:
-h, --help show this help message and exit
-w WIN [WIN ...], --win WIN [WIN ...]
Input WIN file(s)
-p PRE [PRE ...], --pre PRE [PRE ...]
Input PRE file(s)
-o OUTPUT, --output OUTPUT
Output file path
-g GROUP [GROUP ...], --group GROUP [GROUP ...]
Input group name(s)
-a, --append If set, do not clobber the existing file, but append groups to it.
-v, --verbose Verbose log output