Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ResultsToplist.h
Go to the documentation of this file.
1//
2// Copyright (C) 2016, 2017 Karl Wette
3//
4// This program is free software; you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation; either version 2 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with with program; see the file COPYING. If not, write to the
16// Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17// MA 02110-1301 USA
18//
19
20#ifndef _RESULTS_TOPLIST_H
21#define _RESULTS_TOPLIST_H
22
23///
24/// \file
25/// \ingroup lalpulsar_bin_Weave
26/// \brief Module which handles toplists of results
27///
28
29#include "Weave.h"
30#include "SetupData.h"
31#include "ComputeResults.h"
32#include "OutputResults.h"
33
34#include <lal/LALHeap.h>
35#include <lal/LFTandTSutils.h>
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41///
42/// Toplist item
43///
45 /// Serial number of template
47 /// Index of coherent templates (only needed for per-segment output)
49 /// Physical right ascension of semicoherent template
51 /// Physical right ascension of coherent templates (only needed for per-segment output)
53 /// Physical declination of semicoherent template
55 /// Physical declination of coherent templates (only needed for per-segment output)
57 /// Physical frequency and spindowns of semicoherent template
59 /// Physical frequency and spindowns of coherent templates (only needed for per-segment output)
61 /// All statistics values computed in this template in 'stage[0]' (first pass) and 'stage[1]' ('recalculation' step without interpolation)
62 WeaveStatisticsValues stage[2];
63};
64
65///
66/// Function which returns pointer to array of statistics by which toplist items are ranked
67///
68typedef const REAL4 *( *WeaveResultsToplistRankingStats )( const WeaveSemiResults *semi_res );
69
70///
71/// Function which returns the value of the statistic by which toplist items are ranked
72///
73typedef REAL4( *WeaveResultsToplistItemGetRankStat )( const WeaveResultsToplistItem *item );
74
75///
76/// Function which sets the value of the statistic by which toplist items are ranked
77///
78typedef void ( *WeaveResultsToplistItemSetRankStat )( WeaveResultsToplistItem *item, const REAL4 value );
79
80WeaveResultsToplist *XLALWeaveResultsToplistCreate(
81 const size_t nspins,
82 WeaveStatisticsParams *statistics_params,
83 const char *stat_name,
84 const char *stat_desc,
85 const UINT4 toplist_limit,
86 WeaveResultsToplistRankingStats toplist_rank_stats_fcn,
87 WeaveResultsToplistItemGetRankStat toplist_item_get_rank_stat_fcn,
88 WeaveResultsToplistItemSetRankStat toplist_item_set_rank_stat_fcn
89);
91 WeaveResultsToplist *toplist
92);
94 WeaveResultsToplist *toplist,
95 const WeaveSemiResults *semi_res,
96 const UINT4 semi_nfreqs
97);
99 WeaveResultsToplist *toplist
100);
102 FITSFile *file,
103 const WeaveResultsToplist *toplist
104);
106 FITSFile *file,
107 WeaveResultsToplist *toplist
108);
110 BOOLEAN *equal,
111 const WeaveSetupData *setup,
112 const BOOLEAN sort_by_semi_phys,
113 const UINT4 round_param_to_dp,
114 const UINT4 round_param_to_sf,
115 const REAL8 unmatched_item_tol,
116 const REAL8 param_tol_mism,
117 const VectorComparison *result_tol,
118 const UINT4 toplist_compare_limit,
119 const WeaveResultsToplist *toplist_1,
120 const WeaveResultsToplist *toplist_2
121);
122
123#ifdef __cplusplus
124}
125#endif
126
127#endif // _RESULTS_TOPLIST_H
128
129// Local Variables:
130// c-file-style: "linux"
131// c-basic-offset: 2
132// End:
Module which computes coherent and semicoherent results.
stage
Module which handles the output results.
int XLALWeaveResultsToplistAdd(WeaveResultsToplist *toplist, const WeaveSemiResults *semi_res, const UINT4 semi_nfreqs)
Add semicoherent results to toplist.
REAL4(* WeaveResultsToplistItemGetRankStat)(const WeaveResultsToplistItem *item)
Function which returns the value of the statistic by which toplist items are ranked.
void XLALWeaveResultsToplistDestroy(WeaveResultsToplist *toplist)
Free results toplist.
const REAL4 *(* WeaveResultsToplistRankingStats)(const WeaveSemiResults *semi_res)
Function which returns pointer to array of statistics by which toplist items are ranked.
WeaveResultsToplist * XLALWeaveResultsToplistCreate(const size_t nspins, WeaveStatisticsParams *statistics_params, const char *stat_name, const char *stat_desc, const UINT4 toplist_limit, WeaveResultsToplistRankingStats toplist_rank_stats_fcn, WeaveResultsToplistItemGetRankStat toplist_item_get_rank_stat_fcn, WeaveResultsToplistItemSetRankStat toplist_item_set_rank_stat_fcn)
Create results toplist.
int XLALWeaveResultsToplistReadAppend(FITSFile *file, WeaveResultsToplist *toplist)
Read results from a FITS file and append to existing results toplist.
int XLALWeaveResultsToplistCompare(BOOLEAN *equal, const WeaveSetupData *setup, const BOOLEAN sort_by_semi_phys, const UINT4 round_param_to_dp, const UINT4 round_param_to_sf, const REAL8 unmatched_item_tol, const REAL8 param_tol_mism, const VectorComparison *result_tol, const UINT4 toplist_compare_limit, const WeaveResultsToplist *toplist_1, const WeaveResultsToplist *toplist_2)
Compare two results toplists and return whether they are equal.
void(* WeaveResultsToplistItemSetRankStat)(WeaveResultsToplistItem *item, const REAL4 value)
Function which sets the value of the statistic by which toplist items are ranked.
int XLALWeaveResultsToplistWrite(FITSFile *file, const WeaveResultsToplist *toplist)
Write results toplist to a FITS file.
int XLALWeaveResultsToplistCompletionLoop(WeaveResultsToplist *toplist)
Compute all missing 'extra' (non-toplist-ranking) statistics for all toplist entries.
Module which handles the setup data.
struct tagFITSFile FITSFile
Representation of a FITS file.
Definition: FITSFileIO.h:54
unsigned char BOOLEAN
uint64_t UINT8
double REAL8
uint32_t UINT4
float REAL4
#define PULSAR_MAX_SPINS
maximal number of spin-parameters (Freq + spindowns) we can handle
Struct holding the results of comparing two floating-point vectors (real-valued or complex),...
Definition: LFTandTSutils.h:64
REAL8 semi_fkdot[PULSAR_MAX_SPINS]
Physical frequency and spindowns of semicoherent template.
UINT8 * coh_index
Index of coherent templates (only needed for per-segment output)
REAL8 * coh_fkdot[PULSAR_MAX_SPINS]
Physical frequency and spindowns of coherent templates (only needed for per-segment output)
REAL8 * coh_delta
Physical declination of coherent templates (only needed for per-segment output)
REAL8 semi_alpha
Physical right ascension of semicoherent template.
REAL8 semi_delta
Physical declination of semicoherent template.
REAL8 * coh_alpha
Physical right ascension of coherent templates (only needed for per-segment output)
UINT8 serial
Serial number of template.