Skip to content

Commit

Permalink
mvmode log message improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalbo committed Dec 9, 2024
1 parent 0cc536f commit a70528f
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 15 deletions.
3 changes: 2 additions & 1 deletion src/tools/core/mode/combine_boolplanes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ using namespace std;
//

void combine_boolplanes(const string &name,
int rIndex, int tIndex,
const BoolPlane * bpa, const int n_planes,
BoolCalc & calc,
BoolPlane & bp_out)
Expand Down Expand Up @@ -57,7 +58,7 @@ void combine_boolplanes(const string &name,

} // for x

mlog << Debug(1) << name << " has " << nTrue << " superobject points.\n";
mlog << Debug(1) << name << " has " << nTrue << " superobject points. rIndex[" << rIndex << "] tIndex[" << tIndex << "]\n";

//
// done
Expand Down
1 change: 1 addition & 0 deletions src/tools/core/mode/combine_boolplanes.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@


extern void combine_boolplanes(const std::string &name,
int rIndex, int tIndex,
const BoolPlane * array, const int n_planes,
BoolCalc & calc,
BoolPlane & bp_out);
Expand Down
5 changes: 2 additions & 3 deletions src/tools/core/mode/mode_exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ void ModeExecutive::do_conv_thresh_multivar_simple(Processing_t p, int rIndex, i
} else {
what = "forecast field";
}
mlog << Debug(2) << "Identifying objects in the " << what << "...\n";
mlog << Debug(2) << "Identifying objects in the " << what << " for " << stype(p) << "\n";

