LALInspiral 5.0.3.1-eeff03c
NRWaveIO.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006 S.Fairhurst, B. Krishnan, L.Santamaria
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 _NRWAVEIO_H /* Double-include protection. */
21#define _NRWAVEIO_H
22
23/* includes */
24#include <stdlib.h>
25#include <math.h>
26#include <stdio.h>
27#include <stdlib.h>
28#include <string.h>
29#include <lal/LALStdlib.h>
30#include <lal/LALConstants.h>
31#include <lal/AVFactories.h>
32#include <lal/SeqFactories.h>
33#include <lal/ConfigFile.h>
34#include <lal/LALStdlib.h>
35#include <lal/LALError.h>
36#include <lal/LALStdio.h>
37#include <lal/FileIO.h>
38#include <lal/StreamInput.h>
39#include <lal/LIGOMetadataTables.h>
40/* #include <lal/NRWaveInject.h> */
41
42#ifdef __cplusplus /* C++ protection. */
43extern "C" {
44#endif
45
46/**
47 * \defgroup NRWaveIO_h Header NRWaveIO.h
48 * \ingroup lalinspiral_UNCLASSIFIED
49 * \author S.Fairhurst, B. Krishnan, L.Santamaria
50 *
51 * \brief Module for reading/writing Numrel waveforms
52 *
53 */
54/** @{ */
55
56/** \name Error codes */
57/** @{ */
58#define NRWAVEIO_ENULL 1 /**< Null pointer */
59#define NRWAVEIO_EFILE 2 /**< Error in file-IO */
60#define NRWAVEIO_ENONULL 3 /**< Not a Null pointer */
61#define NRWAVEIO_ENOMEM 4 /**< Memory ellocation error */
62#define NRWAVEIO_EVAL 5 /**< Invalid value */
63#define NRWAVEIO_EFORMAT 6 /**< Meta data file format incorrect */
64/** @} */
65
66/** \cond DONT_DOXYGEN */
67#define NRWAVEIO_MSGENULL "Null pointer"
68#define NRWAVEIO_MSGEFILE "Error in file-IO"
69#define NRWAVEIO_MSGENONULL "Not a Null pointer"
70#define NRWAVEIO_MSGENOMEM "Memory ellocation error"
71#define NRWAVEIO_MSGEVAL "Invalid value"
72#define NRWAVEIO_MSGEFORMAT "Meta data file format incorrect"
73/** \endcond */
74
75
76/**
77 * Struct containing metadata information about a
78 * single numerical relativity waveform. This information
79 * will be read from a metadata file. It is expected that
80 * more elements will be added to this struct as required.
81 */
82typedef struct
83tagNRWaveMetaData
84{
85 REAL8 massRatio; /**< Mass ratio m1/m2 where we assume m1 >= m2*/
86 REAL8 spin1[3]; /**< Spin of m1 */
87 REAL8 spin2[3]; /**< Spin of m2 */
88 INT4 mode[2]; /**< l and m values */
89 CHAR filename[LALNameLength]; /**< filename where data is stored */
90 /* NumRelGroup group; */
91}
93
94
95/** List of numrel waveform metadata */
96typedef struct
97tagNRWaveCatalog
98{
99 UINT4 length; /**< Number of waveforms */
100 NRWaveMetaData *data; /**< List of waveforms */
101}
103
104typedef struct
105tagNumRelInjectParams
106{
113
115
117
118void LALReadNRWave(LALStatus *status, REAL4TimeVectorSeries **out, const REAL4 mass, const CHAR *filename);
119
120void LALNRDataFind( LALStatus *status, NRWaveCatalog *out, const CHAR *dir, const CHAR *filename);
121
122void LALGetSingleNRMetaData( LALStatus *status, NRWaveMetaData *data, const CHAR *dir, const CHAR *cfgstr);
123
125 NRWaveCatalog *nrCatalog, INT4 modeLlo, INT4 modeLhi, const SimInspiralTable *thisInj);
126
128
129/** @} */ /* end:NRWaveIO_h */
130
131#ifdef __cplusplus
132} /* Close C++ protection */
133#endif
134
135#endif /* Close double-include protection _NRWAVEIO_H */
double REAL8
char CHAR
uint32_t UINT4
int32_t INT4
float REAL4
LALNameLength
void LALReadNRWave(LALStatus *status, REAL4TimeVectorSeries **out, const REAL4 mass, const CHAR *filename)
Reads a numerical relativity waveform given a filename and a value of the total mass for setting the ...
Definition: NRWaveIO.c:201
void LALGetSingleNRMetaData(LALStatus *status, NRWaveMetaData *data, const CHAR *dir, const CHAR *cfgstr)
Parse a single string to fill the NRWaveMetaData structure.
Definition: NRWaveIO.c:335
void LALDriveNRInject(LALStatus *status, REAL4TimeSeries *injData, SimInspiralTable *injections, NumRelInjectParams *params)
Main driver funtion for doing Numerical Relativity Injections.
Definition: NRWaveIO.c:464
void LALNRDataFind(LALStatus *status, NRWaveCatalog *out, const CHAR *dir, const CHAR *filename)
Function for reading a numerical relativity metadata file.
Definition: NRWaveIO.c:293
void LALReadNRWave_raw_real8(LALStatus *status, REAL8TimeVectorSeries **out, const CHAR *filename)
Definition: NRWaveIO.c:118
void LALAddStrainModes(LALStatus *status, REAL4TimeVectorSeries **outStrain, NRWaveCatalog *nrCatalog, INT4 modeLlo, INT4 modeLhi, const SimInspiralTable *thisInj)
Put the main functionalities of nr_wave.c together.
Definition: NRWaveIO.c:389
void LALReadNRWave_raw(LALStatus *status, REAL4TimeVectorSeries **out, const CHAR *filename)
Functionfor reading the numrel waveform – just returns the numrel data as it is without any rescaling...
Definition: NRWaveIO.c:39
List of numrel waveform metadata.
Definition: NRWaveIO.h:98
NRWaveMetaData * data
List of waveforms.
Definition: NRWaveIO.h:100
UINT4 length
Number of waveforms.
Definition: NRWaveIO.h:99
Struct containing metadata information about a single numerical relativity waveform.
Definition: NRWaveIO.h:84
REAL8 massRatio
Mass ratio m1/m2 where we assume m1 >= m2.
Definition: NRWaveIO.h:85
NRWaveCatalog * nrCatalog
Definition: NRWaveIO.h:107