Skip to content

Commit

Permalink
#1581 Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed May 26, 2021
1 parent 355e261 commit 5beea16
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 170 deletions.
2 changes: 0 additions & 2 deletions met/src/libcode/vx_nc_obs/nc_obs_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

using namespace std;

//#include <algorithm>
#include <iostream>

//#include "vx_math.h"
#include "vx_nc_util.h"

#include "nc_obs_util.h"
Expand Down
71 changes: 0 additions & 71 deletions met/src/libcode/vx_nc_obs/nc_point_obs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,6 @@ void MetNcPointObs::init_from_scratch() {

////////////////////////////////////////////////////////////////////////

//bool MetNcPointObs::check_nc(const char *nc_name, const char *caller) {
// bool exit_on_error = false;
// bool valid = obs_vars.is_valid(exit_on_error);
// if (!valid) {
// mlog << Error << "\n" << (0 != caller ? caller : "") << " -> "
// << "missing core data from the netCDF file: "
// << nc_name << "\n\n";
// exit(1);
// }
// return valid;
//}

////////////////////////////////////////////////////////////////////////

void MetNcPointObs::close() {
if ( !keep_nc && obs_nc ) {
delete obs_nc;
Expand Down Expand Up @@ -163,57 +149,6 @@ bool MetNcPointObs::open(const char * filename) {
return set_netcdf(open_ncfile(filename));
}

//////////////////////////////////////////////////////////////////////////
//
//bool MetNcPointObs::read_dim_headers() {
// bool status = false;
// if( IS_VALID_NC_P(obs_nc) ) {
// status = true;
// obs_vars.read_dims_vars(obs_nc);
// nobs = obs_vars.obs_cnt = GET_NC_SIZE(obs_vars.obs_dim);
// nhdr = obs_vars.hdr_cnt = GET_NC_SIZE(obs_vars.hdr_dim);
// obs_vars.use_var_id = use_var_id = IS_VALID_NC(obs_vars.obs_vid_var);
// use_arr_vars = IS_VALID_NC(obs_vars.obs_arr_var);
// obs_vars.read_header_data(header_data);
// }
// return status;
//}
//
//////////////////////////////////////////////////////////////////////////
//
//bool MetNcPointObs::read_obs_data() {
// bool status = read_obs_data_numbers() && read_obs_data_strings();
// return status;
//}
//
//////////////////////////////////////////////////////////////////////////
//
//bool MetNcPointObs::read_obs_data(int buf_size, int start, float *obs_arr_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);
//}
//
//////////////////////////////////////////////////////////////////////////
//
//bool MetNcPointObs::read_obs_data_numbers() {
// bool status = false;
// if( IS_VALID_NC_P(obs_nc) ) {
// status = obs_data.read_obs_data_numbers(obs_vars);
// }
// return status;
//}
//
//////////////////////////////////////////////////////////////////////////
//
//bool MetNcPointObs::read_obs_data_strings() {
// bool status = false;
// if( IS_VALID_NC_P(obs_nc) ) {
// status = obs_data.read_obs_data_strings(obs_vars);
// }
// return status;
//}
//
////////////////////////////////////////////////////////////////////////

bool MetNcPointObs::set_netcdf(NcFile *nc_file, bool _keep_nc) {
Expand All @@ -223,11 +158,5 @@ bool MetNcPointObs::set_netcdf(NcFile *nc_file, bool _keep_nc) {
return IS_VALID_NC_P(obs_nc);
}

////////////////////////////////////////////////////////////////////////
//
//void MetNcPointObs::set_using_var_id(bool using_var_id) {
// use_var_id = obs_vars.use_var_id = using_var_id;
//}
//
//////////////////////////////////////////////////////////////////////////

16 changes: 0 additions & 16 deletions met/src/libcode/vx_nc_obs/nc_point_obs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*




////////////////////////////////////////////////////////////////////////


Expand Down Expand Up @@ -62,7 +60,6 @@ class MetNcPointObs {

bool open(const char * filename);
void close();
// bool check_nc(const char *nc_name, const char *caller=empty_name);
bool set_netcdf(NcFile *nc_file, bool _keep_nc=false);

int get_buf_size();
Expand All @@ -71,11 +68,9 @@ class MetNcPointObs {
bool get_header(int header_offset, float hdr_arr[HDR_ARRAY_LEN],
ConcatString &hdr_typ_str, ConcatString &hdr_sid_str,
ConcatString &hdr_vld_str);
//int get_hdr_arr_len();
bool get_header_type(int header_offset, int hdr_typ_arr[HDR_TYPE_ARR_LEN]);
bool get_lats(float *hdr_lats);
bool get_lons(float *hdr_lons);
//int get_obs_arr_len();
int get_obs_cnt();
NcPointObsData get_point_obs_data();
StringArray get_qty_data();
Expand All @@ -85,15 +80,6 @@ class MetNcPointObs {
bool is_using_var_id();
bool is_using_obs_arr();

// bool read_dim_headers();
// bool read_obs_data();
// 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();

// void set_using_var_id(bool using_var_id);

// variables

// data
Expand All @@ -102,7 +88,6 @@ class MetNcPointObs {

////////////////////////////////////////////////////////////////////////

//inline NetcdfObsVars MetNcPointObs::get_obs_vars() { return obs_vars; }
inline NcHeaderData MetNcPointObs::get_header_data() { return header_data; }
inline int MetNcPointObs::get_buf_size() { return OBS_BUFFER_SIZE; }
inline int MetNcPointObs::get_hdr_cnt() { return nhdr; }
Expand All @@ -121,4 +106,3 @@ inline bool MetNcPointObs::is_using_var_id() { return use_var_id; }

////////////////////////////////////////////////////////////////////////


16 changes: 0 additions & 16 deletions met/src/libcode/vx_nc_obs/nc_point_obs_in.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ using namespace std;
#include "vx_log.h"

#include "nc_point_obs_in.h"
//#include "write_netcdf.h"

////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -115,18 +114,3 @@ bool MetNcPointObsIn::read_obs_data_strings() {

////////////////////////////////////////////////////////////////////////

//bool MetNcPointObsIn::set_netcdf(NcFile *nc_file, bool _keep_nc) {
// close();
// keep_nc = _keep_nc;
// obs_nc = nc_file;
// return IS_VALID_NC_P(obs_nc);
//}

////////////////////////////////////////////////////////////////////////

//void MetNcPointObsIn::set_using_var_id(bool using_var_id) {
// use_var_id = obs_vars.use_var_id = using_var_id;
//}

////////////////////////////////////////////////////////////////////////

45 changes: 0 additions & 45 deletions met/src/libcode/vx_nc_obs/nc_point_obs_in.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*




////////////////////////////////////////////////////////////////////////


#ifndef __NC_POINT_OBS_IN_H__
#define __NC_POINT_OBS_IN_H__


////////////////////////////////////////////////////////////////////////


Expand All @@ -25,7 +21,6 @@
#include "nc_utils.h"
#include "nc_obs_util.h"
#include "nc_var_info.h"
//#include "vx_summary.h"
#include "nc_point_obs.h"


Expand All @@ -42,39 +37,13 @@ class MetNcPointObsIn : public MetNcPointObs {
MetNcPointObsIn();
~MetNcPointObsIn();

// bool open(const char * filename);
// void close();
bool check_nc(const char *nc_name, const char *caller=empty_name);
// bool set_netcdf(NcFile *nc_file, bool _keep_nc=false);
//
// int get_buf_size();
// int get_hdr_cnt();
// NcHeaderData get_header_data();
// bool get_header(int header_offset, float hdr_arr[HDR_ARRAY_LEN],
// ConcatString &hdr_typ_str, ConcatString &hdr_sid_str,
// ConcatString &hdr_vld_str);
// //int get_hdr_arr_len();
// bool get_header_type(int header_offset, int hdr_typ_arr[HDR_TYPE_ARR_LEN]);
// bool get_lats(float *hdr_lats);
// bool get_lons(float *hdr_lons);
// //int get_obs_arr_len();
// int get_obs_cnt();
// NcPointObsData get_point_obs_data();
// StringArray get_qty_data();
// int get_qty_length();
// StringArray get_var_names();
//
// bool is_using_var_id();
// bool is_using_obs_arr();
//
bool read_dim_headers();
bool read_obs_data();
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();
//
// void set_using_var_id(bool using_var_id);

// variables

Expand All @@ -84,16 +53,6 @@ class MetNcPointObsIn : public MetNcPointObs {

////////////////////////////////////////////////////////////////////////

// HS //inline NetcdfObsVars MetNcPointObs::get_obs_vars() { return obs_vars; }
// HS inline NcHeaderData MetNcPointObs::get_header_data() { return header_data; }
// HS inline int MetNcPointObs::get_buf_size() { return OBS_BUFFER_SIZE; }
// HS inline int MetNcPointObs::get_hdr_cnt() { return nhdr; }
// HS inline int MetNcPointObs::get_obs_cnt() { return nobs; }
// HS inline NcPointObsData MetNcPointObs::get_point_obs_data() { return obs_data; }
// HS inline StringArray MetNcPointObs::get_qty_data() { return obs_data.qty_names; }
// HS inline StringArray MetNcPointObs::get_var_names() { return obs_data.var_names; }
// HS inline bool MetNcPointObs::is_using_obs_arr() { return use_arr_vars; }
// HS inline bool MetNcPointObs::is_using_var_id() { return use_var_id; }

////////////////////////////////////////////////////////////////////////

Expand Down Expand Up @@ -128,8 +87,6 @@ class MetNcPointObs2Write : public MetNcPointObs {
int get_buf_size();
void get_dim_counts(int *obs_cnt, int *hdr_cnt);
int get_hdr_index();
// bool get_hdr_obs_count(int *obs_cnt, int *hdr_cnt);
// int get_obs_cnt();
int get_obs_index();
NcObsOutputData *get_output_data();
NetcdfObsVars *get_obs_vars();
Expand All @@ -142,7 +99,6 @@ class MetNcPointObs2Write : public MetNcPointObs {
void set_nc_out_data(vector<Observation> observations,
SummaryObs *summary_obs, TimeSummaryInfo summary_info,
int processed_hdr_cnt=0);
// bool set_reset_hdr_buffer(bool reset_buffer);

void write_arr_headers();
void write_buf_headers ();
Expand All @@ -169,7 +125,6 @@ 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; }
//inline bool MetNcPointObs2Write::set_reset_hdr_buffer(bool reset_buffer) { reset_hdr_buffer = reset_buffer; }

////////////////////////////////////////////////////////////////////////

Expand Down
7 changes: 0 additions & 7 deletions met/src/libcode/vx_nc_obs/nc_point_obs_out.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,8 @@ bool MetNcPointObsOut::init_netcdf(int obs_count, int hdr_count,
mlog << Debug(5) << method_name << "reset " << hdr_cnt << " headers (" << hdr_count << ").\n";
}

//nobs = obs_count;
nobs = obs_vars.obs_cnt = obs_count;
nhdr = obs_vars.hdr_cnt = hdr_count;
//obs_vars.set_obs_count(obs_count);
//obs_vars.deflate_level = out_data.deflate_level;

obs_vars.create_hdr_vars(obs_nc, hdr_count);
obs_vars.create_obs_vars(obs_nc);
Expand Down Expand Up @@ -464,9 +461,6 @@ void MetNcPointObsOut::write_observation(const float obs_arr[OBS_ARRAY_LEN],
}
data_buffer.qty_idx_buf[obs_data_idx] = qty_index;

//for (int idx=0; idx<OBS_ARRAY_LEN; idx++) {
// data_buffer.obs_data_buf[obs_data_idx][idx] = obs_arr[idx];
//}
data_buffer.obs_hid_buf[obs_data_idx] = obs_arr[0];
data_buffer.obs_vid_buf[obs_data_idx] = obs_arr[1];
data_buffer.obs_lvl_buf[obs_data_idx] = obs_arr[2];
Expand Down Expand Up @@ -525,7 +519,6 @@ int MetNcPointObsOut::write_obs_data(const vector< Observation > observations,
string prev_station_id = "";
ConcatString obs_qty;
int headerOffset = data_buffer.cur_hdr_idx;
//float obs_arr[obs_arr_len];
const string method_name = " write_obs_data()";

int obs_buf_size = observations.size();
Expand Down
13 changes: 0 additions & 13 deletions met/src/libcode/vx_nc_obs/nc_point_obs_out.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,13 @@
// *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*




////////////////////////////////////////////////////////////////////////


#ifndef __NC_POINT_OBS_OUT_H__
#define __NC_POINT_OBS_OUT_H__


////////////////////////////////////////////////////////////////////////


#include <ostream>

#include "observation.h"
Expand All @@ -28,7 +23,6 @@
#include "nc_var_info.h"
#include "vx_summary.h"


////////////////////////////////////////////////////////////////////////
// struct definition

Expand All @@ -46,9 +40,6 @@ class MetNcPointObsOut : public MetNcPointObs {
NcDataBuffer data_buffer;
NcObsOutputData out_data;

//MetNcPointObsOut(const MetNcPointObsOut &);
//MetNcPointObsOut & operator=(const MetNcPointObsOut &);

void init_from_scratch();

public:
Expand All @@ -68,8 +59,6 @@ class MetNcPointObsOut : public MetNcPointObs {
int get_buf_size();
void get_dim_counts(int *obs_cnt, int *hdr_cnt);
int get_hdr_index();
// bool get_hdr_obs_count(int *obs_cnt, int *hdr_cnt);
// int get_obs_cnt();
int get_obs_index();
NcObsOutputData *get_output_data();
NetcdfObsVars *get_obs_vars();
Expand All @@ -82,7 +71,6 @@ class MetNcPointObsOut : public MetNcPointObs {
void set_nc_out_data(vector<Observation> observations,
SummaryObs *summary_obs, TimeSummaryInfo summary_info,
int processed_hdr_cnt=0);
// bool set_reset_hdr_buffer(bool reset_buffer);
void set_using_var_id(bool using_var_id);

void write_arr_headers();
Expand Down Expand Up @@ -110,7 +98,6 @@ inline int MetNcPointObsOut::get_hdr_index() { return data_buffer.cur_hdr_idx; }
inline int MetNcPointObsOut::get_obs_index() { return data_buffer.obs_data_idx; }
inline NcObsOutputData *MetNcPointObsOut::get_output_data() { return &out_data; }
inline NetcdfObsVars *MetNcPointObsOut::get_obs_vars() { return &obs_vars; }
//inline bool MetNcPointObsOut::set_reset_hdr_buffer(bool reset_buffer) { reset_hdr_buffer = reset_buffer; }

////////////////////////////////////////////////////////////////////////

Expand Down

0 comments on commit 5beea16

Please sign in to comment.