Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-8a6b96f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
PeakSelect.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Badri Krishnan, Alicia Sintes Olives
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/**
21 * \file PeakSelect.h
22 * \ingroup lalpulsar_bin_Hough
23 * \author Sintes, A.M., and Krishnan, B.
24 * \brief Header file for PeakSelect.c
25 *
26 * History: Created by Sintes May 21, 2003
27 * Modified by Krishnan Oct 2005
28 *
29 * ### Header PeakSelect.h ###
30 *
31 * From periodogram to peakgram
32 *
33 * ### Synopsis ###
34 *
35 * \code
36 * #include <lal/PeakSelect.h>
37 * \endcode
38 */
39
40/*
41 * 4. Protection against double inclusion (include-loop protection)
42 * Note the naming convention!
43 */
44
45#ifndef _PEAKSELECT_H
46#define _PEAKSELECT_H
47
48/*
49 * 5. Includes. This header may include others; if so, they go immediately
50 * after include-loop protection. Includes should appear in the following
51 * order:
52 * a. Standard library includes
53 * b. LDAS includes
54 * c. LAL includes
55 */
56
57#include <stdlib.h>
58#include <math.h>
59#include <stdio.h>
60#include <stdlib.h>
61#include <string.h>
62
63#include <lal/LALStdlib.h>
64#include <lal/LALConstants.h>
65#include <lal/AVFactories.h>
66#include <lal/SeqFactories.h>
67#include <lal/LALRunningMedian.h>
68#include <lal/NormalizeSFTRngMed.h>
69#include <lal/PHMD.h>
70
71#include "SFTbin.h"
72
73/*
74 * Protection against C++ name mangling
75 */
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
81/*
82 * 7. Error codes and messages. This must be auto-extracted for
83 * inclusion in the documentation.
84 */
85
86/**\name Error Codes */ /** @{ */
87
88#define PEAKSELECTH_ENULL 1
89#define PEAKSELECTH_EVAL 5
90
91#define PEAKSELECTH_MSGENULL "Null pointer"
92#define PEAKSELECTH_MSGEVAL "Invalid value"
93
94/** @} */
95
96
97/* ******************************************************
98 * 8. Macros. But, note that macros are deprecated.
99 * They could be moved to the modules where are needed
100 */
101
102
103/* *******************************************************
104 * 9. Constant Declarations. (discouraged)
105 */
106
107
108
109/* **************************************************************
110 * 10. Structure, enum, union, etc., typdefs.
111 */
112
113/** Explicit peakgram structure -- 1 if power in bin is above threshold and 0 if below */
114typedef struct tagUCHARPeakGram {
115 LIGOTimeGPS epoch; /**< epoch of first series sample */
116 REAL8 timeBase; /**< coherent time baseline used to construct peakgram */
117 INT4 fminBinIndex; /**< first frequency bin of peakgram */
118 INT4 length; /**< number of elements in data */
119 INT4 nPeaks; /**< number of peaks selected in data */
120 UCHAR *data; /**< pointer to the data {0,1}*/
122
123/** structure containing psd and periodogram of a sft -- obsolete -- use LAL functions */
124typedef struct tagREAL8PeriodoPSD {
128
129/*
130 * 11. Extern Global variables. (discouraged)
131 */
132
133
134/*
135 * 12. Functions Declarations (i.e., prototypes).
136 */
137
138/** to compute mean power from a periodogram -- obsolete -- use LAL functions in NormalizeSFTRngMed.c */
139void LALComputeMeanPower( LALStatus *status, /**< pointer to LALStatus structure */
140 REAL8 *mean, /**< mean power */
141 REAL8Periodogram1 *peri /**< periodogram */ );
142
143/** select peakgram in white noise -- obsolete -- use LAL functions in NormalizeSFTRngMed.c */
145 UCHARPeakGram *pg,
146 REAL8 *thr, /*absolute threshold */
147 REAL8Periodogram1 *peri );
148
149/** Compress explicit peak gram */
150void LALUCHAR2HOUGHPeak( LALStatus *status, /**< pointer to LALStatus structure */
151 HOUGHPeakGram *pgOut, /**< compressed peakgram */
152 UCHARPeakGram *pgIn /**< explicit peakgram -- collection of 1s and 0s*/
153 );
154
155/** Wrapper for LALRunningMedian code -- obsolete -- use LAL functions in NormalizeSFTRngMed.c */
156void LALPeriodo2PSDrng( LALStatus *status, /**< pointer to LALStatus structure */
157 REAL8Periodogram1 *psd, /**< output psd */
158 REAL8Periodogram1 *peri, /**< input periodogram */
159 INT4 *blocksRNG /**< running median block size */
160 );
161
162/** Function for selecting peaks in colored noise -- obsolete -- use LAL functions in NormalizeSFTRngMed.c */
163void LALSelectPeakColorNoise( LALStatus *status, /**< pointer to LALStatus structure */
164 UCHARPeakGram *pg, /**< output peakgram */
165 REAL8 *thr, /**< threshold reltive to psd */
166 REAL8PeriodoPSD *in /**< input psd and periodogram */
167 );
168
169/** Constructs peakgram from a normalized SFT -- uses standard pulsar data types */
170void SFTtoUCHARPeakGram( LALStatus *status, /**< pointer to LALStatus structure */
171 UCHARPeakGram *pg, /**< output peakgram */
172 const SFTtype *sft, /**< standard pulsar sft type */
173 REAL8 thr /**< sft power threshold for peak selection */
174 );
175
176#ifdef __cplusplus
177} /* Close C++ protection */
178#endif
179
180#endif /* Close double-include protection _PEAKSELECT_H */
void LALSelectPeakColorNoise(LALStatus *status, UCHARPeakGram *pg, REAL8 *thr, REAL8PeriodoPSD *in)
Function for selecting peaks in colored noise – obsolete – use LAL functions in NormalizeSFTRngMed....
Definition: PeakSelect.c:286
void LALPeriodo2PSDrng(LALStatus *status, REAL8Periodogram1 *psd, REAL8Periodogram1 *peri, INT4 *blocksRNG)
Wrapper for LALRunningMedian code – obsolete – use LAL functions in NormalizeSFTRngMed....
Definition: PeakSelect.c:215
void LALUCHAR2HOUGHPeak(LALStatus *status, HOUGHPeakGram *pgOut, UCHARPeakGram *pgIn)
Compress explicit peak gram.
Definition: PeakSelect.c:160
void SFTtoUCHARPeakGram(LALStatus *status, UCHARPeakGram *pg, const SFTtype *sft, REAL8 thr)
Constructs peakgram from a normalized SFT – uses standard pulsar data types.
Definition: PeakSelect.c:371
void LALComputeMeanPower(LALStatus *status, REAL8 *mean, REAL8Periodogram1 *peri)
to compute mean power from a periodogram – obsolete – use LAL functions in NormalizeSFTRngMed....
Definition: PeakSelect.c:56
void LALSelectPeakWhiteNoise(LALStatus *status, UCHARPeakGram *pg, REAL8 *thr, REAL8Periodogram1 *peri)
select peakgram in white noise – obsolete – use LAL functions in NormalizeSFTRngMed....
Definition: PeakSelect.c:97
unsigned char UCHAR
double REAL8
int32_t INT4
This structure stores the `‘peak-gram’'.
Definition: PHMD.h:129
structure containing psd and periodogram of a sft – obsolete – use LAL functions
Definition: PeakSelect.h:124
REAL8Periodogram1 periodogram
Definition: PeakSelect.h:126
REAL8Periodogram1 psd
Definition: PeakSelect.h:125
Explicit peakgram structure – 1 if power in bin is above threshold and 0 if below.
Definition: PeakSelect.h:114
UCHAR * data
pointer to the data {0,1}
Definition: PeakSelect.h:120
LIGOTimeGPS epoch
epoch of first series sample
Definition: PeakSelect.h:115
REAL8 timeBase
coherent time baseline used to construct peakgram
Definition: PeakSelect.h:116
INT4 nPeaks
number of peaks selected in data
Definition: PeakSelect.h:119
INT4 length
number of elements in data
Definition: PeakSelect.h:118
INT4 fminBinIndex
first frequency bin of peakgram
Definition: PeakSelect.h:117