Commit 9ead87ad87d086a1131ff7eb0bc7f02be7f5cd23

Authored by Benjamin Renard
1 parent 95430126

First implementation for EISCAT data filter by instrument mode

CMakeLists.txt
@@ -98,6 +98,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") @@ -98,6 +98,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
98 add_subdirectory(src/ExternLib/PlotCurves) 98 add_subdirectory(src/ExternLib/PlotCurves)
99 add_subdirectory(src/ExternLib/StatisticProcesses) 99 add_subdirectory(src/ExternLib/StatisticProcesses)
100 add_subdirectory(src/ExternLib/FramesTransformation) 100 add_subdirectory(src/ExternLib/FramesTransformation)
  101 + add_subdirectory(src/ExternLib/EISCATDataFilter)
101 find_package(CSlim) 102 find_package(CSlim)
102 IF ( CSLIM_FOUND ) 103 IF ( CSLIM_FOUND )
103 add_subdirectory(test/DD_Client/CSlimFixtures) 104 add_subdirectory(test/DD_Client/CSlimFixtures)
src/ExternLib/EISCATDataFilter/CMakeLists.txt 0 → 100644
@@ -0,0 +1,23 @@ @@ -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)
src/ExternLib/EISCATDataFilter/EISCATDataFilter.hh 0 → 100644
@@ -0,0 +1,37 @@ @@ -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_ */