diff --git a/include/titanlib.h b/include/titanlib.h index a4bcd90..6bb3604 100644 --- a/include/titanlib.h +++ b/include/titanlib.h @@ -612,9 +612,27 @@ namespace titanlib { */ void range_check(const vec& min, const vec& max, const ivec& indices=ivec(1, -1)); void range_check_climatology(int unixtime, const vec& pos, const vec& neg, const ivec& indices=ivec(1, -1)); - void sct(int num_min, int num_max, float inner_radius, float outer_radius, int num_iterations, int num_min_prof, float min_elev_diff, float min_horizontal_scale, float vertical_scale, const vec& t2pos, const vec& t2neg, const vec& eps2, vec& prob_gross_error, vec& rep, const ivec& indices=ivec(1, -1)); - void buddy_check(const vec& radius, const ivec& num_min, float threshold, float max_elev_diff, float elev_gradient, float min_std, int num_iterations, const ivec& obs_to_check=ivec(), const ivec& indices=ivec(1, -1)); - void buddy_event_check(const vec& radius, const ivec& num_min, float event_threshold, float threshold, float max_elev_diff, float elev_gradient, int num_iterations, const ivec& obs_to_check=ivec(), const ivec& indices=ivec(1, -1)); + void sct(int num_min, int num_max, + float inner_radius, float outer_radius, + int num_iterations, int num_min_prof, + float min_elev_diff, float min_horizontal_scale, float vertical_scale, + const vec& t2pos, const vec& t2neg, const vec& eps2, vec& prob_gross_error, + vec& rep, const ivec& indices=ivec(1, -1)); + void sct_dual(const vec& event_thresholds, + ConditionType condition, + int num_min, int num_max, + float inner_radius, float outer_radius, + int num_iterations, + float min_horizontal_scale, float max_horizontal_scale, + int kth_closest_obs_horizontal_scale, + float vertical_scale, + const vec& test_thresholds, + bool debug, + const ivec& obs_to_check=ivec(), const ivec& indices=ivec(1, -1)); + void buddy_check(const vec& radius, const ivec& num_min, float threshold, float max_elev_diff, float elev_gradient, float min_std, int num_iterations, + const ivec& obs_to_check=ivec(), const ivec& indices=ivec(1, -1)); + void buddy_event_check(const vec& radius, const ivec& num_min, float event_threshold, float threshold, float max_elev_diff, float elev_gradient, int num_iterations, + const ivec& obs_to_check=ivec(), const ivec& indices=ivec(1, -1)); void isolation_check(int num_min, float radius, float vertical_radius=MV, const ivec& indices=ivec(1, -1)); void isolation_check(const ivec& num_min, const vec& radius, const vec& vertical_radius=vec(), const ivec& indices=ivec(1, -1)); void duplicate_check(float radius, float vertical_range=titanlib::MV, const ivec& indices=ivec(1, -1)); diff --git a/src/dataset.cpp b/src/dataset.cpp index e7231b5..58f625d 100644 --- a/src/dataset.cpp +++ b/src/dataset.cpp @@ -51,6 +51,28 @@ void titanlib::Dataset::sct(int num_min, int num_max, float inner_radius, float merge(new_flags, indices); } +void titanlib::Dataset::sct_dual(const vec& event_thresholds, + ConditionType condition, + int num_min, int num_max, + float inner_radius, float outer_radius, + int num_iterations, + float min_horizontal_scale, float max_horizontal_scale, + int kth_closest_obs_horizontal_scale, + float vertical_scale, + const vec& test_thresholds, + bool debug, + const ivec& obs_to_check, + const ivec& indices){ + // Only keep flags that are not flagged + ivec new_flags = titanlib::sct_dual(get_unflagged_points(), get_unflagged(values), get_unflagged(obs_to_check), + event_thresholds, condition, + num_min, num_max, inner_radius, outer_radius, num_iterations, + min_horizontal_scale, max_horizontal_scale, + kth_closest_obs_horizontal_scale, vertical_scale, + test_thresholds, debug); + merge(new_flags, indices); +} + void titanlib::Dataset::buddy_check(const vec& radius, const ivec& num_min, float threshold, float max_elev_diff, float elev_gradient, float min_std, int num_iterations, const ivec& obs_to_check, const ivec& indices) { ivec new_flags = titanlib::buddy_check(get_unflagged_points(), get_unflagged(values), get_unflagged(radius), get_unflagged(num_min), threshold, max_elev_diff, elev_gradient, min_std, num_iterations, get_unflagged(obs_to_check)); merge(new_flags, indices);