Changes from Version 1 of adeiAGFilters

Show
Ignore:
Author:
csa (IP: 141.52.64.104)
Timestamp:
11/18/15 17:25:16 (9 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • adeiAGFilters

    v0 v1  
     1= Raw Data Filtering in ADEI = 
     2 
     3The filters are implemented in 'classes/filters'. There is 2 types of filters. 
     4 
     5== Group filters == 
     6Standard ones which are applied to all items in the group. A simplest example is badvaluefilter.php which search values of all group items for the specified value and replaces it to NULL (this is, for example, used to get read of 900 in temperatures which value is used to indicate errors by Armen). You also can drop complete vector by returning true from ProcessVector function. 
     7 
     8The configuration is pretty stright forward. You just need to add "data_filters" array in the stanard ADEI options, like: 
     9{{{ 
     10"data_filters" => array( 
     11   "BADVALUEFilter" => array ( 
     12   "badvalue" => 900 
     13  ) 
     14) 
     15}}} 
     16 
     17You will find few examples in the KATRIN configuration. All inside the inner array will be passed to constructor as parameters. 
     18 
     19 
     20== Channel Filters == 
     21The second type is filters applied to individual channels. Check item/rangeitemfilter.php which will check if the value is in the configured range [min,max] or will replace it with NULL otherwise. 
     22 
     23Here is configuration more elaborate. Just check ipecube configuration for the test kitcube setup. You still use "data_filters" option, but you need to provide list of affected channels. 
     24{{{ 
     25"data_filters" => array( 
     26   array ( 
     27    "class" => "ITEMFilter", 
     28    "filter" => "RANGEItemFilter", 
     29    "item_mask" => array( 
     30        array( 
     31          "key" => "item_dependency_column", 
     32          "items" => "/^PARS.PARS1.O.ND2.001.SUM$/", 
     33        ), array( 
     34          "key" => "item_extractor", 
     35          "items" => "/^SUMExtractor$/", 
     36       ) 
     37    ), 
     38    "min" => 100 
     39   ), 
     40) 
     41}}} 
     42 
     43Here "class" is always "ITEMFilter". The "filter" specifies which item filter you actually want to use. The item_mask contains 1 or more regexps to select channels. The "items" is regexp and "key" specifies the channel metadata to apply regexp to. In the example, it is pretty tricky. But normally you can just use "key" => "name" to filter channels based on their title. Finally, the content of second array is passed to the constructor, so you can add any free parameters later, like "min" in the examples.