00001 #include <math.h>
00002 #include <lal/LALConstants.h>
00003 #include <lal/XLALError.h>
00004 #include <lal/Date.h>
00005 #include <lal/Units.h>
00006
00007 #define LAL_CHECK_VALID_SERIES(s,val) \
00008 do { \
00009 if ( !(s) ) XLAL_ERROR_VAL( func, XLAL_EFAULT, val ); \
00010 if ( !(s)->data || !(s)->data->data || !(s)->data->length ) XLAL_ERROR_VAL( func, XLAL_EINVAL, val ); \
00011 } while (0)
00012
00013 #define LAL_CHECK_CONSISTENT_TIME_SERIES(s1,s2,val) \
00014 do { \
00015 if ( XLALGPSCmp( &(s1)->epoch, &(s2)->epoch ) != 0 ) XLAL_ERROR_VAL( func, XLAL_ETIME, val ); \
00016 if ( fabs( (s1)->deltaT - (s2)->deltaT ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( func, XLAL_ETIME, val ); \
00017 if ( fabs( (s1)->f0 - (s2)->f0 ) > LAL_REAL8_EPS ) XLAL_ERROR_VAL( func, XLAL_EFREQ, val ); \
00018 if ( XLALUnitCompare( &(s1)->sampleUnits, &(s2)->sampleUnits ) ) XLAL_ERROR_VAL( func, XLAL_EUNIT, val ); \
00019 if ( (s1)->data->length != (s1)->data->length ) XLAL_ERROR_VAL( func, XLAL_EBADLEN, val ); \
00020 } while (0)