From bf24f7a61ad2743c1f58113ac1d3e3435364aee9 Mon Sep 17 00:00:00 2001 From: Howard Soh Date: Thu, 27 May 2021 18:47:08 -0600 Subject: [PATCH] #1581 Reanmed read_obs_data_strings to read_obs_data_table_lookups --- met/src/libcode/vx_nc_obs/nc_point_obs_in.cc | 11 +-- met/src/libcode/vx_nc_obs/nc_point_obs_in.h | 81 +------------------- 2 files changed, 5 insertions(+), 87 deletions(-) diff --git a/met/src/libcode/vx_nc_obs/nc_point_obs_in.cc b/met/src/libcode/vx_nc_obs/nc_point_obs_in.cc index f29ead8c51..3345edb5a7 100644 --- a/met/src/libcode/vx_nc_obs/nc_point_obs_in.cc +++ b/met/src/libcode/vx_nc_obs/nc_point_obs_in.cc @@ -24,9 +24,6 @@ using namespace std; #include "nc_point_obs_in.h" -//////////////////////////////////////////////////////////////////////// - - //////////////////////////////////////////////////////////////////////// @@ -80,14 +77,14 @@ bool MetNcPointObsIn::read_dim_headers() { ////////////////////////////////////////////////////////////////////// bool MetNcPointObsIn::read_obs_data() { - bool status = read_obs_data_numbers() && read_obs_data_strings(); + bool status = read_obs_data_numbers() && read_obs_data_table_lookups(); return status; } //////////////////////////////////////////////////////////////////////// bool MetNcPointObsIn::read_obs_data(int buf_size, int start, float *obs_arr_block, - int *obs_qty_idx_block, char *obs_qty_str_block) { + int *obs_qty_idx_block, char *obs_qty_str_block) { return obs_vars.read_obs_data(buf_size, start, qty_length, obs_arr_block, obs_qty_idx_block, obs_qty_str_block); } @@ -104,10 +101,10 @@ bool MetNcPointObsIn::read_obs_data_numbers() { //////////////////////////////////////////////////////////////////////// -bool MetNcPointObsIn::read_obs_data_strings() { +bool MetNcPointObsIn::read_obs_data_table_lookups() { bool status = false; if( IS_VALID_NC_P(obs_nc) ) { - status = obs_data.read_obs_data_strings(obs_vars); + status = obs_data.read_obs_data_table_lookups(obs_vars); } return status; } diff --git a/met/src/libcode/vx_nc_obs/nc_point_obs_in.h b/met/src/libcode/vx_nc_obs/nc_point_obs_in.h index 2d402de824..aa55ebcd8f 100644 --- a/met/src/libcode/vx_nc_obs/nc_point_obs_in.h +++ b/met/src/libcode/vx_nc_obs/nc_point_obs_in.h @@ -24,9 +24,6 @@ #include "nc_point_obs.h" -//////////////////////////////////////////////////////////////////////// -// struct definition - //////////////////////////////////////////////////////////////////////// @@ -43,7 +40,7 @@ class MetNcPointObsIn : public MetNcPointObs { bool read_obs_data(int buf_size, int start, float *obs_arr_block, int *obs_qty_idx_block, char *obs_qty_str_block); bool read_obs_data_numbers(); - bool read_obs_data_strings(); + bool read_obs_data_table_lookups(); // variables @@ -54,84 +51,8 @@ class MetNcPointObsIn : public MetNcPointObs { //////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////// - -class MetNcPointObs2Write : public MetNcPointObs { - - protected: - int raw_hdr_cnt; - bool reset_hdr_buffer; - - NcDataBuffer data_buffer; - NcObsOutputData out_data; - - //MetNcPointObs2Write(const MetNcPointObs2Write &); - //MetNcPointObs2Write & operator=(const MetNcPointObs2Write &); - - void init_from_scratch(); - - public: - - MetNcPointObs2Write(); - ~MetNcPointObs2Write(); - - bool add_header(const char *hdr_typ, const char *hdr_sid, const time_t hdr_vld, - const float hdr_lat, const float hdr_lon, const float hdr_elv); - bool add_header_prepbufr (const int pb_report_type, const int in_report_type, - const int instrument_type); - bool add_header_strings(const char *hdr_typ, const char *hdr_sid); - bool add_header_vld(const char *hdr_vld); - - void create_pb_hdrs(int pb_hdr_count); - - int get_buf_size(); - void get_dim_counts(int *obs_cnt, int *hdr_cnt); - int get_hdr_index(); - int get_obs_index(); - NcObsOutputData *get_output_data(); - NetcdfObsVars *get_obs_vars(); - - void init_buffer(); - void init_obs_vars(bool using_var_id, int deflate_level, bool attr_agl=false); - bool init_netcdf(int obs_count, int hdr_count, string program_name); - - void reset_header_buffer(int buf_size, bool reset_all); - void set_nc_out_data(vector observations, - SummaryObs *summary_obs, TimeSummaryInfo summary_info, - int processed_hdr_cnt=0); - - void write_arr_headers(); - void write_buf_headers (); - void write_header (const char *hdr_typ, const char *hdr_sid, const time_t hdr_vld, - const float hdr_lat, const float hdr_lon, const float hdr_elv); - void write_observation(); - void write_observation(const float obs_arr[OBS_ARRAY_LEN], const char *obs_qty); - void write_obs_data(); - int write_obs_data(const vector< Observation > observations, - const bool do_header = true); - bool write_to_netcdf(StringArray obs_names, StringArray obs_units, - StringArray obs_descs); - - // variables - - // data - -}; // MetNcPointObs2Write - - -//////////////////////////////////////////////////////////////////////// - -inline int MetNcPointObs2Write::get_hdr_index() { return data_buffer.cur_hdr_idx; } -inline int MetNcPointObs2Write::get_obs_index() { return data_buffer.obs_data_idx; } -inline NcObsOutputData *MetNcPointObs2Write::get_output_data() { return &out_data; } -inline NetcdfObsVars *MetNcPointObs2Write::get_obs_vars() { return &obs_vars; } - -//////////////////////////////////////////////////////////////////////// - - #endif /* __NC_POINT_OBS_IN_H__ */ //////////////////////////////////////////////////////////////////////// -