Skip to content

Commit

Permalink
Merge pull request #2529 from dtcenter/bugfix_2525_nhdr_1_off
Browse files Browse the repository at this point in the history
Bugfix #2525 nhdr 1 off
  • Loading branch information
hsoh-u committed Apr 28, 2023
2 parents bf0e5ad + dad2812 commit 38e68e7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
8 changes: 4 additions & 4 deletions scripts/python/met/dataplane.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def write_dataplane(met_in, netcdf_filename):
met_info['attrs'] = attrs

# determine fill value
try:
fill = met_in.met_data.get_fill_value()
except:
fill = -9999.
#try:
# fill = met_in.met_data.get_fill_value()
#except:
fill = -9999.

# write NetCDF file
ds = nc.Dataset(netcdf_filename, 'w')
Expand Down
9 changes: 4 additions & 5 deletions scripts/python/pyembed/python_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ def add_python_path(called_file): # called_file = __file__
met_base_dir = os.environ.get('MET_BASE', None)
if met_base_dir is not None:
met_python_path = os.path.join(met_base_dir, 'python')
if pyembed_tools.debug:
print(f"{method_name} added python path {os.path.abspath(met_python_path)} from MET_BASE")
sys.path.append(os.path.abspath(met_python_path))
if os.path.exists(met_python_path):
if pyembed_tools.debug:
print(f"{method_name} added python path {os.path.abspath(met_python_path)} from MET_BASE")
sys.path.append(os.path.abspath(met_python_path))

# add share/met/python directory to system path
met_python_path = os.path.join(script_dir, os.pardir, 'python')
Expand All @@ -50,8 +51,6 @@ def add_python_path(called_file): # called_file = __file__
if pyembed_tools.debug:
print(f"{method_name} added python path {os.path.abspath(met_python_path)}")
sys.path.append(os.path.abspath(met_python_path))
else:
print(" - {d} does not exist".format(d=met_python_path))

@staticmethod
def call_python(argv):
Expand Down
2 changes: 1 addition & 1 deletion src/libcode/vx_pointdata_python/python_pointdata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ bool process_point_data_list(PyObject *python_point_data, MetPointDataPython &me
<< "The header is empty. Please check the python script and input\n\n";
exit (1);
}
met_pd_out.set_hdr_cnt(hid);
met_pd_out.set_hdr_cnt(hid + 1);

check_obs_data(obs_data, use_var_id, method_name);
check_header_data(header_data, method_name);
Expand Down

0 comments on commit 38e68e7

Please sign in to comment.