Commit 9ead87ad87d086a1131ff7eb0bc7f02be7f5cd23
1 parent
95430126
Exists in
master
and in
100 other branches
First implementation for EISCAT data filter by instrument mode
Showing
3 changed files
with
61 additions
and
0 deletions
Show diff stats
CMakeLists.txt
... | ... | @@ -98,6 +98,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") |
98 | 98 | add_subdirectory(src/ExternLib/PlotCurves) |
99 | 99 | add_subdirectory(src/ExternLib/StatisticProcesses) |
100 | 100 | add_subdirectory(src/ExternLib/FramesTransformation) |
101 | + add_subdirectory(src/ExternLib/EISCATDataFilter) | |
101 | 102 | find_package(CSlim) |
102 | 103 | IF ( CSLIM_FOUND ) |
103 | 104 | add_subdirectory(test/DD_Client/CSlimFixtures) | ... | ... |
... | ... | @@ -0,0 +1,23 @@ |
1 | + | |
2 | +PROJECT(EISCATDataFilter) | |
3 | + | |
4 | +set(LIBRARY_OUTPUT_PATH ${PLUGIN_OUTPUT_PATH}/EISCATDataFilter) | |
5 | + | |
6 | +include_directories( | |
7 | +) | |
8 | + | |
9 | +#Library configuration | |
10 | +file( | |
11 | + GLOB_RECURSE | |
12 | + source_files | |
13 | + ./* | |
14 | +) | |
15 | + | |
16 | +#ADD_LIBRARY( EISCATDataFilter SHARED ${source_files} ) | |
17 | + | |
18 | + #target_link_libraries( | |
19 | + #EISCATDataFilter | |
20 | +#) | |
21 | + | |
22 | +FILE( GLOB_RECURSE PROJ_HEADERS *.hh ) | |
23 | +INSTALL(FILES ${PROJ_HEADERS} DESTINATION ${LIBRARY_OUTPUT_PATH} PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) | ... | ... |
... | ... | @@ -0,0 +1,37 @@ |
1 | +/** | |
2 | + * EISCATDataFilter.hh | |
3 | + * | |
4 | + * Created on: 31 oct. 2012 | |
5 | + * Author: AKKA IS | |
6 | + */ | |
7 | + | |
8 | +#ifndef EISCATDATAFILTER_HH_ | |
9 | +#define EISCATDATAFILTER_HH_ | |
10 | + | |
11 | +#include <vector> | |
12 | + | |
13 | +/** | |
14 | + * @bried filetr EISCAT data in relation with the requested mode | |
15 | + */ | |
16 | + | |
17 | +// Mode : | |
18 | +// * -1 : No filter | |
19 | +// * 0 : Keep only Field-aligned | |
20 | +// * 1 : Keep only Other | |
21 | +// * 2 : Keep only Multi | |
22 | +// * 3 : Keep only Scan | |
23 | + | |
24 | +std::vector<float> EISCATDataFilter(const std::vector<float>& data, short crtMode, short mode = -1, int corrected = false) | |
25 | +{ | |
26 | + std::vector<float> result; | |
27 | + result = data; | |
28 | + if ((mode != -1) && (crtMode != mode)) { | |
29 | + for (std::vector<float>::iterator it = result.begin(); it != result.end(); ++it) { | |
30 | + (*it) = 0./0.; | |
31 | + } | |
32 | + } | |
33 | + | |
34 | + return result; | |
35 | +} | |
36 | + | |
37 | +#endif /* EISCATDATAFILTER_HH_ */ | ... | ... |