Cheetah - SKA - PSS - Prototype Time Domain Search Pipeline
Metrics.h
1 /*
2  * The MIT License (MIT)
3  *
4  * Copyright (c) 2016 The SKA organisation
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef SKA_CHEETAH_RFIM_METRICS_H
25 #define SKA_CHEETAH_RFIM_METRICS_H
26 #include "cheetah/data/TimeFrequencyFlags.h"
27 
28 
29 namespace ska {
30 namespace cheetah {
31 namespace rfim {
32 
39 class Metrics
40 {
41  public:
43 
44  public:
45  Metrics(TimeFrequencyFlagsType const& expected, TimeFrequencyFlagsType const& actual);
46  ~Metrics();
47 
51  std::size_t compare(TimeFrequencyFlagsType const& expected, TimeFrequencyFlagsType const& actual);
52 
56  std::size_t num_correct() const;
57 
61  std::size_t num_rfi() const;
62 
66  float rfi_detected_percentage() const;
67 
71  float correct_percentage() const;
72 
76  TimeFrequencyFlagsType const& false_positives() const;
77 
81  std::size_t num_false_positives() const;
82  float false_positives_percentage() const;
83 
87  TimeFrequencyFlagsType const& false_negatives() const;
88 
92  std::size_t num_false_negatives() const;
93  float false_negatives_percentage() const;
94 
95  private:
96  TimeFrequencyFlagsType _false_positives;
97  TimeFrequencyFlagsType _false_negatives;
98  std::size_t _false_positives_num;
99  std::size_t _false_negatives_num;
100  std::size_t _correct_num;
101  std::size_t _rfi_num;
102 };
103 
104 
105 } // namespace rfim
106 } // namespace cheetah
107 } // namespace ska
108 
109 #endif // SKA_CHEETAH_RFIM_METRICS_H
float correct_percentage() const
return the total of any correct flags as a percentage
Definition: Metrics.cpp:58
float rfi_detected_percentage() const
return the total of any correct flags as a percentage
Definition: Metrics.cpp:51
TimeFrequencyFlagsType const & false_negatives() const
returnn a set of flags indicating each false negative found
Definition: Metrics.cpp:83
std::size_t num_correct() const
return the total of any correctly identified flags found
Definition: Metrics.cpp:41
Some limits and constants for FLDO.
Definition: Brdz.h:35
std::size_t num_false_positives() const
return the total of any false positives detected
Definition: Metrics.cpp:78
std::size_t compare(TimeFrequencyFlagsType const &expected, TimeFrequencyFlagsType const &actual)
calculate the metrics by comparing the two sets of flags
Definition: Metrics.cpp:93
std::size_t num_false_negatives() const
return the number of any false negatives detected
Definition: Metrics.cpp:88
A class for analysing and storing the results of the difference between two sets of flags representin...
Definition: Metrics.h:39
std::size_t num_rfi() const
return the number of rfi flags in the expected data
Definition: Metrics.cpp:46
TimeFrequencyFlagsType const & false_positives() const
returnn a set of flags indicating each false positive fopund
Definition: Metrics.cpp:73