diff --git a/src/libcode/vx_pointdata_python/python_pointdata.cc b/src/libcode/vx_pointdata_python/python_pointdata.cc index 53e92a3386..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); @@ -613,8 +614,8 @@ command << cs_erase << replace_path(python_dir) << "\")"; run_python_string(command.text()); -mlog << Debug(1) << method_name << "added python path (" - << python_dir << ") to python interpreter\n"; +mlog << Debug(3) << method_name << "added python path (" + << replace_path(python_dir) << ") to python interpreter\n"; //setenv(env_PYTHONPATH, python_dir.c_str(),1);