Skip to content

Commit

Permalink
Per #1673, add DataPlane::n_good_data() function to return a count va…
Browse files Browse the repository at this point in the history
…lid data values.
  • Loading branch information
JohnHalleyGotway committed Aug 4, 2021
1 parent 22e2da8 commit f1b1317
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions met/src/basic/vx_util/data_plane.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,22 @@ bool DataPlane::is_all_bad_data() const {

///////////////////////////////////////////////////////////////////////////////

int DataPlane::n_good_data() const {
int j, n;

//
// Count number of good data values
//

for(j=0,n=0; j<Nxy; ++j) {
if(!is_bad_data(Data[j])) n++;
}

return(n);
}

///////////////////////////////////////////////////////////////////////////////

double DataPlane::get(int x, int y) const {
int n;

Expand Down
1 change: 1 addition & 0 deletions met/src/basic/vx_util/data_plane.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class DataPlane {
int ny() const;
bool is_empty() const;
bool is_all_bad_data() const;
int n_good_data() const;

unixtime init() const;
unixtime valid() const;
Expand Down

0 comments on commit f1b1317

Please sign in to comment.