Skip to content

Commit cfacdd5

Browse files
committed
teca_detect_stitch_nodes: Changed apps name
added apps test
1 parent 7ebd37f commit cfacdd5

File tree

6 files changed

+1740
-1659
lines changed

6 files changed

+1740
-1659
lines changed

apps/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ teca_add_app(teca_regional_moisture_flux LIBS ${teca_app_link}
5858
FEATURES ${TECA_HAS_BOOST} ${TECA_HAS_NETCDF} ${TECA_HAS_UDUNITS}
5959
${TECA_HAS_SHAPELIB})
6060

61-
teca_add_app(teca_detect_nodes LIBS ${teca_app_link}
61+
teca_add_app(teca_detect_stitch_nodes LIBS ${teca_app_link}
6262
FEATURES ${TECA_HAS_BOOST} ${TECA_HAS_TELITE} ${TECA_HAS_NETCDF})
6363

6464
teca_add_python_app(teca_convert_table)

apps/teca_detect_nodes.cpp renamed to apps/teca_detect_stitch_nodes.cpp

Lines changed: 113 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int main(int argc, char **argv)
5656
"\nfile path to write the storm candidates to. The extension determines"
5757
" the file format. May be one of `.nc`, `.csv`, or `.bin`\n")
5858

59-
("track_file", value<string>()->default_value("track.csv"),
59+
("track_file", value<string>()->default_value("tracks.csv"),
6060
"\nfile path to write the storm tracks to. The extension determines"
6161
" the file format. May be one of `.nc`, `.csv`, or `.bin`\n")
6262

@@ -69,65 +69,139 @@ int main(int argc, char **argv)
6969
("z_axis_variable", value<std::string>()->default_value("level"),
7070
"\nName of the variable to use for z-coordinates.\n")
7171

72-
("n_threads", value<int>()->default_value(-1), "\nSets the thread pool"
73-
" size on each MPI rank. When the default value of -1 is used TECA"
74-
" will coordinate the thread pools across ranks such each thread"
75-
" is bound to a unique physical core.\n")
76-
77-
("in_connect", value<string>()->default_value(""), "\nConnectivity file\n")
72+
("in_connect", value<string>()->default_value(""),
73+
"\nConnectivity file that describes the unstructured grid\n")
7874
("search_by_min", value<string>()->default_value(""),
79-
"\nVariable to search for the minimum\n")
75+
"\nThe input variable to use for initially selecting candidate points"
76+
" (defined as local minima). At least one (and at most one)"
77+
" of --search_by_min or --search_by_max must be specified.\n")
8078
("search_by_max", value<string>()->default_value(""),
81-
"\nVariable to search for the maximum\n")
79+
"\nThe input variable to use for initially selecting candidate points"
80+
" (defined as local maxima). At least one (and at most one)"
81+
" of --search_by_min or --search_by_max must be specified.\n")
8282
("closed_contour_cmd", value<string>()->default_value(""),
83-
"\nClosed contour commands [var,delta,dist,minmaxdist;...]\n")
83+
"\nEliminate candidates if they do not have a closed contour."
84+
" The closed contour is determined by breadth first search:"
85+
" if any paths exist from the candidate point"
86+
" (or nearby minima/maxima if minmaxdist is specified)"
87+
" that reach the specified distance before achieving the specified delta"
88+
" then we say no closed contour is present."
89+
" Closed contour commands are separated by a semicolon (\"<cmd1>;<cmd2>;...\")."
90+
" Each closed contour command takes the form \"var,delta,dist,minmaxdist\"."
91+
" These arguments are as follows."
92+
" var is the name of the variable used for the contour search."
93+
" dist is the great-circle distance (in degrees) from the pivot"
94+
" within which the closed_contour criteria must be satisfied."
95+
" delta is the amount by which the field must change from the pivot value."
96+
" If positive (negative) the field must increase (decrease) by this value along the contour."
97+
" minmaxdist is the great-circle distance away from the candidate"
98+
" to search for the minima/maxima. If delta is positive (negative),"
99+
" the pivot is a local minimum (maximum).\n")
84100
("no_closed_contour_cmd", value<string>()->default_value(""),
85-
"\nNo closed contour commands [var,delta,dist,minmaxdist;...]\n")
86-
("threshold_cmd", value<string>()->default_value(""),
87-
"\nThreshold commands for candidates [var,op,value,dist;...]\n")
101+
"\nAs --closed_contour_cmd,"
102+
" except it eliminates candidates if a closed contour is present.\n")
103+
("candidate_threshold_cmd", value<string>()->default_value(""),
104+
"\nThreshold commands for candidates."
105+
" Eliminate candidates that do not satisfy a threshold criteria"
106+
" (there must exist a point within a given distance of the candidate"
107+
" that satisfies a given equality or inequality)."
108+
" Search is performed by breadth-first search over the grid."
109+
" Threshold commands are separated by a semicolon (\"<cmd1>;<cmd2>;...\")."
110+
" Each threshold command takes the form \"var,op,value,dist\"."
111+
" These arguments are as follows."
112+
" var is the name of the variable used for the thresholding."
113+
" op is the operator that must be satisfied for threshold (options include >,>=,<,<=,=,!=)."
114+
" value is the value on the right-hand-side of the comparison."
115+
" dist is the great-circle distance away from the candidate"
116+
" to search for a point that satisfies the threshold.\n")
88117
("output_cmd", value<string>()->default_value(""),
89-
"\nCandidates output commands [var,op,dist;...]\n")
118+
"\nInclude additional columns in the candidates output file."
119+
" Each output command takes the form \"var,op,dist\"."
120+
" These arguments are as follows."
121+
" var is the name of the variable used for output."
122+
" op is the operator that is applied over all points"
123+
" within the specified distance of the candidate (options include max, min, avg, maxdist, mindist)."
124+
" dist is the great-circle distance away from the candidate wherein the operator is applied.\n")
90125
("search_by_threshold", value<string>()->default_value(""),
91-
"\nThreshold for search operation\n")
126+
"\nThreshold for search operation in the form \"<op><value>\""
127+
" These arguments are as follows."
128+
" op is the operator that must be satisfied for threshold (options include >,>=,<,<=,=,!=)."
129+
" value is the value on the right-hand-side of the comparison.\n")
92130
("min_lon", value<double>()->default_value(0.0),
93131
"\nMinimum longitude in degrees for detection\n")
94-
("max_lon", value<double>()->default_value(10.0),
95-
"\nMaximum longitude in degrees for detection\n")
96-
("min_lat", value<double>()->default_value(-20.0),
132+
("max_lon", value<double>()->default_value(0.0),
133+
"\nMaximum longitude in degrees for detection"
134+
" As longitude is a periodic dimension,"
135+
" when --regional is not specified --min_lon may be larger than --max_lon."
136+
" If --max_lon and --min_lon are equal then these arguments are ignored.\n")
137+
("min_lat", value<double>()->default_value(0.0),
97138
"\nMinimum latitude in degrees for detection\n")
98-
("max_lat", value<double>()->default_value(20.0),
99-
"\nMaximum latitude in degrees for detection\n")
139+
("max_lat", value<double>()->default_value(0.0),
140+
"\nMaximum latitude in degrees for detection"
141+
" If --max_lat and --min_lat are equal then these arguments are ignored.\n")
100142
("min_abs_lat", value<double>()->default_value(0.0),
101-
"\nMinimum absolute value of latitude in degrees for detection\n")
143+
"\nMinimum absolute value of latitude in degrees for detection"
144+
" This argument has no effect if set to zero.\n")
102145
("merge_dist", value<double>()->default_value(6.0),
103-
"\nMinimum allowable distance between two candidates in degrees\n")
146+
"\nMinimum allowable distance between two candidates in degrees."
147+
" Candidate points with a distance (in degrees great-circle-distance)"
148+
" shorter than the specified value are merged."
149+
" Among two candidates within the merge distance,"
150+
" only the candidate with the lowest value of the --search_by_min field"
151+
" or highest value of the --search_by_max field are retained.\n")
104152
("diag_connect", value<bool>()->default_value(false),
105-
"\nDiagonal connectivity for RLL grids\n")
153+
"\nWhen the data is on a structured grid,"
154+
" consider grid cells to be connected in the diagonal (across the vertex)\n")
106155
("regional", value<bool>()->default_value(true),
107-
"\nRegional (do not wrap longitudinal boundaries)\n")
156+
"\nUsed to indicate that a given latitude-longitude grid"
157+
" should not be periodic in the longitudinal direction.\n")
108158
("out_header", value<bool>()->default_value(true),
109-
"\nOutput header\n")
159+
"\nIf present, output a header at the beginning of the output file"
160+
" indicating the columns of the file.\n")
110161

