Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
SphHarmTSTest.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Chris Pankow
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 * \author Chris Pankow
22 *
23 * \file
24 *
25 * \brief Testing SphHarmTimeSeries code
26 */
27
28
29#include <lal/Sequence.h>
30#include <lal/LALSimInspiral.h>
31#include <lal/TimeSeries.h>
32#include <lal/Date.h>
33#include <lal/Units.h>
34
35int main(void){
36 // Empty time series -- technically works, but doesn't make a lot
37 // of sense
39
40 // blow it away
42 ts = NULL;
43
44 LIGOTimeGPS epoch = {0,0};
45 int l;
46 int m;
47
49 for( l=0; l<3; l++ ){
50 for( m=-l; m<=l; m++ ){
52 "test hlm",
53 &(epoch),
54 0,
55 1.0/16384,
57 100
58 );
60 // time series makes a duplicate of the input, so this isn't
61 // needed.
63 }
64 }
65 printf( "%u major modes added.", XLALSphHarmTimeSeriesGetMaxL( ts )+1 );
66
68 "test hlm",
69 &(epoch),
70 0,
71 1.0/16384,
73 100
74 );
75
76 // Overwrite a component mode
77 SphHarmTimeSeries **check = &ts;
78 ts = XLALSphHarmTimeSeriesAddMode( ts, h_lm, 2, -2 );
80 if( check != &ts ){
81 fprintf( stderr, "Returned structure does not match after mode overwrite." );
82 return 1;
83 }
84
85 // Check the addition of tdata
87 int i = 0;
88 for(; i<10; i++){
89 tdata->data[i] = (double)i;
90 }
93 XLAL_CHECK_EXIT( tdata_hlm == tdata );
94
96
98
99 return 0;
100}
void LALCheckMemoryLeaks(void)
int main(void)
Definition: SphHarmTSTest.c:35
#define fprintf
int l
Definition: bh_qnmode.c:135
double i
Definition: bh_ringdown.c:118
SphHarmTimeSeries * XLALSphHarmTimeSeriesAddMode(SphHarmTimeSeries *appended, const COMPLEX16TimeSeries *inmode, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmTimeSeries, or create a new head.
void XLALSphHarmTimeSeriesSetTData(SphHarmTimeSeries *ts, REAL8Sequence *tdata)
Set the tdata member for all nodes in the list.
UINT4 XLALSphHarmTimeSeriesGetMaxL(SphHarmTimeSeries *ts)
Get the largest l index of any mode in the SphHarmTimeSeries linked list.
void XLALDestroySphHarmTimeSeries(SphHarmTimeSeries *ts)
Delete list from current pointer to the end of the list.
REAL8Sequence * XLALSphHarmTimeSeriesGetTData(SphHarmTimeSeries *ts)
Get the tdata member for nodes in the list.
static const INT4 m
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
void XLALDestroyCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series)
COMPLEX16TimeSeries * XLALCreateCOMPLEX16TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
const LALUnit lalStrainUnit
#define XLAL_CHECK_EXIT(assertion)
REAL8 * data
Structure to carry a collection of spherical harmonic modes in COMPLEX16 time series.
LIGOTimeGPS epoch
Definition: unicorn.c:20