Skip to content

Commit

Permalink
#2474 renamed create_header_attrs to set_dataplane_attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Apr 14, 2023
1 parent 97d3ec7 commit f5a164d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 3 additions & 3 deletions scripts/python/examples/read_ascii_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
met_data = None
print("Can't find the input file")

# attrs is a dictionary which contains header data for the dataplane.
# attrs should have 9 members with string type data:
# attrs is a dictionary which contains attributes describing the dataplane.
# attrs should have 9 items, each of data type string:
# 'name': data name
# 'long_name': descriptive name
# 'valid': valid time (format = 'yyyymmdd_hhmmss')
Expand Down Expand Up @@ -78,7 +78,7 @@
}

long_name = data_name + "_word"
attrs = dataplane.create_header_attrs(data_name, valid_time, init_time,
attrs = dataplane.set_dataplane_attrs(data_name, valid_time, init_time,
lead_time, accum_time, v_level, units,
grid_lambert_conformal, long_name)

Expand Down
6 changes: 3 additions & 3 deletions scripts/python/examples/read_ascii_numpy_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
except NameError:
print("Can't find the input file")

# attrs is a dictionary which contains header data for the dataplane.
# attrs should have 9 members with string type data:
# attrs is a dictionary which contains attributes describing the dataplane.
# attrs should have 9 items, each of data type string:
# 'name': data name
# 'long_name': descriptive name
# 'valid': valid time (format = 'yyyymmdd_hhmmss')
Expand All @@ -57,7 +57,7 @@
grid_info = os.path.expandvars(os.getenv('PYTHON_GRID'))

long_name = data_name + "_word"
attrs = dataplane.create_header_attrs(data_name, valid_time, init_time,
attrs = dataplane.set_dataplane_attrs(data_name, valid_time, init_time,
lead_time, accum_time, v_level, units,
grid_info, long_name)

Expand Down
6 changes: 3 additions & 3 deletions scripts/python/examples/read_ascii_xarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
## create the metadata dictionary
##

# attrs is a dictionary which contains header data for the dataplane.
# attrs should have 9 members with string type data:
# attrs is a dictionary which contains attributes describing the dataplane.
# attrs should have 9 items, each of data type string:
# 'name': data name
# 'long_name': descriptive name
# 'valid': valid time (format = 'yyyymmdd_hhmmss')
Expand Down Expand Up @@ -85,7 +85,7 @@
}

long_name = data_name + "_word"
attrs = dataplane.create_header_attrs(data_name, valid_time, init_time,
attrs = dataplane.set_dataplane_attrs(data_name, valid_time, init_time,
lead_time, accum_time, v_level, units,
grid_lambert_conformal)

Expand Down
5 changes: 3 additions & 2 deletions scripts/python/met/dataplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class dataplane():
##

#@staticmethod
# Python dictionary items:
# 'name': data name
# 'long_name': descriptive name
# 'valid': valid time (format = 'yyyymmdd_hhmmss')
Expand All @@ -24,7 +25,7 @@ class dataplane():
# - a gridded data file name
# - MET specific grid string, "lambert 185 129 12.19 -133.459 -95 40.635 6371.2 25 25 N"
# - a dictionary for the grid information
def create_header_attrs(data_name, valid_time, init_time, lead_time,
def set_dataplane_attrs(data_name, valid_time, init_time, lead_time,
accum_time, v_level, units, grid_info, long_name=None):
hdr_attrs = {

Expand All @@ -34,7 +35,7 @@ def create_header_attrs(data_name, valid_time, init_time, lead_time,
'accum': accum_time,

'name': data_name,
'long_name': long_name if long_name is not None and long_name != "" else data_name + '_word',
'long_name': long_name if long_name is not None and long_name != "" else data_name + '_long',
'level': v_level,
'units': units,

Expand Down

0 comments on commit f5a164d

Please sign in to comment.