-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Per #1471, defined a parse_grid_string() function in the vx_statistics library and then updated vx_data2d_python to call that function. However, this creates a circular dependency because vx_data2d_python now depends on vx_statistics. * Per #1471, because of the change in dependencies, I had to modify many, many Makefile.am files to link to the -lvx_statistics after -lvx_data2d_python. This is not great, but I didn't find a better solution. * Per #1471, add a sanity check to make sure the grid and data dimensions actually match. * Per #1471, add 3 new unit tests to demonstrate setting the python grid as a named grid, grid specification string, or a gridded data file. * Per #1471, document python grid changes in appendix F. * Per #1471, just spacing. * Per #1471, lots of Makefile.am changes to get this code to compile on kiowa. Worringly, it compiled and linked fine on my Mac laptop but not on kiowa. Must be some large differences in the linker logic. Co-authored-by: John Halley Gotway <johnhg@kiowa.rap.ucar.edu>
- Loading branch information
1 parent
d80aafa
commit 6ed8fc4
Showing
46 changed files
with
394 additions
and
82 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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
from __future__ import print_function | ||
|
||
import numpy as np | ||
import os | ||
import sys | ||
|
||
########################################### | ||
|
||
print('Python Script:\t', sys.argv[0]) | ||
|
||
## | ||
## input file specified on the command line | ||
## load the data into the numpy array | ||
## | ||
|
||
if len(sys.argv) == 3: | ||
# Read the input file as the first argument | ||
input_file = os.path.expandvars(sys.argv[1]) | ||
data_name = sys.argv[2] | ||
try: | ||
# Print some output to verify that this script ran | ||
print("Input File:\t" + repr(input_file)) | ||
print("Data Name:\t" + repr(data_name)) | ||
met_data = np.loadtxt(input_file) | ||
print("Data Shape:\t" + repr(met_data.shape)) | ||
print("Data Type:\t" + repr(met_data.dtype)) | ||
except NameError: | ||
print("Can't find the input file") | ||
else: | ||
print("ERROR: read_ascii_numpy.py -> Must specify exactly one input file and a name for the data.") | ||
sys.exit(1) | ||
|
||
########################################### | ||
|
||
## | ||
## create the metadata dictionary | ||
## | ||
|
||
attrs = { | ||
|
||
'valid': '20050807_120000', | ||
'init': '20050807_000000', | ||
'lead': '120000', | ||
'accum': '120000', | ||
|
||
'name': data_name, | ||
'long_name': data_name + '_word', | ||
'level': 'Surface', | ||
'units': 'None', | ||
'grid': os.path.expandvars(os.getenv('PYTHON_GRID')) | ||
} | ||
|
||
print("Attributes:\t" + repr(attrs)) |
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.