111162
("in_fmt", value<string>()->default_value(""),
112-
"\nTracks output commands [var,op,dist;...]\n")
163+
"\nA comma-separated list of names of the auxiliary columns"
164+
" within the candidates output file."
165+
" (namely, the list must not include the time columns).\n")
113166
("min_time", value<string>()->default_value("10"),
114-
"\nMinimum duration of path\n")
167+
"\nThe minimum length of a path either in terms of"
168+
" number of discrete times or as a duration, e.g. \"24h\"."
169+
" Note that the duration of a path is computed as"
170+
" the difference between the final time and initial time,"
171+
" so a \"24h\" duration correspond to 5 time steps in 6-hourly data"
172+
" (i.e. 0h,6,12,18,24UTC).\n")
115173
("cal_type", value<string>()->default_value("standard"),
116174
"\nCalendar type\n")
117175
("max_gap", value<string>()->default_value("3"),
118-
"\nMaximum time gap (in time steps or duration)\n")
119-
("threshold", value<string>()->default_value(""),
120-
"\nThreshold commands for path [var,op,value,count;...]\n")
176+
"\nMaximum time gap (in time steps or duration)"
177+
" The number of allowed missing points between spatially proximal candidate nodes"
178+
" while still considering them part of the same path.\n")
179+
("track_threshold_cmd", value<string>()->default_value(""),
180+
"\nThreshold commands for path"
181+
" Filter paths based on the number of times where a particular threshold is satisfied."
182+
" Threshold commands are separated by a semicolon (\"<cmd1>;<cmd2>;...\")."
183+
" Each threshold command takes the form \"col,op,value,count\"."
184+
" These arguments are as follows."
185+
" col is the name of the column to use for thresholding, as specified in --in_fmt."
186+
" op is the operator that must be satisfied for threshold (options include >,>=,<,<=,=,!=,|>=,|<=)."
187+
" value is the value on the right-hand-side of the comparison."
188+
" count is either the minimum number of time slices where the threshold must be satisfied"
189+
" or the instruction \"all\", \"first\", or \"last\"."
190+
" Here \"all\" is used to indicate the threshold must be satisfied at all points along the path,"
191+
" \"first\" is used to indicate the threshold must be satisfied only at the first point along the path, and"
192+
" \"last\" is used to indicate the threshold must be satisfied only at the last point along the path.\n")
121193
("prioritize", value<string>()->default_value(""),
122194
"\nVariable to use when prioritizing paths\n")
123-
("min_path_length", value<int>()->default_value(1),
195+
("min_path_length", value<int>()->default_value(0),
124196
"\nMinimum path length\n")
125197
("range", value<double>()->default_value(8.0),
126-
"\nRange (in degrees)\n")
198+
"\nThe maximum distance between candidates"
199+
" along a path (in great-circle degrees).\n")
127200
("min_endpoint_distance", value<double>()->default_value(0.0),
128-
"\nMinimum distance between endpoints of path\n")
201+
"\nThe minimum great-circle distance between the first candidate"
202+
" on a path and the last candidate (in degrees).\n")
129203
("min_path_distance", value<double>()->default_value(0.0),
130-
"\nMinimum path length\n")
204+
"\nThe minimum accumulated great-circle distance between nodes in a path (in degrees).\n")
131205
("allow_repeated_times", value<bool>()->default_value(false),
132206
"\nAllow repeated times\n")
133207

