Skip to content

Commit

Permalink
apps/radar/Iq2Dsr - testing rhohv_test in CMD
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dixon committed Feb 14, 2024
1 parent 5bfde57 commit 94f2679
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 93 deletions.
37 changes: 10 additions & 27 deletions codebase/apps/radar/src/Iq2Dsr/Cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Cmd::Cmd(const string &prog_name,
_cpaInterestMap = NULL;
_zdrSdevInterestMap = NULL;
_phidpSdevInterestMap = NULL;
_rhohvTestInterestMap = NULL;

_startRangeKm = 0.0;
_gateSpacingKm = 0.0;
Expand Down Expand Up @@ -106,10 +105,6 @@ Cmd::~Cmd()
delete _phidpSdevInterestMap;
}

if (_rhohvTestInterestMap != NULL) {
delete _rhohvTestInterestMap;
}

}

/////////////////////////////////////////////////////////
Expand All @@ -125,7 +120,7 @@ int Cmd::_createInterestMaps(const Params &params)

if (_tdbzInterestMap == NULL) {
vector<InterestMap::ImPoint> pts;
if (_convertInterestMapToVector("Tdbz",
if (_convertInterestMapToVector("tdbz",
params._tdbz_interest_map,
params.tdbz_interest_map_n,
pts)) {
Expand All @@ -139,7 +134,7 @@ int Cmd::_createInterestMaps(const Params &params)

if (_spinInterestMap == NULL) {
vector<InterestMap::ImPoint> pts;
if (_convertInterestMapToVector("Spin",
if (_convertInterestMapToVector("spin",
params._spin_interest_map,
params.spin_interest_map_n,
pts)) {
Expand Down Expand Up @@ -168,7 +163,7 @@ int Cmd::_createInterestMaps(const Params &params)

if (_zdrSdevInterestMap == NULL) {
vector<InterestMap::ImPoint> pts;
if (_convertInterestMapToVector("zdr sdev",
if (_convertInterestMapToVector("zdr_sdev",
params._zdr_sdev_interest_map,
params.zdr_sdev_interest_map_n,
pts)) {
Expand All @@ -182,7 +177,7 @@ int Cmd::_createInterestMaps(const Params &params)

if (_phidpSdevInterestMap == NULL) {
vector<InterestMap::ImPoint> pts;
if (_convertInterestMapToVector("phidp sdev",
if (_convertInterestMapToVector("phidp_sdev",
params._phidp_sdev_interest_map,
params.phidp_sdev_interest_map_n,
pts)) {
Expand All @@ -192,20 +187,6 @@ int Cmd::_createInterestMaps(const Params &params)
new InterestMap("phidp sdev", pts, params.phidp_sdev_interest_weight);
} // if (_phidpSdevInterestMap ...

// rhohv test

if (_rhohvTestInterestMap == NULL) {
vector<InterestMap::ImPoint> pts;
if (_convertInterestMapToVector("rhohv test",
params._rhohv_test_interest_map,
params.rhohv_test_interest_map_n,
pts)) {
return -1;
}
_rhohvTestInterestMap =
new InterestMap("rhohv test", pts, params.rhohv_test_interest_weight);
} // if (_rhohvTestInterestMap ...

return 0;

}
Expand Down Expand Up @@ -330,11 +311,13 @@ void Cmd::compute(int nGates, const RadarMoments *mom,
if (flds->cmd >= checkThreshold) {
flds->cmd_flag = 1;
}

if (flds->rhohv_test_improv >= _params.rhohv_improvement_factor_threshold) {
flds->cmd_flag = 1;

if (_params.apply_rhohv_test_in_cmd) {
if (flds->rhohv_test_improv >= _params.rhohv_improvement_factor_threshold) {
flds->cmd_flag = 1;
}
}

} // igate

// first remove speckle
Expand Down
1 change: 0 additions & 1 deletion codebase/apps/radar/src/Iq2Dsr/Cmd.hh
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ private:
InterestMap *_cpaInterestMap;
InterestMap *_zdrSdevInterestMap;
InterestMap *_phidpSdevInterestMap;
InterestMap *_rhohvTestInterestMap;

// phidp computations

Expand Down
49 changes: 0 additions & 49 deletions codebase/apps/radar/src/Iq2Dsr/Params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4518,55 +4518,6 @@
tt->single_val.d = 4;
tt++;

// Parameter 'rhohv_test_interest_map'
// ctype is '_interest_map_point_t'

memset(tt, 0, sizeof(TDRPtable));
tt->ptype = STRUCT_TYPE;
tt->param_name = tdrpStrDup("rhohv_test_interest_map");
tt->descr = tdrpStrDup("Interest mapping for the rhohv test.");
tt->help = tdrpStrDup("");
tt->array_offset = (char *) &_rhohv_test_interest_map - &_start_;
tt->array_n_offset = (char *) &rhohv_test_interest_map_n - &_start_;
tt->is_array = TRUE;
tt->array_len_fixed = FALSE;
tt->array_elem_size = sizeof(interest_map_point_t);
tt->array_n = 2;
tt->struct_def.name = tdrpStrDup("interest_map_point_t");
tt->struct_def.nfields = 2;
tt->struct_def.fields = (struct_field_t *)
tdrpMalloc(tt->struct_def.nfields * sizeof(struct_field_t));
tt->struct_def.fields[0].ftype = tdrpStrDup("double");
tt->struct_def.fields[0].fname = tdrpStrDup("value");
tt->struct_def.fields[0].ptype = DOUBLE_TYPE;
tt->struct_def.fields[0].rel_offset =
(char *) &_rhohv_test_interest_map->value - (char *) _rhohv_test_interest_map;
tt->struct_def.fields[1].ftype = tdrpStrDup("double");
tt->struct_def.fields[1].fname = tdrpStrDup("interest");
tt->struct_def.fields[1].ptype = DOUBLE_TYPE;
tt->struct_def.fields[1].rel_offset =
(char *) &_rhohv_test_interest_map->interest - (char *) _rhohv_test_interest_map;
tt->n_struct_vals = 4;
tt->struct_vals = (tdrpVal_t *)
tdrpMalloc(tt->n_struct_vals * sizeof(tdrpVal_t));
tt->struct_vals[0].d = 3.5;
tt->struct_vals[1].d = 0;
tt->struct_vals[2].d = 4.5;
tt->struct_vals[3].d = 1;
tt++;

// Parameter 'rhohv_test_interest_weight'
// ctype is 'double'

memset(tt, 0, sizeof(TDRPtable));
tt->ptype = DOUBLE_TYPE;
tt->param_name = tdrpStrDup("rhohv_test_interest_weight");
tt->descr = tdrpStrDup("Weight for standard deviation of phidp.");
tt->help = tdrpStrDup("");
tt->val_offset = (char *) &rhohv_test_interest_weight - &_start_;
tt->single_val.d = 1;
tt++;

// Parameter 'Comment 25'

memset(tt, 0, sizeof(TDRPtable));
Expand Down
7 changes: 1 addition & 6 deletions codebase/apps/radar/src/Iq2Dsr/Params.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1269,11 +1269,6 @@ public:

double rhohv_improvement_factor_threshold;

interest_map_point_t *_rhohv_test_interest_map;
int rhohv_test_interest_map_n;

double rhohv_test_interest_weight;

tdrp_bool_t run_spectral_cmd;

clutter_filter_type_t spec_cmd_clutter_filter_type;
Expand Down Expand Up @@ -1390,7 +1385,7 @@ private:

void _init();

mutable TDRPtable _table[320];
mutable TDRPtable _table[318];

const char *_className;

Expand Down
10 changes: 0 additions & 10 deletions codebase/apps/radar/src/Iq2Dsr/paramdef.Iq2Dsr
Original file line number Diff line number Diff line change
Expand Up @@ -1909,16 +1909,6 @@ paramdef double {
p_help = "The RHOHV test identifies clutter if the improvement factor exceeds this value.";
} rhohv_improvement_factor_threshold;

paramdef struct interest_map_point_t {
p_default = {{3.5, 0.0}, {4.5, 1.0}};
p_descr = "Interest mapping for the rhohv test.";
} rhohv_test_interest_map[];

paramdef double {
p_default = 1.0;
p_descr = "Weight for standard deviation of phidp.";
} rhohv_test_interest_weight;

commentdef {
p_header = "SPECTRAL CMD";
p_text = "You have the option of running the spectral version of CMD, to filter difficult targets such as wind farms. The moments from this step will be stored in variables specifically named for the purpose.";
Expand Down

0 comments on commit 94f2679

Please sign in to comment.