Skip to content

Commit

Permalink
refactored renge obs to use unique col names instead of piggybacking …
Browse files Browse the repository at this point in the history
…on lower and upper bound
  • Loading branch information
jtwhite79 committed Jun 11, 2024
1 parent ea7ff17 commit 17e9ce0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 22 deletions.
21 changes: 10 additions & 11 deletions src/libs/pestpp_common/EnsembleMethodUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2029,9 +2029,8 @@ L2PhiHandler::L2PhiHandler(Pest *_pest_scenario, FileManager *_file_manager,
string og;
double weight;
const ObservationInfo* oi = pest_scenario->get_ctl_observation_info_ptr();
bool use_obs_bound_ineq = pest_scenario->get_pestpp_options().get_ies_obs_bounds_as_ineq();
map<string,double> extfile_lb = pest_scenario->get_ext_file_double_map("observation data external","lower_bound");
map<string,double> extfile_ub = pest_scenario->get_ext_file_double_map("observation data external","upper_bound");
map<string,double> extfile_gt = pest_scenario->get_ext_file_double_map("observation data external","greater_than");
map<string,double> extfile_lt = pest_scenario->get_ext_file_double_map("observation data external","less_than");

for (auto &oname : pest_scenario->get_ctl_ordered_obs_names())
{
Expand All @@ -2051,20 +2050,20 @@ L2PhiHandler::L2PhiHandler(Pest *_pest_scenario, FileManager *_file_manager,
{
gt_obs_names.push_back(oname);
}
else if (use_obs_bound_ineq)
else
{
if ((extfile_lb.find(oname) != extfile_lb.end()) &&
(extfile_ub.find(oname) != extfile_ub.end()))
if ((extfile_gt.find(oname) != extfile_gt.end()) &&
(extfile_lt.find(oname) != extfile_lt.end()))
{
double_obs_bounds[oname] = pair<double,double>(extfile_lb.at(oname),extfile_ub.at(oname));
double_obs_bounds[oname] = pair<double,double>(extfile_gt.at(oname),extfile_lt.at(oname));
}
else if (extfile_lb.find(oname) != extfile_lb.end())
else if (extfile_gt.find(oname) != extfile_gt.end())
{
gt_obs_bounds[oname] = extfile_lb.at(oname);
gt_obs_bounds[oname] = extfile_gt.at(oname);
}
else if (extfile_ub.find(oname) != extfile_ub.end())
else if (extfile_lt.find(oname) != extfile_lt.end())
{
lt_obs_bounds[oname] = extfile_ub.at(oname);
lt_obs_bounds[oname] = extfile_lt.at(oname);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/libs/pestpp_common/Pest.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class Pest {

protected:
//this is the list of external file cols that have meaning...
set<string> efile_keep_cols{ "standard_deviation", "obsnme","parnme","name", "upper_bound","lower_bound", "cycle", "state_par_link","drop_violations" };
set<string> efile_keep_cols{ "standard_deviation", "obsnme","parnme","name", "upper_bound","lower_bound", "cycle", "state_par_link","drop_violations","greater_than","less_than" };
int n_adj_par = 0;
string prior_info_string;
ControlInfo control_info;
Expand Down
9 changes: 2 additions & 7 deletions src/libs/pestpp_common/pest_data_structs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,11 +1185,7 @@ bool PestppOptions::assign_ies_value_by_key(const string& key, const string& val
convert_ip(value,ies_n_iter_mean);
return true;
}
else if (key == "IES_OBS_BOUNDS_AS_INEQ")
{
ies_obs_bounds_as_ineq = pest_utils::parse_string_arg_to_bool(value);
return true;
}


return false;
}
Expand Down Expand Up @@ -1827,7 +1823,6 @@ void PestppOptions::summary(ostream& os) const
os << "ies_phi_factors_file: " << ies_phi_fractions_file << endl;
os << "ies_phi_factors_by_real: " << ies_phi_factors_by_real << endl;
os << "ies_n_iter_mean: " << ies_n_iter_mean << endl;
os << "ies_obs_bounds_as_ineq: " << ies_obs_bounds_as_ineq << endl;


os << endl << "pestpp-sen options: " << endl;
Expand Down Expand Up @@ -2013,7 +2008,7 @@ void PestppOptions::set_defaults()
set_ies_phi_fractions_files("");
set_ies_phi_factors_by_real(false);
set_ies_n_iter_mean(0);
set_ies_obs_bounds_as_ineq(false);


// DA parameters
//set_da_use_ies(false);
Expand Down
3 changes: 0 additions & 3 deletions src/libs/pestpp_common/pest_data_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,6 @@ class PestppOptions {
int get_ensemble_output_precision() const {return ensemble_output_precision;}
void set_ies_n_iter_mean(int _n_iter_mean) {ies_n_iter_mean = _n_iter_mean;}
int get_ies_n_iter_mean() const {return ies_n_iter_mean;}
void set_ies_obs_bounds_as_ineq(bool _flag) {ies_obs_bounds_as_ineq = _flag;}
bool get_ies_obs_bounds_as_ineq() const {return ies_obs_bounds_as_ineq;}


string get_gsa_method() const { return gsa_method; }
Expand Down Expand Up @@ -821,7 +819,6 @@ class PestppOptions {
string ies_phi_fractions_file;
bool ies_phi_factors_by_real;
int ies_n_iter_mean;
bool ies_obs_bounds_as_ineq;


// Data Assimilation parameters
Expand Down

0 comments on commit 17e9ce0

Please sign in to comment.