Skip to content

Commit

Permalink
Per #2279, more tweaks to get it to compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Oct 15, 2024
1 parent cf13262 commit 9ecea77
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 21 deletions.
4 changes: 2 additions & 2 deletions src/basic/vx_util/mask_sid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ void MaskSID::add_css(const string &text) {

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

bool MaskSID::has(const string &s) const {
bool MaskSID::has_sid(const string &s) const {
return SIDMap.count(s) > 0;
}

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

bool MaskSID::has(const string &s, double &weight) const {
bool MaskSID::has_sid(const string &s, double &weight) const {
bool found = false;

if(SIDMap.count(s) == 0) {
Expand Down
10 changes: 6 additions & 4 deletions src/basic/vx_util/mask_sid.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,23 @@ class MaskSID {

int n() const;
std::string name() const;
bool has_weights() const;
const std::map<std::string,double> & sid_map() const;

void set_name(const std::string &);

// Formatted as: station_name(numeric_weight)
void add(const std::string &);
void add_css(const std::string &);
bool has(const std::string &) const ;
bool has(const std::string &, double &) const;
bool has_sid(const std::string &) const ;
bool has_sid(const std::string &, double &) const;
};

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

inline int MaskSID::n() const { return (int) SIDMap.size(); }
inline std::string MaskSID::name() const { return Name; }
inline int MaskSID::n() const { return (int) SIDMap.size(); }
inline std::string MaskSID::name() const { return Name; }
inline bool MaskSID::has_weights() const { return HasWeights; }

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

Expand Down
4 changes: 2 additions & 2 deletions src/libcode/vx_analysis_util/stat_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1809,11 +1809,11 @@ void STATAnalysisJob::set_mask_sid(const char *c) {
<< "Station ID Mask: " << mask_sid_str << "\n";

MaskSID ms = parse_sid_mask(mask_sid_str);
for(const auto &pair : ms.sid_map) mask_sid.add(pair.first);
for(const auto &pair : ms.sid_map()) mask_sid.add(pair.first);

// List the length of the station ID mask
mlog << Debug(2)
<< "Parsed Station ID Mask (" << ms.name
<< "Parsed Station ID Mask (" << ms.name()
<< ") containing " << mask_sid.n() << " stations\n";

return;
Expand Down
6 changes: 3 additions & 3 deletions src/libcode/vx_statistics/pair_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ void PairBase::set_point_weight(const PointWeightType wgt_flag) {
<< mask_sid_ptr->name() << "\" station ID masking region.\n";

// Print warning if no weights are provided
if(!mask_sid_ptr->has_weights) {
if(!mask_sid_ptr->has_weights()) {
mlog << Warning << "\n" << method_name
<< "station ID point weighting requested but no weights "
<< "were defined in the \"" << mask_sid_ptr->name()
Expand All @@ -802,7 +802,7 @@ void PairBase::set_point_weight(const PointWeightType wgt_flag) {
for(int i_obs=0; i_obs<n_obs; i_obs++) {

double wgt;
if(mask_sid_ptr->has(sid_sa[i_obs], wgt)) {
if(mask_sid_ptr->has_sid(sid_sa[i_obs], wgt)) {
wgt_na.set(i_obs, wgt);
}
else {
Expand Down Expand Up @@ -1923,7 +1923,7 @@ bool VxPairBase::is_keeper_mask(
}
// Otherwise, check for the masking SID list
else if( pb_ptr[n]->mask_sid_ptr != nullptr &&
!pb_ptr[n]->mask_sid_ptr->has(hdr_sid_str)) {
!pb_ptr[n]->mask_sid_ptr->has_sid(hdr_sid_str)) {

if(mlog.verbosity_level() >= REJECT_DEBUG_LEVEL) {
mlog << Debug(REJECT_DEBUG_LEVEL)
Expand Down
4 changes: 2 additions & 2 deletions src/tools/core/ensemble_stat/ensemble_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,8 @@ void EnsembleStatConfInfo::process_masks(const Grid &grid) {
<< "Processing station ID mask: "
<< vx_opt[i].mask_sid[j] << "\n";
MaskSID ms = parse_sid_mask(vx_opt[i].mask_sid[j]);
sid_map[vx_opt[i].mask_sid[j]] = ms.name;
mask_sid_map[ms.name] = ms;
sid_map[vx_opt[i].mask_sid[j]] = ms.name();
mask_sid_map[ms.name()] = ms;
}

// Store the name only for point verification
Expand Down
4 changes: 2 additions & 2 deletions src/tools/core/point_stat/point_stat_conf_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,8 @@ void PointStatConfInfo::process_masks(const Grid &grid) {
<< "Processing station ID mask: "
<< vx_opt[i].mask_sid[j] << "\n";
MaskSID ms = parse_sid_mask(vx_opt[i].mask_sid[j]);
sid_map[vx_opt[i].mask_sid[j]] = ms.name;
mask_sid_map[ms.name] = ms;
sid_map[vx_opt[i].mask_sid[j]] = ms.name();
mask_sid_map[ms.name()] = ms;
}

// Store the name for the current station ID mask
Expand Down
4 changes: 2 additions & 2 deletions src/tools/other/ascii2nc/ascii2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -749,11 +749,11 @@ void set_mask_sid(const StringArray & a) {
<< "Station ID Mask: " << a[0] << "\n";

MaskSID ms = parse_sid_mask(a[0]);
for(const auto &pair : ms.sid_map) mask_sid.add(pair.first);
for(const auto &pair : ms.sid_map()) mask_sid.add(pair.first);

// List the length of the station ID mask
mlog << Debug(2)
<< "Parsed Station ID Mask (" << ms.name
<< "Parsed Station ID Mask (" << ms.name()
<< ") containing " << mask_sid.n() << " stations\n";
}

Expand Down
4 changes: 2 additions & 2 deletions src/tools/other/ioda2nc/ioda2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1561,10 +1561,10 @@ void set_mask_sid(const StringArray & a) {
mlog << Debug(1) << "Station ID Mask: " << a[0] << "\n";

MaskSID ms = parse_sid_mask(a[0]);
for(const auto &pair : ms.sid_map) mask_sid.add(pair.first);
for(const auto &pair : ms.sid_map()) mask_sid.add(pair.first);

// List the length of the station ID mask
mlog << Debug(2) << "Parsed Station ID Mask (" << ms.name
mlog << Debug(2) << "Parsed Station ID Mask (" << ms.name()
<< ") containing " << mask_sid.n() << " stations\n";
}

Expand Down
4 changes: 2 additions & 2 deletions src/tools/other/madis2nc/madis2nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3743,11 +3743,11 @@ void set_mask_sid(const StringArray & a) {
<< "Station ID Mask: " << a[0] << "\n";

MaskSID ms = parse_sid_mask(a[0]);
for(const auto &pair : ms.sid_map) mask_sid.add(pair.first);
for(const auto &pair : ms.sid_map()) mask_sid.add(pair.first);

// List the length of the station ID mask
mlog << Debug(2)
<< "Parsed Station ID Mask (" << ms.name
<< "Parsed Station ID Mask (" << ms.name()
<< ") containing " << mask_sid.n() << " stations\n";
}

Expand Down

0 comments on commit 9ecea77

Please sign in to comment.