if (p == MULTIVAR_SIMPLE_MERGE) {
conf.set_conv_radius_by_index(R_index); // need this because exec was killed after SIMPLE
Expand Down Expand Up @@ -1176,8 +1176,7 @@ void ModeExecutive::process_obs_masks(ShapeData & obs_sd)
ShapeData grid_mask_sd, poly_mask_sd;
ConcatString name;

mlog << Debug(2)
<< "Processing masking regions.\n";
mlog << Debug(3) << "Processing masking regions.\n";

// Parse the grid mask into a ShapeData object
if(engine.conf_info.mask_grid_flag != FieldType::None) {
Expand Down
9 changes: 7 additions & 2 deletions src/tools/core/mode/mode_superobject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,13 @@ ModeSuperObject::ModeSuperObject()
}

ModeSuperObject::ModeSuperObject(bool isFcst, int n_files, bool do_clusters,
int r_index, int t_index,
const vector<MultiVarData *> &mvd,
BoolCalc &calc)
{
_hasUnion = calc.has_union();
_rIndex = r_index;
_tIndex = t_index;

//
// set the BoolPlane values using the mvd content
Expand Down Expand Up @@ -150,8 +153,10 @@ ModeSuperObject::ModeSuperObject(bool isFcst, int n_files, bool do_clusters,
simple_name = "Obs_Simple";
merge_name = "Obs_Merge";
}
combine_boolplanes(simple_name, simple_plane, n_files, calc, _simple_result);
combine_boolplanes(merge_name, merge_plane, n_files, calc, merge_result);

mlog << Debug(1) << "\n";
combine_boolplanes(simple_name, _rIndex, _tIndex, simple_plane, n_files, calc, _simple_result);
combine_boolplanes(merge_name, _rIndex, _tIndex, merge_plane, n_files, calc, merge_result);

// create ShapeData objects using something from mvd as a template
// (shape data has 1's or bad)
Expand Down
2 changes: 2 additions & 0 deletions src/tools/core/mode/mode_superobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ModeSuperObject {
ModeSuperObject();

ModeSuperObject(bool isFcst, int n_files, bool do_clusters,
int r_index, int t_index,
const std::vector<MultiVarData *> &mvd,
BoolCalc &calc);
inline ~ModeSuperObject() {}
Expand All @@ -42,6 +43,7 @@ class ModeSuperObject {

bool _isFcst;
bool _hasUnion;
int _rIndex, _tIndex;
BoolPlane _simple_result;
ShapeData _simple_sd;
ShapeData _merge_sd_split;
Expand Down
22 changes: 14 additions & 8 deletions src/tools/core/mode/multivar_frontend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int MultivarFrontEnd::run(const StringArray & Argv)

_init(Argv);

mlog << Debug(2) << "\n" << sep << "\n";
mlog << Debug(1) << "\n" << sep << "\n";

// in the conf object, shift *can* be set independently for obs and fcst
int shift = config.shift_right;
Expand Down Expand Up @@ -175,7 +175,7 @@ int MultivarFrontEnd::run(const StringArray & Argv)
}
}

mlog << Debug(2) << "\n finished with multivar intensity comparisons \n" << sep << "\n";
mlog << Debug(1) << "\n finished with multivar intensity comparisons \n" << sep << "\n";

// clear out memory stored in the simple objects

Expand Down Expand Up @@ -509,7 +509,7 @@ void MultivarFrontEnd::_read_input(const string &name, int index, ModeDataType t

void MultivarFrontEnd::_create_verif_grid()
{
mlog << Debug(2) << "\n creating the verification grid \n" << sep << "\n";
mlog << Debug(1) << "\n creating the verification grid \n" << sep << "\n";

_init_exec(ModeExecutive::TRADITIONAL, "None", "None");
mode_exec->setup_verification_grid(fcstInput[0], obsInput[0], config);
Expand All @@ -527,9 +527,9 @@ void MultivarFrontEnd::_create_simple_objects(ModeDataType dtype, const std::str
{
O.init(dtype, rIndex, tIndex);
for (int j=0; j<n_files; ++j) {
mlog << Debug(2)
mlog << Debug(1)
<< "\n" << sep << "\ncreating simple " << name << " objects from " << name << " "
<< (j + 1) << " of " << n_files << "\nconv_radius[" << rIndex+1 << "] conv_thresh["
<< (j + 1) << " of " << n_files << " conv_radius[" << rIndex+1 << "] conv_thresh["
<< tIndex+1 << "]\n" << sep << "\n";
MultiVarData *mvdi = _create_simple_multivar_data(dtype, rIndex, tIndex, j, n_files,
filenames[j], input[j]);
Expand Down Expand Up @@ -614,7 +614,11 @@ MultivarFrontEnd::_create_intensity_comparisons(SimpleObjects &fcsts, int findex
fcsts._super.mask_data_simple("Fcst", *mvdf);
obs._super.mask_data_simple("Obs", *mvdo);

mlog << Debug(1) << "Running mvmode intensity comparisions \n\n";
// this debug statement assumes fcsts and obs have same conv radius and thresh indices
// which is currently required
mlog << Debug(1) << "\n" << sep
<< "\nRunning mvmode intensity comparisions conv_radius[" << fcsts._rIndex+1
<< "] conv_thresh[" << fcsts._tIndex+1 << "]\n" << sep << "\n";

_init_exec(ModeExecutive::MULTIVAR_INTENSITY, fcst_filename, obs_filename);
mode_exec->init_multivar_intensities(config);
Expand Down Expand Up @@ -678,7 +682,9 @@ MultivarFrontEnd::_intensity_compare_mode_algorithm(int rIndexF, int tIndexF,

void MultivarFrontEnd::_process_superobjects(SimpleObjects &fcsts, SimpleObjects &obs)
{
mlog << Debug(1) << "Running superobject mode \n\n";
mlog << Debug(1) << "\n" << sep
<< "\nRunning mvmode superobject analysis conv_radius[" << fcsts._rIndex+1
<< "] conv_thresh[" << fcsts._tIndex+1 << "]\n" << sep << "\n";

MultiVarData *mvdf = fcsts._mvd[0];
MultiVarData *mvdo = obs._mvd[0];
Expand Down Expand Up @@ -739,7 +745,7 @@ void MultivarFrontEnd::_init_exec(ModeExecutive::Processing_t p,
const string &ffile,
const string &ofile) const
{
mlog << Debug(1) << "Running multivar front end for " << ModeExecutive::stype(p) << "\n";
mlog << Debug(4) << "Running multivar front end for " << ModeExecutive::stype(p) << "\n";

if ( mode_exec ) { delete mode_exec; mode_exec = 0; }

Expand Down
3 changes: 2 additions & 1 deletion src/tools/core/mode/simple_objects.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ void SimpleObjects::init(ModeDataType dataType, int rIndex, int tIndex)
void SimpleObjects::setSuper(bool isFcst, int n_fcst_files, bool do_clusters,
BoolCalc &f_calc)
{
_super = ModeSuperObject(isFcst, n_fcst_files, do_clusters, _mvd, f_calc);
_super = ModeSuperObject(isFcst, n_fcst_files, do_clusters,
_rIndex, _tIndex, _mvd, f_calc);
}

////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit a70528f

Please sign in to comment.