Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
check_series_macros.h
Go to the documentation of this file.
1#include <math.h>
2#include <lal/LALConstants.h>
3#include <lal/XLALError.h>
4#include <lal/Date.h>
5#include <lal/Units.h>
6
7#define LAL_CHECK_VALID_SERIES(s,val) \
8 do { \
9 if ( !(s) ) XLAL_ERROR_VAL( val, XLAL_EFAULT ); \
10 if ( !(s)->data || !(s)->data->data || !(s)->data->length ) XLAL_ERROR_VAL( val, XLAL_EINVAL ); \
11 } while (0)
12
13#define LAL_CHECK_CONSISTENT_TIME_SERIES(s1,s2,val) \
14 do { \
15 if ( XLALGPSCmp( &(s1)->epoch, &(s2)->epoch ) != 0 ) XLAL_ERROR_VAL( val, XLAL_ETIME ); \
16 if ( fabs( (s1)->deltaT - (s2)->deltaT ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( val, XLAL_ETIME ); \
17 if ( fabs( (s1)->f0 - (s2)->f0 ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( val, XLAL_EFREQ ); \
18 if ( XLALUnitCompare( &(s1)->sampleUnits, &(s2)->sampleUnits ) ) XLAL_ERROR_VAL( val, XLAL_EUNIT ); \
19 if ( (s1)->data->length != (s1)->data->length ) XLAL_ERROR_VAL(val, XLAL_EBADLEN ); \
20 } while (0)
21
22#define LAL_CHECK_COMPATIBLE_TIME_SERIES(s1,s2,val) \
23 do { \
24 if ( fabs( (s1)->deltaT - (s2)->deltaT ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( val, XLAL_ETIME ); \
25 if ( fabs( (s1)->f0 - (s2)->f0 ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( val, XLAL_EFREQ ); \
26 if ( XLALUnitCompare( &(s1)->sampleUnits, &(s2)->sampleUnits ) ) XLAL_ERROR_VAL( val, XLAL_EUNIT ); \
27 } while (0)
28
29#define LAL_CHECK_COMPATIBLE_BUT_UNIT_TIME_SERIES(s1,s2,val) \
30 do { \
31 if ( XLALGPSCmp( &(s1)->epoch, &(s2)->epoch ) != 0 ) XLAL_ERROR_VAL( val, XLAL_ETIME ); \
32 if ( fabs( (s1)->deltaT - (s2)->deltaT ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( val, XLAL_ETIME ); \
33 if ( fabs( (s1)->f0 - (s2)->f0 ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( val, XLAL_EFREQ ); \
34 if ( (s1)->data->length != (s1)->data->length ) XLAL_ERROR_VAL(val, XLAL_EBADLEN ); \
35 } while (0)