@@ -425,9 +499,9 @@ int main(int argc, char **argv)
425499
candidates->set_no_closed_contour_cmd(opt_vals["no_closed_contour_cmd"].as<string>());
426500
}
427501

428-
if (!opt_vals["threshold_cmd"].defaulted())
502+
if (!opt_vals["candidate_threshold_cmd"].defaulted())
429503
{
430-
candidates->set_threshold_cmd(opt_vals["threshold_cmd"].as<string>());
504+
candidates->set_candidate_threshold_cmd(opt_vals["candidate_threshold_cmd"].as<string>());
431505
}
432506

433507
if (!opt_vals["output_cmd"].defaulted())
@@ -545,14 +619,14 @@ int main(int argc, char **argv)
545619
tracks->set_max_gap(opt_vals["max_gap"].as<string>());
546620
}
547621

548-
if (!opt_vals["threshold"].defaulted())
622+
if (!opt_vals["track_threshold_cmd"].defaulted())
549623
{
550-
tracks->set_threshold(opt_vals["threshold"].as<string>());
624+
tracks->set_track_threshold_cmd(opt_vals["track_threshold_cmd"].as<string>());
551625
}
552626
else
553627
{
554628
std::string text = surf_wind->get_l2_norm_variable()+",>=,10.0,10;lat,<=,50.0,10;lat,>=,-50.0,10;"+opt_vals["geopotential_at_surface"].as<string>()+",<=,15.0,10";
555-
tracks->set_threshold(text);
629+
tracks->set_track_threshold_cmd(text);
556630
}
557631

558632
if (!opt_vals["prioritize"].defaulted())

0 commit comments

Comments
 (0)