Skip to content

Commit

Permalink
#3007 Added station_value_base_t and point_pair_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Dec 20, 2024
1 parent bcf1709 commit 4186e9c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
29 changes: 26 additions & 3 deletions src/libcode/vx_statistics/pair_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,38 @@ static bool sort_obs(ob_val_t a, ob_val_t b) { return a.val<b.val; }

////////////////////////////////////////////////////////////////////////
//
// Code for struct station_values_t
// Code for struct station_value_base_t
//
////////////////////////////////////////////////////////////////////////

void station_values_t::clear() {
void station_value_base_t::clear() {
typ.clear();
sid.clear();
lat = lon = x = y = wgt = bad_data_double;
lat = lon = bad_data_double;
ut = (unixtime) 0;
lvl = elv = bad_data_double;
}

////////////////////////////////////////////////////////////////////////
//
// Code for struct station_values_t
//
////////////////////////////////////////////////////////////////////////

void point_pair_t::clear() {
station_value_base_t::clear();
fval = oval= bad_data_double;
}

////////////////////////////////////////////////////////////////////////
//
// Code for struct station_values_t
//
////////////////////////////////////////////////////////////////////////

void station_values_t::clear() {
station_value_base_t::clear();
x = y = wgt = bad_data_double;
fcmn = fcsd = ocmn = ocsd = bad_data_double;
summary_val = bad_data_double;
obs.clear();
Expand Down
22 changes: 18 additions & 4 deletions src/libcode/vx_statistics/pair_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,34 @@ struct ob_val_t {
std::string qc;
};

struct station_values_t {
struct station_value_base_t {

void clear();

std::string typ;
std::string sid;
double lat;
double lon;
double x;
double y;
double wgt;
unixtime ut;
double lvl;
double elv;
};

struct point_pair_t : station_value_base_t {

void clear();

double fval;
double oval;
};

struct station_values_t : station_value_base_t {

void clear();

double x;
double y;
double wgt;
double fcmn;
double fcsd;
double ocmn;
Expand Down

0 comments on commit 4186e9c

Please sign in to comment.