Skip to content

Commit

Permalink
Per #1693, this fixes a bug that also needs to be documented and fixe…
Browse files Browse the repository at this point in the history
…d in main_v10.0 and develop. Setting grid = name does not work when MET_PYTHON_EXE is set. The read_tmp_dataplane.py needs to be tweaked to support this usage.
  • Loading branch information
JohnHalleyGotway committed May 19, 2021
1 parent 5d550e5 commit 1a8e558
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions met/data/wrappers/read_tmp_dataplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@
ds = nc.Dataset(netcdf_filename, 'r')
met_data = ds['met_data'][:]
met_attrs = {}

# grid is defined as a dictionary or string
grid = {}
for attr, attr_val in ds.__dict__.items():
if 'grid' in attr:
if 'grid.' in attr:
grid_attr = attr.split('.')[1]
grid[grid_attr] = attr_val
else:
met_attrs[attr] = attr_val
met_attrs['grid'] = grid

if grid:
met_attrs['grid'] = grid

met_attrs['name'] = met_attrs['name_str']
del met_attrs['name_str']
met_info['met_data'] = met_data
Expand Down

0 comments on commit 1a8e558

Please sign in to comment.