From ad2fada5eb28283818584b668e98529f1783d65a Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Thu, 27 Apr 2023 14:55:01 -0600 Subject: [PATCH 1/3] #2525 Correctnhdr from python embedding for 11 column data --- src/libcode/vx_pointdata_python/python_pointdata.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcode/vx_pointdata_python/python_pointdata.cc b/src/libcode/vx_pointdata_python/python_pointdata.cc index 4b3834a1d2..cef71163a5 100644 --- a/src/libcode/vx_pointdata_python/python_pointdata.cc +++ b/src/libcode/vx_pointdata_python/python_pointdata.cc @@ -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); From 68df283684a50531de1244c5e17b73555574ca6e Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Thu, 27 Apr 2023 14:55:47 -0600 Subject: [PATCH 2/3] #2525 Use -9999. as a missing value --- scripts/python/met/dataplane.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/python/met/dataplane.py b/scripts/python/met/dataplane.py index a9aed943b6..3da0e8b9e4 100644 --- a/scripts/python/met/dataplane.py +++ b/scripts/python/met/dataplane.py @@ -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') From dad2812241b6cbe142ea63885b493e683a2ed915 Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Thu, 27 Apr 2023 14:56:17 -0600 Subject: [PATCH 3/3] #2525 Removed a log message --- scripts/python/pyembed/python_embedding.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/python/pyembed/python_embedding.py b/scripts/python/pyembed/python_embedding.py index 434679b185..5240eb1120 100644 --- a/scripts/python/pyembed/python_embedding.py +++ b/scripts/python/pyembed/python_embedding.py @@ -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') @@ -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):