Commit f26fb3c75430aa04024e984cf13f4506c144defb

Authored by Benjamin Renard
1 parent 9ead87ad

Use enum for EISCAT mode

Showing 1 changed file with 11 additions and 4 deletions   Show diff stats
src/ExternLib/EISCATDataFilter/EISCATDataFilter.hh
... ... @@ -10,6 +10,14 @@
10 10  
11 11 #include <vector>
12 12  
  13 +typedef enum {
  14 + all = -1,
  15 + fieldaligned = 0,
  16 + other = 1,
  17 + multipos = 2,
  18 + scan = 3
  19 +} EISCATModeEnum;
  20 +
13 21 /**
14 22 * @bried filetr EISCAT data in relation with the requested mode
15 23 */
... ... @@ -21,11 +29,10 @@
21 29 // * 2 : Keep only Multi
22 30 // * 3 : Keep only Scan
23 31  
24   -std::vector<float> EISCATDataFilter(const std::vector<float>& data, short crtMode, short mode = -1, int corrected = false)
  32 +std::vector<float> EISCATDataFilter(const std::vector<float>& data, short crtMode, EISCATModeEnum mode = EISCATModeEnum::all, int corrected = false)
25 33 {
26   - std::vector<float> result;
27   - result = data;
28   - if ((mode != -1) && (crtMode != mode)) {
  34 + std::vector<float> result = data;
  35 + if ((mode != EISCATModeEnum::all) && (crtMode != (short)mode)) {
29 36 for (std::vector<float>::iterator it = result.begin(); it != result.end(); ++it) {
30 37 (*it) = 0./0.;
31 38 }
... ...