From 6af1d2f40d9f4e7917d38a5cfacedd06e8ecbe3d Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Fri, 15 Dec 2023 23:54:19 +0000 Subject: [PATCH] #2755 Added a header count and checking header count instead of using header id (hid) --- src/libcode/vx_pointdata_python/python_pointdata.cc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libcode/vx_pointdata_python/python_pointdata.cc b/src/libcode/vx_pointdata_python/python_pointdata.cc index 8133f81ac7..cf6b2b2418 100644 --- a/src/libcode/vx_pointdata_python/python_pointdata.cc +++ b/src/libcode/vx_pointdata_python/python_pointdata.cc @@ -405,16 +405,17 @@ bool process_point_data_list(PyObject *python_point_data, MetPointDataPython &me } // for j - met_pd_out.set_use_var_id(use_var_id); - mlog << Debug(9) << method_name << "use_var_id: \"" << use_var_id - << "\" from python. is_using_var_id(): " << met_pd_out.is_using_var_id() << "\n"; - - if (hid <= 0) { + int h_cnt = hid + 1; // hid starts with -1 + if (h_cnt < 0) { mlog << Error << "\n" << method_name << "The header is empty. Please check the python script and input\n\n"; exit (1); } - met_pd_out.set_hdr_cnt(hid + 1); + met_pd_out.set_hdr_cnt(h_cnt); + + met_pd_out.set_use_var_id(use_var_id); + mlog << Debug(9) << method_name << "use_var_id: \"" << use_var_id + << "\" from python. is_using_var_id(): " << met_pd_out.is_using_var_id() << "\n"; check_obs_data(obs_data, use_var_id, method_name); check_header_data(header_data, method_name);