Skip to content

Commit

Permalink
added sct_dual method for dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
a3eille committed Nov 29, 2023
1 parent 83bb3bc commit a6ff186
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
24 changes: 21 additions & 3 deletions include/titanlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
22 changes: 22 additions & 0 deletions src/dataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a6ff186

Please sign in to comment.