| AVFactories.h | | AVFactories.h | |
| | | | |
| skipping to change at line 18 | | skipping to change at line 18 | |
| #define _AVFACTORIES_H | | #define _AVFACTORIES_H | |
| | | | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| #include <stdarg.h> | | #include <stdarg.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup AVFactories_h | | * \addtogroup AVFactories_h | |
| | | * | |
| \brief Provides prototype and status code information for use of CreateVect | | * \brief Provides prototype and status code information for use of CreateV | |
| or, | | ector, | |
| CreateArray, ResizeVector, ResizeArray, DestroyVector and DestroyArray | | * CreateArray, ResizeVector, ResizeArray, DestroyVector and DestroyArray | |
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/AVFactories.h> | | * \code | |
| \endcode | | * #include <lal/AVFactories.h> | |
| | | * \endcode | |
| \section secXLALfcts XLAL Functions | | * | |
| | | * \section secXLALfcts XLAL Functions | |
| \code | | * | |
| REAL4Vector * XLALCreateVector(UINT4 length); | | * \code | |
| REAL4Vector * XLALResizeVector(REAL4Vector *vector, UINT4 length); | | * REAL4Vector * XLALCreateVector(UINT4 length); | |
| void XLALDestroyVector(REAL4Vector *vector, UINT4 length); | | * REAL4Vector * XLALResizeVector(REAL4Vector *vector, UINT4 length); | |
| | | * void XLALDestroyVector(REAL4Vector *vector, UINT4 length); | |
| <vectype> * XLALCreate<vectype>(UINT4 length ); | | * | |
| <vectype> * XLALResize<vectype>(<vectype> *vector, UINT4 length ); | | * <vectype> * XLALCreate<vectype>(UINT4 length ); | |
| void XLALDestroy<vectype>(<vectype> *vector); | | * <vectype> * XLALResize<vectype>(<vectype> *vector, UINT4 length ); | |
| | | * void XLALDestroy<vectype>(<vectype> *vector); | |
| REAL4Array * XLALCreateArrayL(UINT4 ndim, ...); | | * | |
| REAL4Array * XLALCreateArrayV(UINT4 ndim, UINT4 *dims); | | * REAL4Array * XLALCreateArrayL(UINT4 ndim, ...); | |
| REAL4Array * XLALCreateArray(UINT4Vector *dimLength); | | * REAL4Array * XLALCreateArrayV(UINT4 ndim, UINT4 *dims); | |
| REAL4Array * XLALResizeArrayL(REAL4Array *array, UINT4 ndim, ...); | | * REAL4Array * XLALCreateArray(UINT4Vector *dimLength); | |
| REAL4Array * XLALResizeArrayV(REAL4Array *array, UINT4 ndim, UINT4 *dims); | | * REAL4Array * XLALResizeArrayL(REAL4Array *array, UINT4 ndim, ...); | |
| REAL4Array * XLALResizeArray(REAL4Array *array, UINT4Vector *dimLength); | | * REAL4Array * XLALResizeArrayV(REAL4Array *array, UINT4 ndim, UINT4 *dims | |
| void XLALDestroyArray(REAL4Array *array); | | ); | |
| | | * REAL4Array * XLALResizeArray(REAL4Array *array, UINT4Vector *dimLength); | |
| <arrtype> * XLALCreate<arrtype>L(UINT4 ndim, ...); | | * void XLALDestroyArray(REAL4Array *array); | |
| <arrtype> * XLALCreate<arrtype>V(UINT4 ndim, UINT4 *dims); | | * | |
| <arrtype> * XLALCreate<arrtype>(UINT4Vector *dimLength); | | * <arrtype> * XLALCreate<arrtype>L(UINT4 ndim, ...); | |
| <arrtype> * XLALResize<arrtype>L(<arrtype> *array, UINT4 ndim, ...); | | * <arrtype> * XLALCreate<arrtype>V(UINT4 ndim, UINT4 *dims); | |
| <arrtype> * XLALResize<arrtype>V(<arrtype> *array, UINT4 ndim, UINT4 *dims) | | * <arrtype> * XLALCreate<arrtype>(UINT4Vector *dimLength); | |
| ; | | * <arrtype> * XLALResize<arrtype>L(<arrtype> *array, UINT4 ndim, ...); | |
| <arrtype> * XLALResize<arrtype>(<arrtype> *array, UINT4Vector *dimLength); | | * <arrtype> * XLALResize<arrtype>V(<arrtype> *array, UINT4 ndim, UINT4 *di | |
| void XLALDestroy<arrtype>(<arrtype> *array); | | ms); | |
| \endcode | | * <arrtype> * XLALResize<arrtype>(<arrtype> *array, UINT4Vector *dimLength | |
| | | ); | |
| Here <tt>\<vectype\></tt> is one of | | * void XLALDestroy<arrtype>(<arrtype> *array); | |
| \c COMPLEX16Vector, | | * \endcode | |
| \c COMPLEX8Vector, | | * | |
| \c REAL8Vector, | | * Here <tt>\<vectype\></tt> is one of | |
| \c REAL4Vector, | | * \c COMPLEX16Vector, | |
| \c INT8Vector, | | * \c COMPLEX8Vector, | |
| \c INT4Vector, | | * \c REAL8Vector, | |
| \c INT2Vector, | | * \c REAL4Vector, | |
| \c UINT8Vector, | | * \c INT8Vector, | |
| \c UINT4Vector, | | * \c INT4Vector, | |
| \c UINT2Vector, or | | * \c INT2Vector, | |
| \c CHARVector, | | * \c UINT8Vector, | |
| and <tt>\<arrtype\></tt> is one of | | * \c UINT4Vector, | |
| \c COMPLEX16Array, | | * \c UINT2Vector, or | |
| \c COMPLEX8Array, | | * \c CHARVector, | |
| \c REAL8Array, | | * and <tt>\<arrtype\></tt> is one of | |
| \c REAL4Array, | | * \c COMPLEX16Array, | |
| \c INT8Array, | | * \c COMPLEX8Array, | |
| \c INT4Array, | | * \c REAL8Array, | |
| \c INT2Array, | | * \c REAL4Array, | |
| \c UINT8Array, | | * \c INT8Array, | |
| \c UINT4Array, or | | * \c INT4Array, | |
| \c UINT2Array. | | * \c INT2Array, | |
| | | * \c UINT8Array, | |
| \subsection ss_AVF_desc Description | | * \c UINT4Array, or | |
| | | * \c UINT2Array. | |
| The <tt>XLALCreate\<type\>%Vector</tt> functions create vectors of the spec | | * | |
| ified | | * \subsection ss_AVF_desc Description | |
| \c length number of objects of type <tt>\<type\></tt>. The function | | * | |
| \c XLALCreateVector() is the same as \c XLALCreateREAL4Vector(). | | * The <tt>XLALCreate\<type\>%Vector</tt> functions create vectors of the s | |
| | | pecified | |
| The <tt>XLALDestroy\<type\>%Vector</tt> functions deallocate the memory all | | * \c length number of objects of type <tt>\<type\></tt>. The function | |
| ocation | | * \c XLALCreateVector() is the same as \c XLALCreateREAL4Vector(). | |
| pointed to by \c vector including its contents. The function | | * | |
| \c XLALDestroyVector() is the same as \c XLALDestroyREAL4Vector(). | | * The <tt>XLALDestroy\<type\>%Vector</tt> functions deallocate the memory | |
| | | allocation | |
| The <tt>XLALResize\<type\>%Vector</tt> functions resize the supplied vector | | * pointed to by \c vector including its contents. The function | |
| \c vector to the new size \c length. If \c vector is \c NULL | | * \c XLALDestroyVector() is the same as \c XLALDestroyREAL4Vector(). | |
| then this is equivalent to <tt>XLALCreate\<type\>%Vector</tt>. If \c lengt | | * | |
| h | | * The <tt>XLALResize\<type\>%Vector</tt> functions resize the supplied vec | |
| is zero then this is equivalent to <tt>XLALDestroy\<type\>%Vector</tt> and | | tor | |
| the | | * \c vector to the new size \c length. If \c vector is \c NULL | |
| routine returns \c NULL. Otherwise, the amount of data in the vector | | * then this is equivalent to <tt>XLALCreate\<type\>%Vector</tt>. If \c le | |
| is realloced using \c LALRealloc(). The function | | ngth | |
| \c XLALResizeVector() is the same as \c XLALResizeREAL4Vector(). | | * is zero then this is equivalent to <tt>XLALDestroy\<type\>%Vector</tt> a | |
| | | nd the | |
| The <tt>XLALCreate\<type\>Array</tt> | | * routine returns \c NULL. Otherwise, the amount of data in the vector | |
| <tt>XLALCreate\<type\>ArrayL</tt> | | * is realloced using \c LALRealloc(). The function | |
| <tt>XLALCreate\<type\>ArrayV</tt> | | * \c XLALResizeVector() is the same as \c XLALResizeREAL4Vector(). | |
| all create an object of type <tt>\<type\>Array</tt>. They differ in the wa | | * | |
| y | | * The <tt>XLALCreate\<type\>Array</tt> | |
| that the dimensions of the array are specified. The function | | * <tt>XLALCreate\<type\>ArrayL</tt> | |
| <tt>XLALCreate\<type\>Array</tt> allocates an array with dimensions specifi | | * <tt>XLALCreate\<type\>ArrayV</tt> | |
| ed | | * all create an object of type <tt>\<type\>Array</tt>. They differ in the | |
| by the \c UINT4Vector \c dimLength which is a vector of dimension | | way | |
| lengths for the array. The function | | * that the dimensions of the array are specified. The function | |
| <tt>XLALCreate\<type\>ArrayV</tt> provides these dimensions with two argume | | * <tt>XLALCreate\<type\>Array</tt> allocates an array with dimensions spec | |
| nts: | | ified | |
| \c ndim is the number of dimensions and \c dims is an array of | | * by the \c UINT4Vector \c dimLength which is a vector of dimension | |
| \c UINT4 values for the dimensions. The function | | * lengths for the array. The function | |
| <tt>XLALCreate\<type\>ArrayL</tt> also specifies the dimensions as argument | | * <tt>XLALCreate\<type\>ArrayV</tt> provides these dimensions with two arg | |
| s. | | uments: | |
| Here, the first argument, \c ndim, is the number of dimensions, and | | * \c ndim is the number of dimensions and \c dims is an array of | |
| this is followed by \c ndim arguments that provide the dimensions. | | * \c UINT4 values for the dimensions. The function | |
| Note that for this function, a maximum of 16 dimensions can be provided | | * <tt>XLALCreate\<type\>ArrayL</tt> also specifies the dimensions as argum | |
| (that is, \c ndim cannot be more than 16 and there cannot be more than | | ents. | |
| 16 arguments after the first). | | * Here, the first argument, \c ndim, is the number of dimensions, and | |
| The \c XLALCreateArray() | | * this is followed by \c ndim arguments that provide the dimensions. | |
| \c XLALCreateArrayL() | | * Note that for this function, a maximum of 16 dimensions can be provided | |
| \c XLALCreateArrayV() | | * (that is, \c ndim cannot be more than 16 and there cannot be more than | |
| functions are equivalent to the | | * 16 arguments after the first). | |
| \c XLALCreateREAL4Array() | | * The \c XLALCreateArray() | |
| \c XLALCreateREAL4ArrayL() | | * \c XLALCreateArrayL() | |
| \c XLALCreateREAL4ArrayV() | | * \c XLALCreateArrayV() | |
| functions respectively. | | * functions are equivalent to the | |
| | | * \c XLALCreateREAL4Array() | |
| The <tt>XLALDestroy\<type\>Array</tt> functions deallocate the memory alloc | | * \c XLALCreateREAL4ArrayL() | |
| ation | | * \c XLALCreateREAL4ArrayV() | |
| pointed to by \c array including its contents. The function | | * functions respectively. | |
| \c XLALDestroyArray() is the same as \c XLALDestroyREAL4Array(). | | * | |
| | | * The <tt>XLALDestroy\<type\>Array</tt> functions deallocate the memory al | |
| The <tt>XLALResize\<type\>Array</tt> | | location | |
| <tt>XLALResize\<type\>ArrayL</tt> | | * pointed to by \c array including its contents. The function | |
| <tt>XLALResize\<type\>ArrayV</tt> | | * \c XLALDestroyArray() is the same as \c XLALDestroyREAL4Array(). | |
| functions resize the provided array \c array. The arguments after the | | * | |
| first are interpreted in the same way as for the | | * The <tt>XLALResize\<type\>Array</tt> | |
| <tt>XLALCreate\<type\>Array</tt> | | * <tt>XLALResize\<type\>ArrayL</tt> | |
| <tt>XLALCreate\<type\>ArrayL</tt> | | * <tt>XLALResize\<type\>ArrayV</tt> | |
| <tt>XLALCreate\<type\>ArrayV</tt> | | * functions resize the provided array \c array. The arguments after the | |
| functions. If \c array is \c NULL, the resize functions are equivalent | | * first are interpreted in the same way as for the | |
| to the corresponding create function. If \c ndim is zero for | | * <tt>XLALCreate\<type\>Array</tt> | |
| <tt>XLALResize\<type\>ArrayL</tt> or | | * <tt>XLALCreate\<type\>ArrayL</tt> | |
| <tt>XLALResize\<type\>ArrayV</tt>, or if \c dimLength is \c NULL for | | * <tt>XLALCreate\<type\>ArrayV</tt> | |
| <tt>XLALResize\<type\>Array</tt>, then these functions are equivalent to | | * functions. If \c array is \c NULL, the resize functions are equivalent | |
| <tt>XLALDestroy\<type\>Array</tt>. | | * to the corresponding create function. If \c ndim is zero for | |
| The \c XLALResizeArray() | | * <tt>XLALResize\<type\>ArrayL</tt> or | |
| \c XLALResizeArrayL() | | * <tt>XLALResize\<type\>ArrayV</tt>, or if \c dimLength is \c NULL for | |
| \c XLALResizeArrayV() | | * <tt>XLALResize\<type\>Array</tt>, then these functions are equivalent to | |
| functions are equivalent to the | | * <tt>XLALDestroy\<type\>Array</tt>. | |
| \c XLALResizeREAL4Array() | | * The \c XLALResizeArray() | |
| \c XLALResizeREAL4ArrayL() | | * \c XLALResizeArrayL() | |
| \c XLALResizeREAL4ArrayV() | | * \c XLALResizeArrayV() | |
| functions respectively. | | * functions are equivalent to the | |
| | | * \c XLALResizeREAL4Array() | |
| \subsection ss_AVF_return Return Values | | * \c XLALResizeREAL4ArrayL() | |
| | | * \c XLALResizeREAL4ArrayV() | |
| If successful, the create and resize functions return a pointer to the same | | * functions respectively. | |
| data that was passed to the function. The resize functions will return | | * | |
| a \c NULL pointer if the size of the new object was zero. Upon failure | | * \subsection ss_AVF_return Return Values | |
| these routines will return \c NULL and will set \c xlalErrno to | | * | |
| one of these values: \c #XLAL_ENOMEM if a memory allocation failed, | | * If successful, the create and resize functions return a pointer to the s | |
| \c #XLAL_EBADLEN if an invalid length was provided (for example, a | | ame | |
| zero-size allocation with a create function), \c XLAL_EINVAL if an | | * data that was passed to the function. The resize functions will return | |
| invalid argument is provided (for example, if the pointer to an | | * a \c NULL pointer if the size of the new object was zero. Upon failure | |
| array of dimensions is \c NULL). | | * these routines will return \c NULL and will set \c xlalErrno to | |
| | | * one of these values: \c #XLAL_ENOMEM if a memory allocation failed, | |
| The destroy function does not return any value. If the function is passed | | * \c #XLAL_EBADLEN if an invalid length was provided (for example, a | |
| a | | * zero-size allocation with a create function), \c XLAL_EINVAL if an | |
| \c NULL pointer, it will set \c xlalErrno to \c #XLAL_EFAULT. | | * invalid argument is provided (for example, if the pointer to an | |
| If the function is passed an object that appears corrupted (e.g., a | | * array of dimensions is \c NULL). | |
| vector with zero length or will a \c NULL data pointer) it will set | | * | |
| \c xlalErrno to \c #XLAL_EINVAL. | | * The destroy function does not return any value. If the function is pass | |
| | | ed a | |
| */ | | * \c NULL pointer, it will set \c xlalErrno to \c #XLAL_EFAULT. | |
| | | * If the function is passed an object that appears corrupted (e.g., a | |
| | | * vector with zero length or will a \c NULL data pointer) it will set | |
| | | * \c xlalErrno to \c #XLAL_EINVAL. | |
| | | * | |
| | | */ | |
| /*@{ */ | | /*@{ */ | |
| | | | |
| /** \name Error Codes */ | | /** \name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define AVFACTORIESH_ELENGTH 1 /**< Illegal length. */ | | #define AVFACTORIESH_ELENGTH 1 /**< Illegal length. */ | |
| #define AVFACTORIESH_EVPTR 2 /**< Null vector/array handle. */ | | #define AVFACTORIESH_EVPTR 2 /**< Null vector/array handle. */ | |
| #define AVFACTORIESH_EUPTR 4 /**< Non-null vector/array pointer. */ | | #define AVFACTORIESH_EUPTR 4 /**< Non-null vector/array pointer. */ | |
| #define AVFACTORIESH_EDPTR 8 /**< Null vector/array data. */ | | #define AVFACTORIESH_EDPTR 8 /**< Null vector/array data. */ | |
| #define AVFACTORIESH_EMALLOC 16 /**< Malloc failure. */ | | #define AVFACTORIESH_EMALLOC 16 /**< Malloc failure. */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| skipping to change at line 191 | | skipping to change at line 192 | |
| | | | |
| /** \cond DONT_DOXYGEN */ | | /** \cond DONT_DOXYGEN */ | |
| #define AVFACTORIESH_MSGELENGTH "Illegal length." | | #define AVFACTORIESH_MSGELENGTH "Illegal length." | |
| #define AVFACTORIESH_MSGEVPTR "Null vector/array handle." | | #define AVFACTORIESH_MSGEVPTR "Null vector/array handle." | |
| #define AVFACTORIESH_MSGEUPTR "Non-null vector/array pointer." | | #define AVFACTORIESH_MSGEUPTR "Non-null vector/array pointer." | |
| #define AVFACTORIESH_MSGEDPTR "Null vector/array data." | | #define AVFACTORIESH_MSGEDPTR "Null vector/array data." | |
| #define AVFACTORIESH_MSGEMALLOC "Malloc failure." | | #define AVFACTORIESH_MSGEMALLOC "Malloc failure." | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
| /** | | /** | |
|
| \defgroup ArrayFactories_c Module ArrayFactories.c | | * \defgroup ArrayFactories_c Module ArrayFactories.c | |
| \ingroup AVFactories_h | | * \ingroup AVFactories_h | |
| | | * | |
| \brief Create/destroy \<datatype\>Array objects. | | * \brief Create/destroy \<datatype\>Array objects. | |
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| The \c CreateArray family of functions create a \<datatype\>Array of the ap | | * The \c CreateArray family of functions create a \<datatype\>Array of the | |
| propriate dimensions. | | appropriate dimensions. | |
| | | * | |
| The \c DestroyArray family of functions return the storage allocated by the | | * The \c DestroyArray family of functions return the storage allocated by | |
| \c CreateArray functions to the system. | | the \c CreateArray functions to the system. | |
| | | * | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name INT2 array prototypes */ | | /** \name INT2 array prototypes */ | |
| /*@{*/ | | /*@{*/ | |
| INT2Array * XLALCreateINT2ArrayL ( UINT4, ... ); | | INT2Array * XLALCreateINT2ArrayL ( UINT4, ... ); | |
| INT2Array * XLALCreateINT2ArrayV ( UINT4, UINT4 * ); | | INT2Array * XLALCreateINT2ArrayV ( UINT4, UINT4 * ); | |
| INT2Array * XLALCreateINT2Array ( UINT4Vector * ); | | INT2Array * XLALCreateINT2Array ( UINT4Vector * ); | |
| INT2Array * XLALResizeINT2ArrayL ( INT2Array *, UINT4, ... ); | | INT2Array * XLALResizeINT2ArrayL ( INT2Array *, UINT4, ... ); | |
| INT2Array * XLALResizeINT2ArrayV ( INT2Array *, UINT4, UINT4 * ); | | INT2Array * XLALResizeINT2ArrayV ( INT2Array *, UINT4, UINT4 * ); | |
| INT2Array * XLALResizeINT2Array ( INT2Array *, UINT4Vector * ); | | INT2Array * XLALResizeINT2Array ( INT2Array *, UINT4Vector * ); | |
| | | | |
| skipping to change at line 311 | | skipping to change at line 312 | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \name REAL4 array prototypes (default name) */ | | /** \name REAL4 array prototypes (default name) */ | |
| /*@{*/ | | /*@{*/ | |
| REAL4Array * XLALCreateArrayL ( UINT4, ... ); | | REAL4Array * XLALCreateArrayL ( UINT4, ... ); | |
| REAL4Array * XLALCreateArrayV ( UINT4, UINT4 * ); | | REAL4Array * XLALCreateArrayV ( UINT4, UINT4 * ); | |
| REAL4Array * XLALCreateArray ( UINT4Vector * ); | | REAL4Array * XLALCreateArray ( UINT4Vector * ); | |
| REAL4Array * XLALResizeArrayL ( REAL4Array *, UINT4, ... ); | | REAL4Array * XLALResizeArrayL ( REAL4Array *, UINT4, ... ); | |
| REAL4Array * XLALResizeArrayV ( REAL4Array *, UINT4, UINT4 * ); | | REAL4Array * XLALResizeArrayV ( REAL4Array *, UINT4, UINT4 * ); | |
| REAL4Array * XLALResizeArray ( REAL4Array *, UINT4Vector * ); | | REAL4Array * XLALResizeArray ( REAL4Array *, UINT4Vector * ); | |
|
| | | #ifndef SWIG /* exclude from SWIG interface */ | |
| void XLALDestroyArray ( REAL4Array * ); | | void XLALDestroyArray ( REAL4Array * ); | |
|
| | | #endif /* SWIG */ | |
| void LALCreateArray ( LALStatus *, REAL4Array **, UINT4Vector * ); | | void LALCreateArray ( LALStatus *, REAL4Array **, UINT4Vector * ); | |
| void LALResizeArray ( LALStatus *, REAL4Array **, UINT4Vector * ); | | void LALResizeArray ( LALStatus *, REAL4Array **, UINT4Vector * ); | |
| void LALDestroyArray ( LALStatus *, REAL4Array ** ); | | void LALDestroyArray ( LALStatus *, REAL4Array ** ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \name REAL8 array prototypes */ | | /** \name REAL8 array prototypes */ | |
| /*@{*/ | | /*@{*/ | |
| REAL8Array * XLALCreateREAL8ArrayL ( UINT4, ... ); | | REAL8Array * XLALCreateREAL8ArrayL ( UINT4, ... ); | |
| REAL8Array * XLALCreateREAL8ArrayV ( UINT4, UINT4 * ); | | REAL8Array * XLALCreateREAL8ArrayV ( UINT4, UINT4 * ); | |
| REAL8Array * XLALCreateREAL8Array ( UINT4Vector * ); | | REAL8Array * XLALCreateREAL8Array ( UINT4Vector * ); | |
| | | | |
| skipping to change at line 362 | | skipping to change at line 365 | |
| COMPLEX16Array * XLALResizeCOMPLEX16Array ( COMPLEX16Array *, UINT4Vector *
); | | COMPLEX16Array * XLALResizeCOMPLEX16Array ( COMPLEX16Array *, UINT4Vector *
); | |
| void XLALDestroyCOMPLEX16Array ( COMPLEX16Array * ); | | void XLALDestroyCOMPLEX16Array ( COMPLEX16Array * ); | |
| void LALZCreateArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * ); | | void LALZCreateArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * ); | |
| void LALZResizeArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * ); | | void LALZResizeArray ( LALStatus *, COMPLEX16Array **, UINT4Vector * ); | |
| void LALZDestroyArray ( LALStatus *, COMPLEX16Array ** ); | | void LALZDestroyArray ( LALStatus *, COMPLEX16Array ** ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| /* ---------- end: ArrayFactories_c ---------- */ | | /* ---------- end: ArrayFactories_c ---------- */ | |
| | | | |
|
| /** \defgroup VectorFactories_c Module VectorFactories.c | | /** | |
| \ingroup AVFactories_h | | * \defgroup VectorFactories_c Module VectorFactories.c | |
| | | * \ingroup AVFactories_h | |
| \brief Create/destroy \<datatype\>%Vector objects. | | * | |
| | | * \brief Create/destroy \<datatype\>%Vector objects. | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| The \c CreateVector family of functions create a \<datatype\>%Vector of the | | * | |
| appropriate dimensions. | | * The \c CreateVector family of functions create a \<datatype\>%Vector of | |
| | | the appropriate dimensions. | |
| The \c ResizeVector family of functions changes the amount of storage alloc | | * | |
| ated by the \c CreateVector functions. | | * The \c ResizeVector family of functions changes the amount of storage al | |
| | | located by the \c CreateVector functions. | |
| The \c DestroyVector family of functions return the storage allocated by th | | * | |
| e \c CreateVector functions to the system. | | * The \c DestroyVector family of functions return the storage allocated by | |
| | | the \c CreateVector functions to the system. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name CHAR vector prototypes */ | | /** \name CHAR vector prototypes */ | |
| /*@{*/ | | /*@{*/ | |
| CHARVector * XLALCreateCHARVector ( UINT4 length ); | | CHARVector * XLALCreateCHARVector ( UINT4 length ); | |
| CHARVector * XLALResizeCHARVector ( CHARVector * vector, UINT4 length ); | | CHARVector * XLALResizeCHARVector ( CHARVector * vector, UINT4 length ); | |
| void XLALDestroyCHARVector ( CHARVector * vector ); | | void XLALDestroyCHARVector ( CHARVector * vector ); | |
| void LALCHARCreateVector ( LALStatus *, CHARVector **, UINT4 ); | | void LALCHARCreateVector ( LALStatus *, CHARVector **, UINT4 ); | |
| void LALCHARResizeVector ( LALStatus *, CHARVector **, UINT4 ); | | void LALCHARResizeVector ( LALStatus *, CHARVector **, UINT4 ); | |
| void LALCHARDestroyVector ( LALStatus *, CHARVector ** ); | | void LALCHARDestroyVector ( LALStatus *, CHARVector ** ); | |
| | | | |
| skipping to change at line 462 | | skipping to change at line 466 | |
| void XLALDestroyREAL4Vector ( REAL4Vector * vector ); | | void XLALDestroyREAL4Vector ( REAL4Vector * vector ); | |
| void LALSCreateVector ( LALStatus *, REAL4Vector **, UINT4 ); | | void LALSCreateVector ( LALStatus *, REAL4Vector **, UINT4 ); | |
| void LALSResizeVector ( LALStatus *, REAL4Vector **, UINT4 ); | | void LALSResizeVector ( LALStatus *, REAL4Vector **, UINT4 ); | |
| void LALSDestroyVector ( LALStatus *, REAL4Vector ** ); | | void LALSDestroyVector ( LALStatus *, REAL4Vector ** ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \name REAL4 vector prototypes (default name) */ | | /** \name REAL4 vector prototypes (default name) */ | |
| /*@{*/ | | /*@{*/ | |
| REAL4Vector * XLALCreateVector ( UINT4 length ); | | REAL4Vector * XLALCreateVector ( UINT4 length ); | |
| REAL4Vector * XLALResizeVector ( REAL4Vector * vector, UINT4 length ); | | REAL4Vector * XLALResizeVector ( REAL4Vector * vector, UINT4 length ); | |
|
| | | #ifndef SWIG /* exclude from SWIG interface */ | |
| void XLALDestroyVector ( REAL4Vector * vector ); | | void XLALDestroyVector ( REAL4Vector * vector ); | |
|
| | | #endif /* SWIG */ | |
| void LALCreateVector ( LALStatus *, REAL4Vector **, UINT4 ); | | void LALCreateVector ( LALStatus *, REAL4Vector **, UINT4 ); | |
| void LALResizeVector ( LALStatus *, REAL4Vector **, UINT4 ); | | void LALResizeVector ( LALStatus *, REAL4Vector **, UINT4 ); | |
| void LALDestroyVector ( LALStatus *, REAL4Vector ** ); | | void LALDestroyVector ( LALStatus *, REAL4Vector ** ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \name REAL8 vector prototypes */ | | /** \name REAL8 vector prototypes */ | |
| /*@{*/ | | /*@{*/ | |
| REAL8Vector * XLALCreateREAL8Vector ( UINT4 length ); | | REAL8Vector * XLALCreateREAL8Vector ( UINT4 length ); | |
| REAL8Vector * XLALResizeREAL8Vector ( REAL8Vector * vector, UINT4 length ); | | REAL8Vector * XLALResizeREAL8Vector ( REAL8Vector * vector, UINT4 length ); | |
| void XLALDestroyREAL8Vector ( REAL8Vector * vector ); | | void XLALDestroyREAL8Vector ( REAL8Vector * vector ); | |
| | | | |
End of changes. 7 change blocks. |
| 195 lines changed or deleted | | 205 lines changed or added | |
|
| CoarseGrainFrequencySeries.h | | CoarseGrainFrequencySeries.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| #include <lal/LALStdlib.h> | | #include <lal/LALStdlib.h> | |
| | | | |
| #ifndef _COARSEGRAINFREQUENCYSERIES_H | | #ifndef _COARSEGRAINFREQUENCYSERIES_H | |
| #define _COARSEGRAINFREQUENCYSERIES_H | | #define _COARSEGRAINFREQUENCYSERIES_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup CoarseGrainFrequencySeries_h | | * \addtogroup CoarseGrainFrequencySeries_h | |
| \author UTB Relativity Group; contact whelan@phys.utb.edu (original by S | | * \author UTB Relativity Group; contact whelan@phys.utb.edu (original by S | |
| . Drasco) | | . Drasco) | |
| | | * | |
| \brief Provides prototype, structure and error code information for rout | | * \brief Provides prototype, structure and error code information for rout | |
| ines which coarse-grain a frequency series. | | ines which coarse-grain a frequency series. | |
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/CoarseGrainFrequencySeries.h> | | * \code | |
| \endcode | | * #include <lal/CoarseGrainFrequencySeries.h> | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions are designed to facilitate approximation of integrals | | * | |
| such as | | * These functions are designed to facilitate approximation of integrals | |
| \f[ | | * such as | |
| \int g(f)\,h(f)\,df | | * \f[ | |
| \f] | | * \int g(f)\,h(f)\,df | |
| when \f$g(f)\f$ and \f$h(f)\f$ are sampled with different frequency | | * \f] | |
| resolutions. If the frequency resolution were the same for both | | * when \f$g(f)\f$ and \f$h(f)\f$ are sampled with different frequency | |
| functions, e.g., a frequency spacing of \f$\delta f\f$ and a start | | * resolutions. If the frequency resolution were the same for both | |
| frequency of \f$f_0\f$, so that the \f$k\f$th element corresponded to a | | * functions, e.g., a frequency spacing of \f$\delta f\f$ and a start | |
| frequency \f$f_k = f_0 + k\delta f\f$, the approximation would be defined | | * frequency of \f$f_0\f$, so that the \f$k\f$th element corresponded to a | |
| as | | * frequency \f$f_k = f_0 + k\delta f\f$, the approximation would be define | |
| \f[ | | d | |
| \int g(f)\,h(f)\,df \approx \delta f \sum_k g_k h_k | | * as | |
| \f] | | * \f[ | |
| whose contribution from the \f$k\f$th element is [It is | | * \int g(f)\,h(f)\,df \approx \delta f \sum_k g_k h_k | |
| important to make the limits of integration symmetric about \f$f_k\f$ to | | * \f] | |
| maintain reality conditions when dealing with Fourier transforms of | | * whose contribution from the \f$k\f$th element is [It is | |
| real quantities.] | | * important to make the limits of integration symmetric about \f$f_k\f$ to | |
| \f[ | | * maintain reality conditions when dealing with Fourier transforms of | |
| \int_{f_k-\delta f/2}^{f_k+\delta f/2} g(f)\,h(f)\,df \approx | | * real quantities.] | |
| \delta f g_k h_k | | * \f[ | |
| \ . | | * \int_{f_k-\delta f/2}^{f_k+\delta f/2} g(f)\,h(f)\,df \approx | |
| \f] | | * \delta f g_k h_k | |
| The central idea in our definitions of coarse graining will thus be | | * \ . | |
| the correspondence | | * \f] | |
| \anchor utilities_e_coarse \f{equation}{ | | * The central idea in our definitions of coarse graining will thus be | |
| \label{utilities_e_coarse} | | * the correspondence | |
| h_k \approx \frac{1}{\delta f} | | * \f{equation}{ | |
| \int_{f_k-\delta f/2}^{f_k+\delta f/2} h(f)\,df | | * \label{utilities_e_coarse} | |
| \f} | | * h_k \approx \frac{1}{\delta f} | |
| | | * \int_{f_k-\delta f/2}^{f_k+\delta f/2} h(f)\,df | |
| The purpose of this function is to obtain a frequency series \f$\{h_k\}\f$ | | * \f} | |
| with start frequency \f$f_0\f$ and frequency spacing \f$\delta f\f$ from a | | * | |
| finer-grained frequency series \f$\{h'_\ell\}\f$ with start frequency | | * The purpose of this function is to obtain a frequency series \f$\{h_k\}\ | |
| \f$f'_0\f$ and frequency spacing \f$\delta f'\f$. Focussing on the \f$k\f$ | | f$ | |
| th | | * with start frequency \f$f_0\f$ and frequency spacing \f$\delta f\f$ from | |
| element of the coarse-grained series, which represents a frequency | | a | |
| range from \f$f_k-\delta f/2\f$ to \f$f_k+\delta f/2\f$, we consider the | | * finer-grained frequency series \f$\{h'_\ell\}\f$ with start frequency | |
| elements of the fine-grained series whose frequency ranges overlap | | * \f$f'_0\f$ and frequency spacing \f$\delta f'\f$. Focussing on the \f$k | |
| with this. (Fig.\figref{utilities_f_coarse} | | \f$th | |
| | | * element of the coarse-grained series, which represents a frequency | |
| \floatfig{htbp,utilities_f_coarse} | | * range from \f$f_k-\delta f/2\f$ to \f$f_k+\delta f/2\f$, we consider the | |
| \image html utilitiesCoarseGrain.png "Fig. [utilities_f_coarse]: Coarse gr | | * elements of the fine-grained series whose frequency ranges overlap | |
| aining a frequency series" | | * with this (\figref{utilitiesCoarseGrain}). | |
| \image latex utilitiesCoarseGrain.pdf "Coarse graining a frequency series" | | * | |
| | | * \figure{utilitiesCoarseGrain,pdf,0.6,Coarse graining a frequency series} | |
| We define \f$\ell^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptstyle | | * | |
| {\rm min}}_k\f$ | | * We define \f$\ell^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptst | |
| to be the indices of the first and last elements of | | yle{\rm min}}_k\f$ | |
| \f$h'_\ell\f$ which overlap \e completely with the frequency range | | * to be the indices of the first and last elements of | |
| corresponding to \f$h_k\f$. These are most easily defined in terms of | | * \f$h'_\ell\f$ which overlap \e completely with the frequency range | |
| non-integer indices \f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and | | * corresponding to \f$h_k\f$. These are most easily defined in terms of | |
| \f$\lambda^{\scriptstyle\textrm{max}}_k\f$ which correspond to the location | | * non-integer indices \f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and | |
| s | | * \f$\lambda^{\scriptstyle\textrm{max}}_k\f$ which correspond to the locat | |
| of fine-grained elements which would exactly reach the edges of the | | ions | |
| coarse-grained element with index \f$k\f$. These are defined by | | * of fine-grained elements which would exactly reach the edges of the | |
| \f{eqnarray*}{ | | * coarse-grained element with index \f$k\f$. These are defined by | |
| f_0 + \left(k-\frac{1}{2}\right) \delta f | | * \f{eqnarray}{ | |
| &=& f'_0 + \left(\lambda^{\scriptstyle\textrm{min}}_k-\frac{1}{2}\right) | | * f_0 + \left(k-\frac{1}{2}\right) \delta f | |
| \delta f' \\ | | * &=& f'_0 + \left(\lambda^{\scriptstyle\textrm{min}}_k-\frac{1}{2}\right) | |
| f_0 + \left(k+\frac{1}{2}\right) \delta f | | * \delta f' \\ | |
| &=& f'_0 + \left(\lambda^{\scriptstyle\textrm{max}}_k+\frac{1}{2}\right) | | * f_0 + \left(k+\frac{1}{2}\right) \delta f | |
| \delta f' | | * &=& f'_0 + \left(\lambda^{\scriptstyle\textrm{max}}_k+\frac{1}{2}\right) | |
| \f} | | * \delta f' | |
| or, defining the offset \f$\Omega=(f_0-f'_0)/\delta f'\f$ and the coarse | | * \f} | |
| graining ratio \f$\rho = \delta f / \delta f'\f$, | | * or, defining the offset \f$\Omega=(f_0-f'_0)/\delta f'\f$ and the coarse | |
| \f{eqnarray*}{ | | * graining ratio \f$\rho = \delta f / \delta f'\f$, | |
| \lambda^{\scriptstyle\textrm{min}}_k &=& | | * \f{eqnarray}{ | |
| \Omega + \left(k-\frac{1}{2}\right) \rho + \frac{1}{2}\\ | | * \lambda^{\scriptstyle\textrm{min}}_k &=& | |
| \lambda^{\scriptstyle\textrm{max}}_k &=& | | * \Omega + \left(k-\frac{1}{2}\right) \rho + \frac{1}{2}\\ | |
| \Omega + \left(k+\frac{1}{2}\right) \rho - \frac{1}{2} | | * \lambda^{\scriptstyle\textrm{max}}_k &=& | |
| \ . | | * \Omega + \left(k+\frac{1}{2}\right) \rho - \frac{1}{2} | |
| \f} | | * \ . | |
| Examination of Fig.\figref{utilities_f_coarse} shows that | | * \f} | |
| \f$\ell^{\scriptstyle\textrm{min}}_k\f$ is the smallest integer not less th | | * Examination of \figref{utilitiesCoarseGrain} shows that | |
| an | | * \f$\ell^{\scriptstyle\textrm{min}}_k\f$ is the smallest integer not less | |
| \f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptstyle{\rm | | than | |
| min}}_k\f$ is the largest integer not greater than | | * \f$\lambda^{\scriptstyle\textrm{min}}_k\f$ and \f$\ell^{\scriptstyle{\rm | |
| \f$\lambda^{\scriptstyle\textrm{min}}_k\f$. | | * min}}_k\f$ is the largest integer not greater than | |
| | | * \f$\lambda^{\scriptstyle\textrm{min}}_k\f$. | |
| With these definitions, approximating the integral in | | * | |
| \eqref{utilities_e_coarse} gives | | * With these definitions, approximating the integral in | |
| \anchor utilities_e_coarseapprox \f{equation}{\label{utilities_e_coarseappr | | * \eqref{utilities_e_coarse} gives | |
| ox} | | * \f{equation}{ | |
| h_k = \frac{1}{\rho} | | * \label{utilities_e_coarseapprox} | |
| \left( | | * h_k = \frac{1}{\rho} | |
| (\ell^{\scriptstyle\textrm{min}}_k - \lambda^{\scriptstyle\textrm{min}}_k | | * \left( | |
| ) | | * (\ell^{\scriptstyle\textrm{min}}_k - \lambda^{\scriptstyle\textrm{min}}_ | |
| h'_{\ell^{\scriptscriptstyle\textrm{min}}_k-1} | | k) | |
| + \sum_{\ell=\ell^{\scriptscriptstyle\textrm{min}}_k} | | * h'_{\ell^{\scriptscriptstyle\textrm{min}}_k-1} | |
| ^{\ell^{\scriptscriptstyle\textrm{max}}_k} | | * + \sum_{\ell=\ell^{\scriptscriptstyle\textrm{min}}_k} | |
| h'_\ell | | * ^{\ell^{\scriptscriptstyle\textrm{max}}_k} | |
| + (\lambda^{\scriptstyle\textrm{max}}_k - \ell^{\scriptstyle\textrm{max}} | | * h'_\ell | |
| _k) | | * + (\lambda^{\scriptstyle\textrm{max}}_k - \ell^{\scriptstyle\textrm{max} | |
| h'_{\ell^{\scriptscriptstyle\textrm{max}}_k+1} | | }_k) | |
| \right) | | * h'_{\ell^{\scriptscriptstyle\textrm{max}}_k+1} | |
| \f} | | * \right) | |
| | | * \f} | |
| In the special case \f$f_0=f'_0\f$, we assume both frequency series | | * | |
| represent the independent parts of larger frequency series | | * In the special case \f$f_0=f'_0\f$, we assume both frequency series | |
| \f$\{h_k|k=-(N-1)\ldots(N-1)\}\f$ and \f$\{h'_\ell|\ell=-(N-1)\ldots(N-1)\} | | * represent the independent parts of larger frequency series | |
| \f$ | | * \f$\{h_k|k=-(N-1)\ldots(N-1)\}\f$ and \f$\{h'_\ell|\ell=-(N-1)\ldots(N-1 | |
| which obey \f$h_{-k}=h_k^*\f$ and \f$h'_{-\ell}{}=h'_\ell{}^*\f$ (e.g., | | )\}\f$ | |
| fourier transforms of real data). In that case, the DC element of the | | * which obey \f$h_{-k}=h_k^*\f$ and \f$h'_{-\ell}{}=h'_\ell{}^*\f$ (e.g., | |
| coarse-grained series can be built out of both positive- and implied | | * fourier transforms of real data). In that case, the DC element of the | |
| negative-frequency elements in the fine-grained series. | | * coarse-grained series can be built out of both positive- and implied | |
| \f{equation}{ | | * negative-frequency elements in the fine-grained series. | |
| h_0 = \frac{1}{\rho} | | * \f{equation}{ | |
| \left[ | | * h_0 = \frac{1}{\rho} | |
| h'_0 | | * \left[ | |
| + 2\ \mathrm{Re} | | * h'_0 | |
| \left( | | * + 2\ \mathrm{Re} | |
| \sum_{\ell=1}^{\ell^{\scriptscriptstyle\textrm{max}}_0} | | * \left( | |
| h'_\ell | | * \sum_{\ell=1}^{\ell^{\scriptscriptstyle\textrm{max}}_0} | |
| + (\lambda^{\scriptstyle\textrm{max}}_0 - \ell^{\scriptstyle\textrm{m | | * h'_\ell | |
| ax}}_0) | | * + (\lambda^{\scriptstyle\textrm{max}}_0 - \ell^{\scriptstyle\textrm{max} | |
| h'_{\ell^{\scriptscriptstyle\textrm{max}}_0+1} | | }_0) | |
| \right) | | * h'_{\ell^{\scriptscriptstyle\textrm{max}}_0+1} | |
| \right] | | * \right) | |
| \f} | | * \right] | |
| | | * \f} | |
| \heading{Algorithm} | | * | |
| | | * ### Algorithm ### | |
| These routines move through the output series, using | | * | |
| \eqref{utilities_e_coarseapprox} to add up the contributions from the | | * These routines move through the output series, using | |
| bins in the fine-grained series. | | * \eqref{utilities_e_coarseapprox} to add up the contributions from the | |
| | | * bins in the fine-grained series. | |
| \heading{Notes} | | * | |
| <ul> | | * ### Notes ### | |
| <li> The coarse graining ratio must obey \f$\rho\ge 1\f$ (so the | | * | |
| coarse-grained frequency spacing must be less than the fine-grained | | * <ul> | |
| one). Additionally, the bins in the fine-grained frequency series | | * <li> The coarse graining ratio must obey \f$\rho\ge 1\f$ (so the | |
| must \e completely overlap those in the coarse-grained frequency | | * coarse-grained frequency spacing must be less than the fine-grained | |
| series. In particular, since the lowest frequency in the first bin | | * one). Additionally, the bins in the fine-grained frequency series | |
| of the coarse-grained series is \f$f_{\scriptstyle{\rm min}}=f_0-\delta f | | * must \e completely overlap those in the coarse-grained frequency | |
| /2\f$ | | * series. In particular, since the lowest frequency in the first bin | |
| and the last is \f$f_{\scriptstyle{\rm max}}=f_0 + (N-1) \delta f +\delta | | * of the coarse-grained series is \f$f_{\scriptstyle{\rm min}}=f_0-\delta | |
| f/2\f$ | | f/2\f$ | |
| (taking into account the width of the bins), the conitions are | | * and the last is \f$f_{\scriptstyle{\rm max}}=f_0 + (N-1) \delta f +\delt | |
| \f{eqnarray*}{ | | a f/2\f$ | |
| f_0 - \frac{\delta f}{2} &\ge& f'_0 - \frac{\delta f'}{2}\\ | | * (taking into account the width of the bins), the conitions are | |
| f_0 + \left(N-\frac{1}{2}\right)\,\delta f &\le& | | * \f{eqnarray}{ | |
| f'_0 + \left(N'-\frac{1}{2}\right)\,\delta f' | | * f_0 - \frac{\delta f}{2} &\ge& f'_0 - \frac{\delta f'}{2}\\ | |
| \f} | | * f_0 + \left(N-\frac{1}{2}\right)\,\delta f &\le& | |
| (The special case \f$f_0=f'_0=0\f$ is an | | * f'_0 + \left(N'-\frac{1}{2}\right)\,\delta f' | |
| exception to the condition on the minimum frequency.)</li> | | * \f} | |
| <li> The routines return an error if either minimum frequency | | * (The special case \f$f_0=f'_0=0\f$ is an | |
| (\f$f_{\scriptstyle\textrm{min}}\f$ or \f$f'_{\scriptstyle\textrm{min}}\f | | * exception to the condition on the minimum frequency.)</li> | |
| $) is | | * <li> The routines return an error if either minimum frequency | |
| negative (unless \f$f_0=0\f$ or \f$f'_0=0\f$, respectively).</li> | | * (\f$f_{\scriptstyle\textrm{min}}\f$ or \f$f'_{\scriptstyle\textrm{min}}\ | |
| </ul> | | f$) is | |
| | | * negative (unless \f$f_0=0\f$ or \f$f'_0=0\f$, respectively).</li> | |
| */ | | * </ul> | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /**\name Error Codes */ | | /**\name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define COARSEGRAINFREQUENCYSERIESH_ENULLPTR 1 /**< Null po
inter */ | | #define COARSEGRAINFREQUENCYSERIESH_ENULLPTR 1 /**< Null po
inter */ | |
| #define COARSEGRAINFREQUENCYSERIESH_ESAMEPTR 2 /**< Input a
nd Output pointers the same */ | | #define COARSEGRAINFREQUENCYSERIESH_ESAMEPTR 2 /**< Input a
nd Output pointers the same */ | |
| #define COARSEGRAINFREQUENCYSERIESH_EZEROLEN 3 /**< Zero le
ngth for data member of series */ | | #define COARSEGRAINFREQUENCYSERIESH_EZEROLEN 3 /**< Zero le
ngth for data member of series */ | |
| #define COARSEGRAINFREQUENCYSERIESH_ENONPOSDELTAF 4 /**< Negativ
e or zero frequency spacing */ | | #define COARSEGRAINFREQUENCYSERIESH_ENONPOSDELTAF 4 /**< Negativ
e or zero frequency spacing */ | |
| #define COARSEGRAINFREQUENCYSERIESH_ENEGFMIN 5 /**< Negativ
e start frequency */ | | #define COARSEGRAINFREQUENCYSERIESH_ENEGFMIN 5 /**< Negativ
e start frequency */ | |
| #define COARSEGRAINFREQUENCYSERIESH_EMMHETERO 7 /**< Mismatc
h in heterodyning frequencies */ | | #define COARSEGRAINFREQUENCYSERIESH_EMMHETERO 7 /**< Mismatc
h in heterodyning frequencies */ | |
| | | | |
End of changes. 1 change blocks. |
| 167 lines changed or deleted | | 169 lines changed or added | |
|
| ComplexFFT.h | | ComplexFFT.h | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * \addtogroup ComplexFFT_h | | * \addtogroup ComplexFFT_h | |
| * | | * | |
| * \brief Performs complex-to-complex FFTs. | | * \brief Performs complex-to-complex FFTs. | |
| * | | * | |
|
| * \heading{Synopsis} | | * ### Synopsis ### | |
| | | * | |
| * \code | | * \code | |
| * #include <lal/ComplexFFT.h> | | * #include <lal/ComplexFFT.h> | |
| * \endcode | | * \endcode | |
| * | | * | |
| * Perform complex-to-complex fast Fourier transforms of vectors using the | | * Perform complex-to-complex fast Fourier transforms of vectors using the | |
|
| * package FFTW [\ref fj_1998]. | | * package FFTW \cite fj_1998. | |
| * | | * | |
|
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name Error Codes */ | | /** \name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define COMPLEXFFTH_ENULL 1 /**< Null pointer */ | | #define COMPLEXFFTH_ENULL 1 /**< Null pointer */ | |
| #define COMPLEXFFTH_ENNUL 2 /**< Non-null pointer */ | | #define COMPLEXFFTH_ENNUL 2 /**< Non-null pointer */ | |
| #define COMPLEXFFTH_ESIZE 4 /**< Invalid input size */ | | #define COMPLEXFFTH_ESIZE 4 /**< Invalid input size */ | |
| #define COMPLEXFFTH_ESZMM 8 /**< Size mismatch */ | | #define COMPLEXFFTH_ESZMM 8 /**< Size mismatch */ | |
| #define COMPLEXFFTH_ESLEN 16 /**< Invalid/mismatched sequence lengths */ | | #define COMPLEXFFTH_ESLEN 16 /**< Invalid/mismatched sequence lengths */ | |
| #define COMPLEXFFTH_ESAME 32 /**< Input/Output data vectors are the same
*/ | | #define COMPLEXFFTH_ESAME 32 /**< Input/Output data vectors are the same
*/ | |
| | | | |
| skipping to change at line 90 | | skipping to change at line 91 | |
| typedef struct tagCOMPLEX16FFTPlan COMPLEX16FFTPlan; | | typedef struct tagCOMPLEX16FFTPlan COMPLEX16FFTPlan; | |
| #define tagComplexFFTPlan tagCOMPLEX8FFTPlan | | #define tagComplexFFTPlan tagCOMPLEX8FFTPlan | |
| #define ComplexFFTPlan COMPLEX8FFTPlan | | #define ComplexFFTPlan COMPLEX8FFTPlan | |
| | | | |
| /* | | /* | |
| * | | * | |
| * XLAL COMPLEX8 functions | | * XLAL COMPLEX8 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** Returns a new COMPLEX8FFTPlan | | /** | |
| * | | * Returns a new COMPLEX8FFTPlan | |
| * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat
a. | | * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat
a. | |
| * A different plan is required for each size of the complex data vectors | | * A different plan is required for each size of the complex data vectors | |
| * and for each direction of transform (forward or reverse). | | * and for each direction of transform (forward or reverse). | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | | * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | |
| * where N, the size of the transform, is the length of the vectors z and Z
. | | * where N, the size of the transform, is the length of the vectors z and Z
. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | | * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | |
| * where N, the size of the transform, is the length of the vectors w and W
. | | * where N, the size of the transform, is the length of the vectors w and W
. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a "reverse" | | * equal to N times the original data (we therefore call it a "reverse" | |
| * transform rather than an "inverse" transform). | | * transform rather than an "inverse" transform). | |
| * | | * | |
| * @param[in] size The number of points in the complex data. | | * @param[in] size The number of points in the complex data. | |
| * @param[in] fwdflg Set non-zero for a forward FFT plan; | | * @param[in] fwdflg Set non-zero for a forward FFT plan; | |
|
| * otherwise create a reverse plan | | * otherwise create a reverse plan | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return
ed | | * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return
ed | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateCOMPLEX8Plan() function shall fail if: | | * The \c XLALCreateCOMPLEX8Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| COMPLEX8FFTPlan * XLALCreateCOMPLEX8FFTPlan( UINT4 size, int fwdflg, int me
asurelvl ); | | COMPLEX8FFTPlan * XLALCreateCOMPLEX8FFTPlan( UINT4 size, int fwdflg, int me
asurelvl ); | |
| | | | |
|
| /** Returns a new COMPLEX8FFTPlan for a forward transform | | /** | |
| | | * Returns a new COMPLEX8FFTPlan for a forward transform | |
| * | | * | |
| * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat
a. | | * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat
a. | |
| * A different plan is required for each size of the complex data vectors. | | * A different plan is required for each size of the complex data vectors. | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | | * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | |
| * where N, the size of the transform, is the length of the vector z and Z. | | * where N, the size of the transform, is the length of the vector z and Z. | |
| * | | * | |
| * @param[in] size The number of points in the complex data. | | * @param[in] size The number of points in the complex data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return
ed | | * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return
ed | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateForwardCOMPLEX8Plan() function shall fail if: | | * The \c XLALCreateForwardCOMPLEX8Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| COMPLEX8FFTPlan * XLALCreateForwardCOMPLEX8FFTPlan( UINT4 size, int measure
lvl ); | | COMPLEX8FFTPlan * XLALCreateForwardCOMPLEX8FFTPlan( UINT4 size, int measure
lvl ); | |
| | | | |
|
| /** Returns a new COMPLEX8FFTPlan for a reverse transform | | /** | |
| | | * Returns a new COMPLEX8FFTPlan for a reverse transform | |
| * | | * | |
| * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat
a. | | * A COMPLEX8FFTPlan is required to perform a FFT that involves complex dat
a. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | | * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | |
| * where N, the size of the transform, is the length of the vectors w and W
. | | * where N, the size of the transform, is the length of the vectors w and W
. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a "reverse" | | * equal to N times the original data (we therefore call it a "reverse" | |
| * transform rather than an "inverse" transform). | | * transform rather than an "inverse" transform). | |
| * | | * | |
| * @param[in] size The number of points in the complex data. | | * @param[in] size The number of points in the complex data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return
ed | | * @return A pointer to an allocated \c COMPLEX8FFTPlan structure is return
ed | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateReverseCOMPLEX8Plan() function shall fail if: | | * The \c XLALCreateReverseCOMPLEX8Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| COMPLEX8FFTPlan * XLALCreateReverseCOMPLEX8FFTPlan( UINT4 size, int measure
lvl ); | | COMPLEX8FFTPlan * XLALCreateReverseCOMPLEX8FFTPlan( UINT4 size, int measure
lvl ); | |
| | | | |
|
| /** Destroys a COMPLEX8FFTPlan | | /** | |
| | | * Destroys a COMPLEX8FFTPlan | |
| * @param[in] plan A pointer to the COMPLEX8FFTPlan to be destroyed. | | * @param[in] plan A pointer to the COMPLEX8FFTPlan to be destroyed. | |
| * @return None. | | * @return None. | |
| */ | | */ | |
| void XLALDestroyCOMPLEX8FFTPlan( COMPLEX8FFTPlan *plan ); | | void XLALDestroyCOMPLEX8FFTPlan( COMPLEX8FFTPlan *plan ); | |
| | | | |
|
| /** Perform a COMPLEX8Vector to COMPLEX8Vector FFT | | /** | |
| | | * Perform a COMPLEX8Vector to COMPLEX8Vector FFT | |
| * | | * | |
| * This routine computes | | * This routine computes | |
| * \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f] | | * \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f] | |
| * and where the minus sign is used if a forward plan is provided as the ar
gument | | * and where the minus sign is used if a forward plan is provided as the ar
gument | |
| * and the plus sign is used if a reverse plan is provided as the argument; | | * and the plus sign is used if a reverse plan is provided as the argument; | |
| * here N is the length of the input and output vectors z and Z. | | * here N is the length of the input and output vectors z and Z. | |
| * | | * | |
| * @param[out] output The complex output data vector Z of length N | | * @param[out] output The complex output data vector Z of length N | |
| * @param[in] input The input complex data vector z of length N | | * @param[in] input The input complex data vector z of length N | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @note | | * @note | |
| * The input and output vectors must be distinct. | | * The input and output vectors must be distinct. | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCOMPLEX8VectorFFT() function shall fail if: | | * The \c XLALCOMPLEX8VectorFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the input and output data | | * - [\c XLAL_EINVAL] A argument is invalid or the input and output data | |
| * vectors are the same. | | * vectors are the same. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
|
| int XLALCOMPLEX8VectorFFT( COMPLEX8Vector * restrict output, COMPLEX8Vector
* restrict input, | | int XLALCOMPLEX8VectorFFT( COMPLEX8Vector * _LAL_RESTRICT_ output, const CO
MPLEX8Vector * _LAL_RESTRICT_ input, | |
| const COMPLEX8FFTPlan *plan ); | | const COMPLEX8FFTPlan *plan ); | |
| | | | |
| /* | | /* | |
| * | | * | |
| * XLAL COMPLEX16 functions | | * XLAL COMPLEX16 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** Returns a new COMPLEX16FFTPlan | | /** | |
| | | * Returns a new COMPLEX16FFTPlan | |
| * | | * | |
| * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da
ta. | | * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da
ta. | |
| * A different plan is required for each size of the complex data vectors | | * A different plan is required for each size of the complex data vectors | |
| * and for each direction of transform (forward or reverse). | | * and for each direction of transform (forward or reverse). | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | | * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | |
| * where N, the size of the transform, is the length of the vectors z and Z
. | | * where N, the size of the transform, is the length of the vectors z and Z
. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | | * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | |
| * where N, the size of the transform, is the length of the vectors w and W
. | | * where N, the size of the transform, is the length of the vectors w and W
. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a "reverse" | | * equal to N times the original data (we therefore call it a "reverse" | |
| * transform rather than an "inverse" transform). | | * transform rather than an "inverse" transform). | |
| * | | * | |
| * @param[in] size The number of points in the complex data. | | * @param[in] size The number of points in the complex data. | |
| * @param[in] fwdflg Set non-zero for a forward FFT plan; | | * @param[in] fwdflg Set non-zero for a forward FFT plan; | |
|
| * otherwise create a reverse plan | | * otherwise create a reverse plan | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur
ned | | * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur
ned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateCOMPLEX16Plan() function shall fail if: | | * The \c XLALCreateCOMPLEX16Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| COMPLEX16FFTPlan * XLALCreateCOMPLEX16FFTPlan( UINT4 size, int fwdflg, int
measurelvl ); | | COMPLEX16FFTPlan * XLALCreateCOMPLEX16FFTPlan( UINT4 size, int fwdflg, int
measurelvl ); | |
| | | | |
|
| /** Returns a new COMPLEX16FFTPlan for a forward transform | | /** | |
| | | * Returns a new COMPLEX16FFTPlan for a forward transform | |
| * | | * | |
| * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da
ta. | | * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da
ta. | |
| * A different plan is required for each size of the complex data vectors. | | * A different plan is required for each size of the complex data vectors. | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | | * \f[Z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,z[j]\f] | |
| * where N, the size of the transform, is the length of the vector z and Z. | | * where N, the size of the transform, is the length of the vector z and Z. | |
| * | | * | |
| * @param[in] size The number of points in the complex data. | | * @param[in] size The number of points in the complex data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur
ned | | * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur
ned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateForwardCOMPLEX16Plan() function shall fail if: | | * The \c XLALCreateForwardCOMPLEX16Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| COMPLEX16FFTPlan * XLALCreateForwardCOMPLEX16FFTPlan( UINT4 size, int measu
relvl ); | | COMPLEX16FFTPlan * XLALCreateForwardCOMPLEX16FFTPlan( UINT4 size, int measu
relvl ); | |
| | | | |
|
| /** Returns a new COMPLEX16FFTPlan for a reverse transform | | /** | |
| | | * Returns a new COMPLEX16FFTPlan for a reverse transform | |
| * | | * | |
| * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da
ta. | | * A COMPLEX16FFTPlan is required to perform a FFT that involves complex da
ta. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | | * \f[w[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,W[k]\f] | |
| * where N, the size of the transform, is the length of the vectors w and W
. | | * where N, the size of the transform, is the length of the vectors w and W
. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a "reverse" | | * equal to N times the original data (we therefore call it a "reverse" | |
| * transform rather than an "inverse" transform). | | * transform rather than an "inverse" transform). | |
| * | | * | |
| * @param[in] size The number of points in the complex data. | | * @param[in] size The number of points in the complex data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur
ned | | * @return A pointer to an allocated \c COMPLEX16FFTPlan structure is retur
ned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateReverseCOMPLEX16Plan() function shall fail if: | | * The \c XLALCreateReverseCOMPLEX16Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| COMPLEX16FFTPlan * XLALCreateReverseCOMPLEX16FFTPlan( UINT4 size, int measu
relvl ); | | COMPLEX16FFTPlan * XLALCreateReverseCOMPLEX16FFTPlan( UINT4 size, int measu
relvl ); | |
| | | | |
|
| /** Destroys a COMPLEX16FFTPlan | | /** | |
| | | * Destroys a COMPLEX16FFTPlan | |
| * @param[in] plan A pointer to the COMPLEX16FFTPlan to be destroyed. | | * @param[in] plan A pointer to the COMPLEX16FFTPlan to be destroyed. | |
| * @return None. | | * @return None. | |
| */ | | */ | |
| void XLALDestroyCOMPLEX16FFTPlan( COMPLEX16FFTPlan *plan ); | | void XLALDestroyCOMPLEX16FFTPlan( COMPLEX16FFTPlan *plan ); | |
| | | | |
|
| /** Perform a COMPLEX16Vector to COMPLEX16Vector FFT | | /** | |
| | | * Perform a COMPLEX16Vector to COMPLEX16Vector FFT | |
| * | | * | |
| * This routine computes | | * This routine computes | |
| * \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f] | | * \f[Z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,z[j],\f] | |
| * and where the minus sign is used if a forward plan is provided as the ar
gument | | * and where the minus sign is used if a forward plan is provided as the ar
gument | |
| * and the plus sign is used if a reverse plan is provided as the argument; | | * and the plus sign is used if a reverse plan is provided as the argument; | |
| * here N is the length of the input and output vectors z and Z. | | * here N is the length of the input and output vectors z and Z. | |
| * | | * | |
| * @param[out] output The complex output data vector Z of length N | | * @param[out] output The complex output data vector Z of length N | |
| * @param[in] input The input complex data vector z of length N | | * @param[in] input The input complex data vector z of length N | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @note | | * @note | |
| * The input and output vectors must be distinct. | | * The input and output vectors must be distinct. | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCOMPLEX16VectorFFT() function shall fail if: | | * The \c XLALCOMPLEX16VectorFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the input and output data | | * - [\c XLAL_EINVAL] A argument is invalid or the input and output data | |
| * vectors are the same. | | * vectors are the same. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
|
| int XLALCOMPLEX16VectorFFT( COMPLEX16Vector * restrict output, COMPLEX16Vec
tor * restrict input, | | int XLALCOMPLEX16VectorFFT( COMPLEX16Vector * _LAL_RESTRICT_ output, const
COMPLEX16Vector * _LAL_RESTRICT_ input, | |
| const COMPLEX16FFTPlan *plan ); | | const COMPLEX16FFTPlan *plan ); | |
| | | | |
| /* | | /* | |
| * | | * | |
| * LAL COMPLEX8 functions | | * LAL COMPLEX8 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead. | | * @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateForwardCOMPLEX8FFTPlan( | | LALCreateForwardCOMPLEX8FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8FFTPlan **plan, | | COMPLEX8FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead. | | * @deprecated Use XLALCreateForwardCOMPLEX8FFTPlan() instead. | |
| */ | | */ | |
| #define LALCreateForwardComplexFFTPlan LALCreateForwardCOMPLEX8FFTPlan | | #define LALCreateForwardComplexFFTPlan LALCreateForwardCOMPLEX8FFTPlan | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead. | | * @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateReverseCOMPLEX8FFTPlan( | | LALCreateReverseCOMPLEX8FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8FFTPlan **plan, | | COMPLEX8FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead. | | * @deprecated Use XLALCreateReverseCOMPLEX8FFTPlan() instead. | |
| */ | | */ | |
| #define LALCreateReverseComplexFFTPlan LALCreateReverseCOMPLEX8FFTPlan | | #define LALCreateReverseComplexFFTPlan LALCreateReverseCOMPLEX8FFTPlan | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead. | | * @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALDestroyCOMPLEX8FFTPlan ( | | LALDestroyCOMPLEX8FFTPlan ( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8FFTPlan **plan | | COMPLEX8FFTPlan **plan | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead. | | * @deprecated Use XLALDestroyCOMPLEX8FFTPlan() instead. | |
| */ | | */ | |
| #define LALDestroyComplexFFTPlan LALDestroyCOMPLEX8FFTPlan | | #define LALDestroyComplexFFTPlan LALDestroyCOMPLEX8FFTPlan | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCOMPLEX8VectorFFT() instead. | | * @deprecated Use XLALCOMPLEX8VectorFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALCOMPLEX8VectorFFT ( | | LALCOMPLEX8VectorFFT ( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8Vector *output, | | COMPLEX8Vector *output, | |
| COMPLEX8Vector *input, | | COMPLEX8Vector *input, | |
| COMPLEX8FFTPlan *plan | | COMPLEX8FFTPlan *plan | |
| ); | | ); | |
| | | | |
| /* | | /* | |
| * | | * | |
| * LAL COMPLEX16 functions | | * LAL COMPLEX16 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateForwardCOMPLEX16FFTPlan() instead. | | * @deprecated Use XLALCreateForwardCOMPLEX16FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateForwardCOMPLEX16FFTPlan( | | LALCreateForwardCOMPLEX16FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX16FFTPlan **plan, | | COMPLEX16FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateReverseCOMPLEX16FFTPlan() instead. | | * @deprecated Use XLALCreateReverseCOMPLEX16FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateReverseCOMPLEX16FFTPlan( | | LALCreateReverseCOMPLEX16FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX16FFTPlan **plan, | | COMPLEX16FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALDestroyCOMPLEX16FFTPlan() instead. | | * @deprecated Use XLALDestroyCOMPLEX16FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALDestroyCOMPLEX16FFTPlan ( | | LALDestroyCOMPLEX16FFTPlan ( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX16FFTPlan **plan | | COMPLEX16FFTPlan **plan | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCOMPLEX16VectorFFT() instead. | | * @deprecated Use XLALCOMPLEX16VectorFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALCOMPLEX16VectorFFT ( | | LALCOMPLEX16VectorFFT ( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX16Vector *output, | | COMPLEX16Vector *output, | |
| COMPLEX16Vector *input, | | COMPLEX16Vector *input, | |
| COMPLEX16FFTPlan *plan | | COMPLEX16FFTPlan *plan | |
| ); | | ); | |
| | | | |
| | | | |
End of changes. 42 change blocks. |
| 105 lines changed or deleted | | 114 lines changed or added | |
|
| ConfigFile.h | | ConfigFile.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| #define _CONFIGFILE_H | | #define _CONFIGFILE_H | |
| | | | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| #include <lal/StringInput.h> | | #include <lal/StringInput.h> | |
| | | | |
| /* C++ protection. */ | | /* C++ protection. */ | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| /** \addtogroup ConfigFile_h | | /** | |
| | | * \addtogroup ConfigFile_h | |
| * \author Reinhard Prix | | * \author Reinhard Prix | |
| * \brief Module for general parsing of simple ASCII-based config-files. | | * \brief Module for general parsing of simple ASCII-based config-files. | |
|
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| This module provides routines for reading formatted | | * This module provides routines for reading formatted | |
| config-files containing definitions of the form <tt>variable = value</tt>. | | * config-files containing definitions of the form <tt>variable = value</tt | |
| The general syntax is somewhat similar to the one provided by the | | >. | |
| perl-module <tt>ConfigParser</tt> (cf. | | * The general syntax is somewhat similar to the one provided by the | |
| http://www.python.org/doc/current/lib/module-ConfigParser.html) | | * perl-module <tt>ConfigParser</tt> (cf. | |
| | | * http://www.python.org/doc/current/lib/module-ConfigParser.html) | |
| Comments are allowed using either '<tt>\#</tt>' or <tt>\%</tt>. | | * | |
| You can also use line-continuation using a '<tt>\\</tt>' at the end of the | | * Comments are allowed using either '<tt>\#</tt>' or <tt>\%</tt>. | |
| line. | | * You can also use line-continuation using a '<tt>\\</tt>' at the end of | |
| Also note that comment-signs '<tt>\#\%</tt>' within double-quotes "... | | the line. | |
| " | | * Also note that comment-signs '<tt>\#\%</tt>' within double-quotes " | |
| are <em>not</em> treated as comment-characters. | | ..." | |
| Semi-colons <tt>;</tt> are ignored, but can be used to separate several ass | | * are <em>not</em> treated as comment-characters. | |
| ignments on the same line. | | * Semi-colons <tt>;</tt> are ignored, but can be used to separate several | |
| The general syntax is best illustrated | | assignments on the same line. | |
| using a simple example: | | * The general syntax is best illustrated | |
| \code | | * using a simple example: | |
| # comment line | | * \code | |
| var1 = 1.0; var2 = 3.1; ## several assignments on a line, separated by '; | | * # comment line | |
| ' | | * var1 = 1.0; var2 = 3.1; ## several assignments on a line, separated by | |
| somevar = some text.\ | | ';' | |
| You can also use\ | | * somevar = some text.\ | |
| line-continuation | | * You can also use\ | |
| var3 = 4 # whatever that means | | * line-continuation | |
| note = "this is also possible, and # here does nothing" | | * var3 = 4 # whatever that means | |
| a_switch = true #possible values: 0,1,true,false,yes,no, case insensitive | | * note = "this is also possible, and # here does nothing" | |
| ... | | * a_switch = true #possible values: 0,1,true,false,yes,no, case insensiti | |
| \endcode | | ve | |
| | | * ... | |
| Note that TABS generally get replaced by a single space, which can be | | * \endcode | |
| useful in the case of line-continuation (see example). All leading and | | * | |
| trailing spaces in are ignore (except within double-quotes). | | * Note that TABS generally get replaced by a single space, which can be | |
| | | * useful in the case of line-continuation (see example). All leading and | |
| The general approach of reading from such a config-file, is to first | | * trailing spaces in are ignore (except within double-quotes). | |
| call XLALParseDataFile() which loads and pre-parses the contents of the | | * | |
| config-file into the structure LALParsedDataFile. Then one can read in | | * The general approach of reading from such a config-file, is to first | |
| config-variables either using one of the type-strict custom-wrappers | | * call XLALParseDataFile() which loads and pre-parses the contents of the | |
| <tt>XLALReadConfig<TYPE>Variable()</tt> or the general-purpose reading func | | * config-file into the structure LALParsedDataFile. Then one can read in | |
| tion | | * config-variables either using one of the type-strict custom-wrappers | |
| XLALReadConfigVariable(). | | * <tt>XLALReadConfig<TYPE>Variable()</tt> or the general-purpose reading f | |
| | | unction | |
| A boolean variable read by XLALReadConfigBOOLVariable() can have any of the | | * XLALReadConfigVariable(). | |
| values | | * | |
| <tt>{1, 0, yes, no, true, false}</tt>, where the comparison is done | | * A boolean variable read by XLALReadConfigBOOLVariable() can have any of | |
| <em>case-insensitively</em>, i.e. you can also use 'True' or 'FALSE'.... | | the values | |
| | | * <tt>{1, 0, yes, no, true, false}</tt>, where the comparison is done | |
| If one wishes a tight sytnax for the config-file, one can check | | * <em>case-insensitively</em>, i.e. you can also use 'True' or 'FALSE'.... | |
| that there are no illegal entries in the config-file. This is done | | * | |
| by checking at the end that all config-file entries have been | | * If one wishes a tight sytnax for the config-file, one can check | |
| successfully parsed, using: | | * that there are no illegal entries in the config-file. This is done | |
| XLALCheckConfigReadComplete(), where \a strictness is either | | * by checking at the end that all config-file entries have been | |
| CONFIGFILE_WARN or CONFIGFILE_ERROR. | | * successfully parsed, using: | |
| In the first case only a warning is issued, while in the second it is | | * XLALCheckConfigReadComplete(), where \a strictness is either | |
| treated as a LAL-error if some config-file entries have not been | | * CONFIGFILE_WARN or CONFIGFILE_ERROR. | |
| read-in. (The use of this function is optional). | | * In the first case only a warning is issued, while in the second it is | |
| | | * treated as a LAL-error if some config-file entries have not been | |
| The configfile-data should be freed at the end using | | * read-in. (The use of this function is optional). | |
| XLALDestroyParsedDataFile(). | | * | |
| | | * The configfile-data should be freed at the end using | |
| \par Notes | | * XLALDestroyParsedDataFile(). | |
| | | * | |
| XLALReadConfigSTRINGVariable() and XLALReadConfigSTRINGVariable() are not | | * \par Notes | |
| the same as using <tt>%quot;\%s"</tt> as a format string, as they read | | * | |
| the | | * XLALReadConfigSTRINGVariable() and XLALReadConfigSTRINGVariable() are no | |
| <em>rest</em> of the logical line (excluding comments) as a string. | | t | |
| | | * the same as using <tt>%quot;\%s"</tt> as a format string, as they r | |
| In the case of XLALReadConfigSTRINGVariable(), the required | | ead the | |
| memory is allocated and has to be freed by the caller, while for | | * <em>rest</em> of the logical line (excluding comments) as a string. | |
| XLALReadConfigSTRINGVariable() the caller has to provide a | | * | |
| CHARVector of length N, which defines the maximum length of | | * In the case of XLALReadConfigSTRINGVariable(), the required | |
| string to be read. | | * memory is allocated and has to be freed by the caller, while for | |
| | | * XLALReadConfigSTRINGVariable() the caller has to provide a | |
| \note instead of using these functions directly, it might be | | * CHARVector of length N, which defines the maximum length of | |
| more convenient to use the \ref UserInput_h. | | * string to be read. | |
| | | * | |
| */ | | * \note instead of using these functions directly, it might be | |
| | | * more convenient to use the \ref UserInput_h. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** Levels of strictness for config-file parsing. */ | | /** Levels of strictness for config-file parsing. */ | |
| typedef enum { | | typedef enum { | |
| CONFIGFILE_IGNORE = 0, /**< ignore missing config-variable or unpar
sed config-entries */ | | CONFIGFILE_IGNORE = 0, /**< ignore missing config-variable or unpar
sed config-entries */ | |
| CONFIGFILE_WARN, /**< issue a warning but don't report an err
or. */ | | CONFIGFILE_WARN, /**< issue a warning but don't report an err
or. */ | |
| CONFIGFILE_ERROR, /**< issue an error-message and report a LAL
-error */ | | CONFIGFILE_ERROR, /**< issue an error-message and report a LAL
-error */ | |
| CONFIGFILE_LAST | | CONFIGFILE_LAST | |
| } ConfigStrictness; | | } ConfigStrictness; | |
| | | | |
|
| /** This structure defines a config-variable to be read in using the | | /** | |
| * general-purpose reading function LALReadConfigVariable(). */ | | * This structure defines a config-variable to be read in using the | |
| | | * general-purpose reading function LALReadConfigVariable(). | |
| | | */ | |
| #ifdef SWIG /* SWIG interface directives */ | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(IMMUTABLE_MEMBERS(tagLALConfigVar, secName, varName, fmt)); | | SWIGLAL(IMMUTABLE_MEMBERS(tagLALConfigVar, secName, varName, fmt)); | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| typedef struct tagLALConfigVar { | | typedef struct tagLALConfigVar { | |
| const CHAR *secName; /**< Section name within which to find varN
ame. May be NULL */ | | const CHAR *secName; /**< Section name within which to find varN
ame. May be NULL */ | |
| const CHAR *varName; /**< Variable-name to be read in the config-
file */ | | const CHAR *varName; /**< Variable-name to be read in the config-
file */ | |
| const CHAR *fmt; /**< Format string for reading (<tt>sscanf()
</tt>-style) */ | | const CHAR *fmt; /**< Format string for reading (<tt>sscanf()
</tt>-style) */ | |
| ConfigStrictness strictness; /**< what to do if variable not found: ignor
e, warn, error */ | | ConfigStrictness strictness; /**< what to do if variable not found: ignor
e, warn, error */ | |
| } LALConfigVar; | | } LALConfigVar; | |
| | | | |
|
| /** This structure is returned by LALParseDataFile() and holds the contents | | /** | |
| of an | | * This structure is returned by LALParseDataFile() and holds the contents | |
| | | of an | |
| * ASCII data-file in a pre-parsed form, namely stripped from all comments
('\#', '\%'), | | * ASCII data-file in a pre-parsed form, namely stripped from all comments
('\#', '\%'), | |
| * spurious whitespaces, and separated into lines (taking into account line
-continuation | | * spurious whitespaces, and separated into lines (taking into account line
-continuation | |
| * by '\\' at the end of lines). | | * by '\\' at the end of lines). | |
| * This is used as the input structure in the config-variable reading routi
nes. | | * This is used as the input structure in the config-variable reading routi
nes. | |
| */ | | */ | |
| typedef struct tagLALParsedDataFile { | | typedef struct tagLALParsedDataFile { | |
| TokenList *lines; /**< list of pre-parsed data-file lines */ | | TokenList *lines; /**< list of pre-parsed data-file lines */ | |
| BOOLEAN *wasRead; /**< keep track of successfully read lines for stric
tness-checking */ | | BOOLEAN *wasRead; /**< keep track of successfully read lines for stric
tness-checking */ | |
| } LALParsedDataFile; | | } LALParsedDataFile; | |
| | | | |
| /* Function prototypes */ | | /* Function prototypes */ | |
| int XLALParseDataFile (LALParsedDataFile **cfgdata, const CHAR *fname); | | int XLALParseDataFile (LALParsedDataFile **cfgdata, const CHAR *fname); | |
|
| | | int XLALParseDataFileContent (LALParsedDataFile **cfgdata, const CHAR *stri | |
| | | ng ); | |
| | | | |
| void XLALDestroyParsedDataFile (LALParsedDataFile *cfgdata); | | void XLALDestroyParsedDataFile (LALParsedDataFile *cfgdata); | |
| | | | |
| int XLALConfigSectionExists(const LALParsedDataFile *, const CHAR *); | | int XLALConfigSectionExists(const LALParsedDataFile *, const CHAR *); | |
|
| | | LALStringVector *XLALListConfigFileSections ( const LALParsedDataFile *cfgd
ata ); | |
| | | | |
| int | | int | |
| XLALReadConfigBOOLVariable (BOOLEAN *varp, | | XLALReadConfigBOOLVariable (BOOLEAN *varp, | |
| const LALParsedDataFile *cfgdata, | | const LALParsedDataFile *cfgdata, | |
| const CHAR *secName, | | const CHAR *secName, | |
| const CHAR *varName, | | const CHAR *varName, | |
| BOOLEAN *wasRead); | | BOOLEAN *wasRead); | |
| int | | int | |
| XLALReadConfigINT4Variable (INT4 *varp, | | XLALReadConfigINT4Variable (INT4 *varp, | |
| const LALParsedDataFile *cfgdata, | | const LALParsedDataFile *cfgdata, | |
| | | | |
| skipping to change at line 220 | | skipping to change at line 227 | |
| #define CONFIGFILEH_MSGEFMT "Config variable not readable using
given format-string." | | #define CONFIGFILEH_MSGEFMT "Config variable not readable using
given format-string." | |
| #define CONFIGFILEH_MSGETOKENS "The input ConfigData seems corrupte
d." | | #define CONFIGFILEH_MSGETOKENS "The input ConfigData seems corrupte
d." | |
| #define CONFIGFILEH_MSGENONULL "Output pointer is not NULL" | | #define CONFIGFILEH_MSGENONULL "Output pointer is not NULL" | |
| #define CONFIGFILEH_MSGEUNKNOWN "Unknown config-file entry f
ound" | | #define CONFIGFILEH_MSGEUNKNOWN "Unknown config-file entry f
ound" | |
| #define CONFIGFILEH_MSGEMEM "Out of memory" | | #define CONFIGFILEH_MSGEMEM "Out of memory" | |
| #define CONFIGFILEH_MSGEBOOL "Illegal BOOLEAN entry" | | #define CONFIGFILEH_MSGEBOOL "Illegal BOOLEAN entry" | |
| #define CONFIGFILEH_MSGESTRING "Malformed quoted string" | | #define CONFIGFILEH_MSGESTRING "Malformed quoted string" | |
| #define CONFIGFILEH_MSGEXLAL "Failure in XLAL function" | | #define CONFIGFILEH_MSGEXLAL "Failure in XLAL function" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** \name Deprecated LAL-interface | | /** | |
| | | * \name Deprecated LAL-interface | |
| * These functions are deprecated, and you should user their XLAL-equivalen
ts instead. | | * These functions are deprecated, and you should user their XLAL-equivalen
ts instead. | |
|
| */ /*@{*/ | | */ | |
| | | /*@{*/ | |
| void LALParseDataFile (LALStatus *, LALParsedDataFile **cfgdata, const CHAR
*fname); | | void LALParseDataFile (LALStatus *, LALParsedDataFile **cfgdata, const CHAR
*fname); | |
| void LALDestroyParsedDataFile (LALStatus *, LALParsedDataFile **cfgdata); | | void LALDestroyParsedDataFile (LALStatus *, LALParsedDataFile **cfgdata); | |
| | | | |
| void LALReadConfigBOOLVariable (LALStatus *, BOOLEAN *varp, const LALParsed
DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | | void LALReadConfigBOOLVariable (LALStatus *, BOOLEAN *varp, const LALParsed
DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | |
| void LALReadConfigINT4Variable (LALStatus *, INT4 *varp, const LALParsedDat
aFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | | void LALReadConfigINT4Variable (LALStatus *, INT4 *varp, const LALParsedDat
aFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | |
| void LALReadConfigREAL8Variable (LALStatus *, REAL8 *varp, const LALParsedD
ataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | | void LALReadConfigREAL8Variable (LALStatus *, REAL8 *varp, const LALParsedD
ataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | |
| void LALReadConfigSTRINGVariable (LALStatus *, CHAR **varp, const LALParsed
DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | | void LALReadConfigSTRINGVariable (LALStatus *, CHAR **varp, const LALParsed
DataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | |
| void LALReadConfigSTRINGNVariable (LALStatus *, CHARVector *varp, const LAL
ParsedDataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | | void LALReadConfigSTRINGNVariable (LALStatus *, CHARVector *varp, const LAL
ParsedDataFile *cfgdata, const CHAR *varName, BOOLEAN *wasRead); | |
| void LALReadConfigVariable (LALStatus *, void *varp, const LALParsedDataFil
e *cfgdata, const LALConfigVar *param, BOOLEAN *wasRead); | | void LALReadConfigVariable (LALStatus *, void *varp, const LALParsedDataFil
e *cfgdata, const LALConfigVar *param, BOOLEAN *wasRead); | |
| void LALCheckConfigReadComplete (LALStatus *, const LALParsedDataFile *cfgd
ata, ConfigStrictness strict); | | void LALCheckConfigReadComplete (LALStatus *, const LALParsedDataFile *cfgd
ata, ConfigStrictness strict); | |
| | | | |
End of changes. 8 change blocks. |
| 86 lines changed or deleted | | 99 lines changed or added | |
|
| Date.h | | Date.h | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 48 | |
| #endif | | #endif | |
| | | | |
| #define XLAL_BILLION_INT4 1000000000 | | #define XLAL_BILLION_INT4 1000000000 | |
| #define XLAL_BILLION_INT8 LAL_INT8_C( 1000000000 ) | | #define XLAL_BILLION_INT8 LAL_INT8_C( 1000000000 ) | |
| #define XLAL_BILLION_REAL8 1e9 | | #define XLAL_BILLION_REAL8 1e9 | |
| | | | |
| /** | | /** | |
| * \addtogroup Date_h | | * \addtogroup Date_h | |
| * \author D.W. Chin, J.D.E. Creighton and Kipp Cannon | | * \author D.W. Chin, J.D.E. Creighton and Kipp Cannon | |
| * \brief Provides routines for manipulating date and time information. | | * \brief Provides routines for manipulating date and time information. | |
|
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/Date.h> | | * \code | |
| \endcode | | * #include <lal/Date.h> | |
| | | * \endcode | |
| This header covers routines for manipulating date and time | | * | |
| information. The various time systems are discussed in [\ref esaa1992]. | | * This header covers routines for manipulating date and time | |
| | | * information. The various time systems are discussed in \cite esaa1992. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| /** The UNIX time of the GPS origin epoch. | | /** | |
| * | | * The UNIX time of the GPS origin epoch. | |
| * 1980 6 JAN 0h UTC is 3657 days after 1970 1 JAN 0h UTC: | | * 1980 6 JAN 0h UTC is 3657 days after 1970 1 JAN 0h UTC: | |
| * 8 standard years of 365 days = 2920 days | | * 8 standard years of 365 days = 2920 days | |
| * 2 leap years of 366 days = 734 days | | * 2 leap years of 366 days = 734 days | |
| * 5 extra days. | | * 5 extra days. | |
| * Hence 3657*86400=315964800. | | * Hence 3657*86400=315964800. | |
| * | | * | |
| * Note that this deliberately does not account for any leap seconds in the | | * Note that this deliberately does not account for any leap seconds in the | |
| * interval. POSIX:2001 defines the relation between the UNIX time | | * interval. POSIX:2001 defines the relation between the UNIX time | |
| * \c time_t \c t and a broken down time \c struct \c tm \c utc as | | * \c time_t \c t and a broken down time \c struct \c tm \c utc as | |
| * \code | | * \code | |
| * t = utc.tm_sec + utc.tm_min*60 + utc.tm_hour*3600 | | * t = utc.tm_sec + utc.tm_min*60 + utc.tm_hour*3600 | |
|
| * + utc.tm_yday*86400 + (utc.tm_year-70)*31536000 | | * + utc.tm_yday*86400 + (utc.tm_year-70)*31536000 | |
| * + ((utc.tm_year-69)/4)*86400 - ((utc.tm_year-1)/100)*86400 | | * + ((utc.tm_year-69)/4)*86400 - ((utc.tm_year-1)/100)*86400 | |
| * + ((utc.tm_year+299)/400)*86400; | | * + ((utc.tm_year+299)/400)*86400; | |
| * \endcode | | * \endcode | |
| * so if you were to set \c utc.tm_sec=utc.tm_min=utc.tm_hour=0, | | * so if you were to set \c utc.tm_sec=utc.tm_min=utc.tm_hour=0, | |
| * \c utc.tm_yday=5, and \c utc.tm_year=80, then you get | | * \c utc.tm_yday=5, and \c utc.tm_year=80, then you get | |
| * \c t=315964800. That is what this is. | | * \c t=315964800. That is what this is. | |
| */ | | */ | |
| #define XLAL_EPOCH_UNIX_GPS 315964800 | | #define XLAL_EPOCH_UNIX_GPS 315964800 | |
| | | | |
| #define XLAL_EPOCH_J2000_0_JD 2451545.0 /**< Julian Day of the J200
0.0 epoch (2000 JAN 1 12h UTC). */ | | #define XLAL_EPOCH_J2000_0_JD 2451545.0 /**< Julian Day of the J200
0.0 epoch (2000 JAN 1 12h UTC). */ | |
| #define XLAL_EPOCH_J2000_0_TAI_UTC 32 /**< Leap seconds (TAI-UTC)
on the J2000.0 epoch (2000 JAN 1 12h UTC). */ | | #define XLAL_EPOCH_J2000_0_TAI_UTC 32 /**< Leap seconds (TAI-UTC)
on the J2000.0 epoch (2000 JAN 1 12h UTC). */ | |
| #define XLAL_EPOCH_J2000_0_GPS 630763213 /**< GPS seconds of the J20
00.0 epoch (2000 JAN 1 12h UTC). */ | | #define XLAL_EPOCH_J2000_0_GPS 630763213 /**< GPS seconds of the J20
00.0 epoch (2000 JAN 1 12h UTC). */ | |
| #define XLAL_EPOCH_GPS_JD 2444244.5 /**< Julian Day of the GPS
epoch (1980 JAN 6 0h UTC) */ | | #define XLAL_EPOCH_GPS_JD 2444244.5 /**< Julian Day of the GPS
epoch (1980 JAN 6 0h UTC) */ | |
| #define XLAL_EPOCH_GPS_TAI_UTC 19 /**< Leap seconds (TAI-UTC)
on the GPS epoch (1980 JAN 6 0h UTC) */ | | #define XLAL_EPOCH_GPS_TAI_UTC 19 /**< Leap seconds (TAI-UTC)
on the GPS epoch (1980 JAN 6 0h UTC) */ | |
| #define XLAL_MJD_REF 2400000.5 /**< Reference Julian Day f
or Mean Julian Day. */ | | #define XLAL_MJD_REF 2400000.5 /**< Reference Julian Day f
or Mean Julian Day. */ | |
| #define XLAL_MODIFIED_JULIEN_DAY(utc) (XLALJulianDay(utc)-XLAL_MJD_REF) /**
< Modified Julian Day for specified civil time structure. */ | | #define XLAL_MODIFIED_JULIEN_DAY(utc) (XLALJulianDay(utc)-XLAL_MJD_REF) /**
< Modified Julian Day for specified civil time structure. */ | |
| | | | |
|
| /** This structure stores pointers to a ::LALDetector and a | | /** | |
| | | * This structure stores pointers to a ::LALDetector and a | |
| * ::LIGOTimeGPS. Its sole purpose is to aggregate these | | * ::LIGOTimeGPS. Its sole purpose is to aggregate these | |
| * structures for passing to functions. | | * structures for passing to functions. | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagLALPlaceAndGPS | | tagLALPlaceAndGPS | |
| { | | { | |
|
| LALDetector *p_detector; /**< pointer to a detector */ | | const LALDetector *p_detector; /**< pointer to a detector */ | |
| LIGOTimeGPS *p_gps; /**< Pointer to a GPS time structure */ | | LIGOTimeGPS *p_gps; /**< Pointer to a GPS time structure */ | |
| } | | } | |
| LALPlaceAndGPS; | | LALPlaceAndGPS; | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /* ---------- Function prototypes : see respective source.c files for doxyg
en documentation ---------- */ | | /* ---------- Function prototypes : see respective source.c files for doxyg
en documentation ---------- */ | |
| | | | |
|
| #ifndef SWIG // exclude from SWIG interface | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | | |
| /* Converts GPS time to nano seconds stored as an INT8. */ | | /* Converts GPS time to nano seconds stored as an INT8. */ | |
| INT8 XLALGPSToINT8NS( const LIGOTimeGPS *epoch ); | | INT8 XLALGPSToINT8NS( const LIGOTimeGPS *epoch ); | |
| | | | |
| /* Converts nano seconds stored as an INT8 to GPS time. */ | | /* Converts nano seconds stored as an INT8 to GPS time. */ | |
| LIGOTimeGPS * XLALINT8NSToGPS( LIGOTimeGPS *epoch, INT8 ns ); | | LIGOTimeGPS * XLALINT8NSToGPS( LIGOTimeGPS *epoch, INT8 ns ); | |
| | | | |
| /* Sets GPS time given GPS integer seconds and residual nanoseconds. */ | | /* Sets GPS time given GPS integer seconds and residual nanoseconds. */ | |
| LIGOTimeGPS * XLALGPSSet( LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan ); | | LIGOTimeGPS * XLALGPSSet( LIGOTimeGPS *epoch, INT4 gpssec, INT8 gpsnan ); | |
| | | | |
| /* Sets GPS time given GPS seconds as a REAL8. */ | | /* Sets GPS time given GPS seconds as a REAL8. */ | |
| LIGOTimeGPS * XLALGPSSetREAL8( LIGOTimeGPS *epoch, REAL8 t ); | | LIGOTimeGPS * XLALGPSSetREAL8( LIGOTimeGPS *epoch, REAL8 t ); | |
| | | | |
| /* Returns GPS time as a REAL8. */ | | /* Returns GPS time as a REAL8. */ | |
| REAL8 XLALGPSGetREAL8( const LIGOTimeGPS *epoch ); | | REAL8 XLALGPSGetREAL8( const LIGOTimeGPS *epoch ); | |
| | | | |
|
| /** Breaks the GPS time into REAL8 integral and fractional parts, | | /** | |
| | | * Breaks the GPS time into REAL8 integral and fractional parts, | |
| * each of which has the same sign as the epoch. Returns the | | * each of which has the same sign as the epoch. Returns the | |
| * fractional part, and stores the integral part (as a REAL8) | | * fractional part, and stores the integral part (as a REAL8) | |
| * in the object pointed to by iptr. Like the standard C math | | * in the object pointed to by iptr. Like the standard C math | |
|
| * library function modf(). */ | | * library function modf(). | |
| | | */ | |
| REAL8 XLALGPSModf( REAL8 *iptr, const LIGOTimeGPS *epoch ); | | REAL8 XLALGPSModf( REAL8 *iptr, const LIGOTimeGPS *epoch ); | |
| | | | |
| /* Adds dt to a GPS time. */ | | /* Adds dt to a GPS time. */ | |
| LIGOTimeGPS * XLALGPSAdd( LIGOTimeGPS *epoch, REAL8 dt ); | | LIGOTimeGPS * XLALGPSAdd( LIGOTimeGPS *epoch, REAL8 dt ); | |
| | | | |
| /* Adds two GPS times. */ | | /* Adds two GPS times. */ | |
| LIGOTimeGPS * XLALGPSAddGPS( LIGOTimeGPS *epoch, const LIGOTimeGPS *dt ); | | LIGOTimeGPS * XLALGPSAddGPS( LIGOTimeGPS *epoch, const LIGOTimeGPS *dt ); | |
| | | | |
| /* Difference between two GPS times. */ | | /* Difference between two GPS times. */ | |
| REAL8 XLALGPSDiff( const LIGOTimeGPS *t1, const LIGOTimeGPS *t0 ); | | REAL8 XLALGPSDiff( const LIGOTimeGPS *t1, const LIGOTimeGPS *t0 ); | |
| | | | |
| skipping to change at line 155 | | skipping to change at line 159 | |
| | | | |
| /* Divide a GPS time by a REAL8 */ | | /* Divide a GPS time by a REAL8 */ | |
| LIGOTimeGPS *XLALGPSDivide( LIGOTimeGPS *gps, REAL8 x ); | | LIGOTimeGPS *XLALGPSDivide( LIGOTimeGPS *gps, REAL8 x ); | |
| | | | |
| /* Parse an ASCII string into a LIGOTimeGPS structure */ | | /* Parse an ASCII string into a LIGOTimeGPS structure */ | |
| int XLALStrToGPS(LIGOTimeGPS *t, const char *nptr, char **endptr); | | int XLALStrToGPS(LIGOTimeGPS *t, const char *nptr, char **endptr); | |
| | | | |
| /* Return a string containing the ASCII base 10 representation of a LIGOTim
eGPS. */ | | /* Return a string containing the ASCII base 10 representation of a LIGOTim
eGPS. */ | |
| char *XLALGPSToStr(char *, const LIGOTimeGPS *t); | | char *XLALGPSToStr(char *, const LIGOTimeGPS *t); | |
| | | | |
|
| #endif // !SWIG | | #endif /* !SWIG */ | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime)); | | SWIGLAL(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime)); | |
| #endif | | #endif | |
| | | | |
| /* This function returns the current GPS time according to the system clock
*/ | | /* This function returns the current GPS time according to the system clock
*/ | |
| LIGOTimeGPS* XLALGPSTimeNow( LIGOTimeGPS *gpstime ); | | LIGOTimeGPS* XLALGPSTimeNow( LIGOTimeGPS *gpstime ); | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL_CLEAR(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime)); | | SWIGLAL_CLEAR(NEW_EMPTY_ARGUMENT(LIGOTimeGPS*, gpstime)); | |
| #endif | | #endif | |
| | | | |
| /* Returns the leap seconds TAI-UTC at a given GPS second. */ | | /* Returns the leap seconds TAI-UTC at a given GPS second. */ | |
| int XLALLeapSeconds( INT4 gpssec ); | | int XLALLeapSeconds( INT4 gpssec ); | |
| | | | |
| /* Returns the leap seconds GPS-UTC at a given GPS second. */ | | /* Returns the leap seconds GPS-UTC at a given GPS second. */ | |
| int XLALGPSLeapSeconds( INT4 gpssec ); | | int XLALGPSLeapSeconds( INT4 gpssec ); | |
| | | | |
| /* Returns the leap seconds TAI-UTC for a given UTC broken down time. */ | | /* Returns the leap seconds TAI-UTC for a given UTC broken down time. */ | |
| int XLALLeapSecondsUTC( const struct tm *utc ); | | int XLALLeapSecondsUTC( const struct tm *utc ); | |
| | | | |
| /* Returns the GPS seconds since the GPS epoch for a specified UTC time str
ucture. */ | | /* Returns the GPS seconds since the GPS epoch for a specified UTC time str
ucture. */ | |
| INT4 XLALUTCToGPS( const struct tm *utc ); | | INT4 XLALUTCToGPS( const struct tm *utc ); | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(EMPTY_ARGUMENT(struct tm*, utc)); | | SWIGLAL(EMPTY_ARGUMENT(struct tm*, utc)); | |
| #endif | | #endif | |
| | | | |
| /* Returns a pointer to a tm structure representing the time | | /* Returns a pointer to a tm structure representing the time | |
| * specified in seconds since the GPS epoch. */ | | * specified in seconds since the GPS epoch. */ | |
| struct tm* XLALGPSToUTC( struct tm *utc, INT4 gpssec ); | | struct tm* XLALGPSToUTC( struct tm *utc, INT4 gpssec ); | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL_CLEAR(EMPTY_ARGUMENT(struct tm*, utc)); | | SWIGLAL_CLEAR(EMPTY_ARGUMENT(struct tm*, utc)); | |
| #endif | | #endif | |
| | | | |
| /* Returns the Julian Day (JD) corresponding to the date given in a broken | | /* Returns the Julian Day (JD) corresponding to the date given in a broken | |
| * down time structure. */ | | * down time structure. */ | |
| REAL8 XLALJulianDay( const struct tm *utc ); | | REAL8 XLALJulianDay( const struct tm *utc ); | |
| | | | |
| /* Returns the Modified Julian Day (MJD) corresponding to the date given in
a broken down time structure.*/ | | /* Returns the Modified Julian Day (MJD) corresponding to the date given in
a broken down time structure.*/ | |
| INT4 XLALModifiedJulianDay( const struct tm *utc ); | | INT4 XLALModifiedJulianDay( const struct tm *utc ); | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 25 lines changed or deleted | | 29 lines changed or added | |
|
| DetResponse.h | | DetResponse.h | |
| | | | |
| skipping to change at line 36 | | skipping to change at line 36 | |
| #include <lal/LALConstants.h> | | #include <lal/LALConstants.h> | |
| #include <lal/DetectorSite.h> | | #include <lal/DetectorSite.h> | |
| #include <lal/SkyCoordinates.h> | | #include <lal/SkyCoordinates.h> | |
| #include <lal/Date.h> | | #include <lal/Date.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" | | extern "C" | |
| { | | { | |
| #endif | | #endif | |
| | | | |
|
| /** \addtogroup DetResponse_h | | /** | |
| \author David Chin <dwchin@umich.edu>, Kipp Cannon <kipp@gravity.phys.u | | * \addtogroup DetResponse_h | |
| wm.edu> | | * \author David Chin <dwchin@umich.edu>, Kipp Cannon <kipp@gravity.phys.uw | |
| | | m.edu> | |
| \brief Provides routines to compute gravitational wave detector respons | | * | |
| e to | | * \brief Provides routines to compute gravitational wave detector response | |
| polarized planar gravitational wave originating from a given source, | | to | |
| detected at a given time. | | * polarized planar gravitational wave originating from a given source, | |
| | | * detected at a given time. | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/DetResponse.h> | | * \code | |
| \endcode | | * #include <lal/DetResponse.h> | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These routines compute the antenna beam pattern for all supported detector | | * | |
| types. <tt>XLALComputeDetAMResponse()</tt> computes the response at one | | * These routines compute the antenna beam pattern for all supported detect | |
| instance in time, and <tt>XLALComputeDetAMResponseSeries()</tt> computes a | | or | |
| vector of response for some length of time. | | * types. <tt>XLALComputeDetAMResponse()</tt> computes the response at one | |
| | | * instance in time, and <tt>XLALComputeDetAMResponseSeries()</tt> computes | |
| \heading{Algorithm} | | a | |
| | | * vector of response for some length of time. | |
| This code is a translation of the algorithm in the Maple worksheet by | | * | |
| Anderson, <em>et al.</em> [\ref Anderson_2000]. We compute the \f$h\f$-ten | | * ### Algorithm ### | |
| sors for | | * | |
| \f$+\f$- and \f$\times\f$-polarized in the Earth-fixed frame, and then cont | | * This code is a translation of the algorithm in the Maple worksheet by | |
| ract | | * Anderson, <em>et al.</em> \cite ABCCRW_2001. We compute the \f$h\f$-ten | |
| them (take the scalar product) with the detector response tensors as | | sors for | |
| described in the \ref LALDetectors_h section of the \c tools package. | | * \f$+\f$- and \f$\times\f$-polarized in the Earth-fixed frame, and then c | |
| | | ontract | |
| \ref LALDetectors_h provides predefined | | * them (take the scalar product) with the detector response tensors as | |
| \c LALDetector structures representing most current detectors, | | * described in the \ref LALDetectors_h section of the \c tools package. | |
| including LIGO (Hanford and Livingston), and GEO. | | * | |
| | | * \ref LALDetectors_h provides predefined | |
| \heading{Notes} | | * \c LALDetector structures representing most current detectors, | |
| | | * including LIGO (Hanford and Livingston), and GEO. | |
| For examples of usage, please see the test programs in the \c test director | | * | |
| y. | | * ### Notes ### | |
| | | * | |
| */ | | * For examples of usage, please see the test programs in the \c test direc | |
| | | tory. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name Error Codes */ | | /** \name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define DETRESPONSEH_ENULLINPUT 1 /**< Input is NULL */ | | #define DETRESPONSEH_ENULLINPUT 1 /**< Input is NULL */ | |
| #define DETRESPONSEH_ENULLOUTPUT 2 /**< Output is NULL */ | | #define DETRESPONSEH_ENULLOUTPUT 2 /**< Output is NULL */ | |
| #define DETRESPONSEH_ESRCNOTEQUATORIAL 3 /**< Source coordinates not
in Equatorial system */ | | #define DETRESPONSEH_ESRCNOTEQUATORIAL 3 /**< Source coordinates not
in Equatorial system */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \cond DONT_DOXYGEN */ | | /** \cond DONT_DOXYGEN */ | |
| #define DETRESPONSEH_MSGENULLINPUT "Input is NULL" | | #define DETRESPONSEH_MSGENULLINPUT "Input is NULL" | |
| #define DETRESPONSEH_MSGENULLOUTPUT "Output is NULL" | | #define DETRESPONSEH_MSGENULLOUTPUT "Output is NULL" | |
| #define DETRESPONSEH_MSGESRCNOTEQUATORIAL "Source coordinates not in Equato
rial system" | | #define DETRESPONSEH_MSGESRCNOTEQUATORIAL "Source coordinates not in Equato
rial system" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** This structure contains gravitational wave source position (in Equatori | | /** | |
| al | | * This structure contains gravitational wave source position (in Equatoria | |
| | | l | |
| * coördinates), and orientation angle. | | * coördinates), and orientation angle. | |
| * The orientation is measured counter-clockwise with respect to the "line
of ascending nodes", | | * The orientation is measured counter-clockwise with respect to the "line
of ascending nodes", | |
| * i.e. counter-clockwise with respect to a line perpendicular to the | | * i.e. counter-clockwise with respect to a line perpendicular to the | |
| * source's meridian and extending westwards. For a source in the Northern | | * source's meridian and extending westwards. For a source in the Northern | |
| * celestial hemisphere, and an observer in the Northern hemisphere standin
g | | * celestial hemisphere, and an observer in the Northern hemisphere standin
g | |
| * such that they are facing South, this angle is measured counter-clockwis
e | | * such that they are facing South, this angle is measured counter-clockwis
e | |
| * from a 3 o'clock position (pointing West) at the source. The polarizati
on | | * from a 3 o'clock position (pointing West) at the source. The polarizati
on | |
| * convention is chosen such that if the source orientation were zero, the | | * convention is chosen such that if the source orientation were zero, the | |
| * source would be a pure \f$+\f$-polarized source. | | * source would be a pure \f$+\f$-polarized source. | |
| */ | | */ | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 114 | |
| CHAR name[LALNameLength]; /**< name of source, eg catalog number
*/ | | CHAR name[LALNameLength]; /**< name of source, eg catalog number
*/ | |
| SkyPosition equatorialCoords; /**< equatorial coordinates of source,
in decimal RADIANS */ | | SkyPosition equatorialCoords; /**< equatorial coordinates of source,
in decimal RADIANS */ | |
| REAL8 orientation; /**< Orientation angle (\f$\psi\f$) of
source: | | REAL8 orientation; /**< Orientation angle (\f$\psi\f$) of
source: | |
| * counter-clockwise angle \f$x\f$-axi
s makes with a line perpendicular to | | * counter-clockwise angle \f$x\f$-axi
s makes with a line perpendicular to | |
| * meridian of source in Westward dire
ction (i.e. North of West), | | * meridian of source in Westward dire
ction (i.e. North of West), | |
| * in decimal radians. | | * in decimal radians. | |
| */ | | */ | |
| } | | } | |
| LALSource; | | LALSource; | |
| | | | |
|
| /** This structure aggregates a pointer to a \c LALDetector and a | | /** | |
| | | * This structure aggregates a pointer to a \c LALDetector and a | |
| * \c LALSource. Its sole function is to allow the user to pass | | * \c LALSource. Its sole function is to allow the user to pass | |
| * detector and source parameters to the functions | | * detector and source parameters to the functions | |
| * LALComputeDetAMResponse() and | | * LALComputeDetAMResponse() and | |
| * LALComputeDetAMResponseSeries(). | | * LALComputeDetAMResponseSeries(). | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagLALDetAndSource | | tagLALDetAndSource | |
| { | | { | |
|
| LALDetector *pDetector; /**< Pointer to ::LALDetector object contain
ing information about the detector */ | | const LALDetector *pDetector;/**< Pointer to ::LALDetector object contai
ning information about the detector */ | |
| LALSource *pSource; /**< Pointer to ::LALSource object containin
g information about the source */ | | LALSource *pSource; /**< Pointer to ::LALSource object containin
g information about the source */ | |
| } | | } | |
| LALDetAndSource; | | LALDetAndSource; | |
| | | | |
|
| /** This structure encapsulates the detector AM (beam pattern) coefficients | | /** | |
| for | | * This structure encapsulates the detector AM (beam pattern) coefficients | |
| | | for | |
| * one source at one instance in time. | | * one source at one instance in time. | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagLALDetAMResponse | | tagLALDetAMResponse | |
| { | | { | |
| REAL4 plus; /**< Detector response to \f$+\f$-polarized gravitational ra
diation */ | | REAL4 plus; /**< Detector response to \f$+\f$-polarized gravitational ra
diation */ | |
| REAL4 cross; /**< Detector response to \f$\times\f$-polarized gravitation
al radiation */ | | REAL4 cross; /**< Detector response to \f$\times\f$-polarized gravitation
al radiation */ | |
| REAL4 scalar; /**< Detector response to scalar gravitational radia
tion (NB: ignored at present -- scalar response computation not yet impleme
nted) */ | | REAL4 scalar; /**< Detector response to scalar gravitational radia
tion (NB: ignored at present -- scalar response computation not yet impleme
nted) */ | |
| } | | } | |
| LALDetAMResponse; | | LALDetAMResponse; | |
| | | | |
|
| /** This structure aggregates together three ::REAL4TimeSeries objects cont | | /** | |
| aining | | * This structure aggregates together three ::REAL4TimeSeries objects conta | |
| | | ining | |
| * time series of detector AM response. | | * time series of detector AM response. | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagLALDetAMResponseSeries | | tagLALDetAMResponseSeries | |
| { | | { | |
| REAL4TimeSeries *pPlus; /**< timeseries of detector response to \f$+
\f$-polarized gravitational radiation */ | | REAL4TimeSeries *pPlus; /**< timeseries of detector response to \f$+
\f$-polarized gravitational radiation */ | |
| REAL4TimeSeries *pCross; /**< timeseries of detector response to \f$\
times\f$-polarized gravitational radiation */ | | REAL4TimeSeries *pCross; /**< timeseries of detector response to \f$\
times\f$-polarized gravitational radiation */ | |
| REAL4TimeSeries *pScalar; /**< timeseries of detector response to scal
ar gravitational radiation (NB: not yet implemented.) */ | | REAL4TimeSeries *pScalar; /**< timeseries of detector response to scal
ar gravitational radiation (NB: not yet implemented.) */ | |
| } | | } | |
| LALDetAMResponseSeries; | | LALDetAMResponseSeries; | |
| | | | |
|
| /** This structure encapsulates time and sampling information for computing | | /** | |
| a | | * This structure encapsulates time and sampling information for computing | |
| | | a | |
| * ::LALDetAMResponseSeries. Its fields correspond to some fields of the | | * ::LALDetAMResponseSeries. Its fields correspond to some fields of the | |
| * TimeSeries structures for easy conversion. | | * TimeSeries structures for easy conversion. | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagLALTimeIntervalAndNSample | | tagLALTimeIntervalAndNSample | |
| { | | { | |
| LIGOTimeGPS epoch; /**< The start time \f$t_0\f$ of the time se
ries */ | | LIGOTimeGPS epoch; /**< The start time \f$t_0\f$ of the time se
ries */ | |
| REAL8 deltaT; /**< The sampling interval \f$\Delta t\f$, i
n seconds */ | | REAL8 deltaT; /**< The sampling interval \f$\Delta t\f$, i
n seconds */ | |
| UINT4 nSample; /**< The total number of samples to be compu
ted */ | | UINT4 nSample; /**< The total number of samples to be compu
ted */ | |
| } | | } | |
| | | | |
| skipping to change at line 176 | | skipping to change at line 182 | |
| | | | |
| void | | void | |
| LALComputeDetAMResponse( LALStatus *status, | | LALComputeDetAMResponse( LALStatus *status, | |
| LALDetAMResponse *pResponse, | | LALDetAMResponse *pResponse, | |
| const LALDetAndSource *pDetAndSrc, | | const LALDetAndSource *pDetAndSrc, | |
| const LIGOTimeGPS *gps); | | const LIGOTimeGPS *gps); | |
| | | | |
| void XLALComputeDetAMResponse( | | void XLALComputeDetAMResponse( | |
| double *fplus, | | double *fplus, | |
| double *fcross, | | double *fcross, | |
|
| REAL4 D[3][3], | | const REAL4 D[3][3], | |
| const double ra, | | const double ra, | |
| const double dec, | | const double dec, | |
| const double psi, | | const double psi, | |
| const double gmst | | const double gmst | |
| ); | | ); | |
| | | | |
| void XLALComputeDetAMResponseExtraModes( | | void XLALComputeDetAMResponseExtraModes( | |
| double *fplus, | | double *fplus, | |
| double *fcross, | | double *fcross, | |
| double *fb, | | double *fb, | |
| double *fl, | | double *fl, | |
| double *fx, | | double *fx, | |
| double *fy, | | double *fy, | |
|
| REAL4 D[3][3], | | const REAL4 D[3][3], | |
| const double ra, | | const double ra, | |
| const double dec, | | const double dec, | |
| const double psi, | | const double psi, | |
| const double gmst | | const double gmst | |
| ); | | ); | |
| | | | |
| /* | | /* | |
| * Gives a time series of the detector's response to plus and cross | | * Gives a time series of the detector's response to plus and cross | |
| * polarization | | * polarization | |
| */ | | */ | |
| void | | void | |
| LALComputeDetAMResponseSeries( LALStatus *status, | | LALComputeDetAMResponseSeries( LALStatus *status, | |
| LALDetAMResponseSeries *pResponseSer
ies, | | LALDetAMResponseSeries *pResponseSer
ies, | |
| const LALDetAndSource *pDetAndSourc
e, | | const LALDetAndSource *pDetAndSourc
e, | |
| const LALTimeIntervalAndNSample *pTimeInfo); | | const LALTimeIntervalAndNSample *pTimeInfo); | |
| | | | |
| int XLALComputeDetAMResponseSeries( | | int XLALComputeDetAMResponseSeries( | |
| REAL4TimeSeries **fplus, | | REAL4TimeSeries **fplus, | |
| REAL4TimeSeries **fcross, | | REAL4TimeSeries **fcross, | |
|
| REAL4 D[3][3], | | const REAL4 D[3][3], | |
| const double ra, | | const double ra, | |
| const double dec, | | const double dec, | |
| const double psi, | | const double psi, | |
| const LIGOTimeGPS *start, | | const LIGOTimeGPS *start, | |
| const double deltaT, | | const double deltaT, | |
| const int n | | const int n | |
| ); | | ); | |
| | | | |
| int XLALComputeDetAMResponseExtraModesSeries( | | int XLALComputeDetAMResponseExtraModesSeries( | |
| REAL4TimeSeries **fplus, | | REAL4TimeSeries **fplus, | |
| REAL4TimeSeries **fcross, | | REAL4TimeSeries **fcross, | |
| REAL4TimeSeries **fb, | | REAL4TimeSeries **fb, | |
| REAL4TimeSeries **fl, | | REAL4TimeSeries **fl, | |
| REAL4TimeSeries **fx, | | REAL4TimeSeries **fx, | |
| REAL4TimeSeries **fy, | | REAL4TimeSeries **fy, | |
|
| REAL4 D[3][3], | | const REAL4 D[3][3], | |
| const double ra, | | const double ra, | |
| const double dec, | | const double dec, | |
| const double psi, | | const double psi, | |
| const LIGOTimeGPS *start, | | const LIGOTimeGPS *start, | |
| const double deltaT, | | const double deltaT, | |
| const int n | | const int n | |
| ); | | ); | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| | | | |
End of changes. 11 change blocks. |
| 56 lines changed or deleted | | 64 lines changed or added | |
|
| FlatLatticeTiling.h | | FlatLatticeTiling.h | |
|
| // | | /* | |
| // Copyright (C) 2007, 2008, 2012 Karl Wette | | * Copyright (C) 2007, 2008, 2012 Karl Wette | |
| // | | * | |
| // This program is free software; you can redistribute it and/or modify | | * This program is free software; you can redistribute it and/or modify | |
| // it under the terms of the GNU General Public License as published by | | * it under the terms of the GNU General Public License as published by | |
| // the Free Software Foundation; either version 2 of the License, or | | * the Free Software Foundation; either version 2 of the License, or | |
| // (at your option) any later version. | | * (at your option) any later version. | |
| // | | * | |
| // This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| // GNU General Public License for more details. | | * GNU General Public License for more details. | |
| // | | * | |
| // You should have received a copy of the GNU General Public License | | * You should have received a copy of the GNU General Public License | |
| // along with with program; see the file COPYING. If not, write to the | | * along with with program; see the file COPYING. If not, write to the | |
| // Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, | |
| // MA 02111-1307 USA | | * MA 02111-1307 USA | |
| // | | */ | |
| #ifndef _FLATLATTICETILING_H | | #ifndef _FLATLATTICETILING_H | |
| #define _FLATLATTICETILING_H | | #define _FLATLATTICETILING_H | |
| | | | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| | | | |
| #include <gsl/gsl_vector.h> | | #include <gsl/gsl_vector.h> | |
| #include <gsl/gsl_matrix.h> | | #include <gsl/gsl_matrix.h> | |
| | | | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| #include <lal/Random.h> | | #include <lal/Random.h> | |
| #include <lal/GSLSupport.h> | | #include <lal/GSLSupport.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| /// | | /** | |
| /// \addtogroup FlatLatticeTiling_h | | * \addtogroup FlatLatticeTiling_h | |
| /// \author Karl Wette | | * \author Karl Wette | |
| /// \brief Lattice-based template generation for flat metric parameter spac | | * \brief Lattice-based template generation for flat metric parameter spac | |
| es | | es | |
| /// | | * | |
| /// @{ | | * @{ | |
| | | */ | |
| /// | | | |
| /// Flat lattice tiling bound function | | /** Flat lattice tiling bound function */ | |
| /// | | | |
| typedef void (*FlatLatticeBound)( | | typedef void (*FlatLatticeBound)( | |
|
| const size_t dimension, ///< [in] Dimension on which bound applies | | const size_t dimension, /**< [in] Dimension on which bound applies * | |
| const gsl_vector_uint* bound, ///< [in] Indices of current bounds | | / | |
| const gsl_vector* point, ///< [in] Point on which to find bounds | | const gsl_vector_uint* bound, /**< [in] Indices of current bounds | |
| const void* data, ///< [in] Arbitrary data describing paramete | | */ | |
| r space | | const gsl_vector* point, /**< [in] Point on which to find bounds */ | |
| const gsl_vector* incr, ///< [in] Increments of the lattice tiling g | | const void* data, /**< [in] Arbitrary data describing paramete | |
| enerator | | r space */ | |
| const gsl_vector* bbox, ///< [in] Metric ellipse bounding box extent | | const gsl_vector* incr, /**< [in] Increments of the lattice tiling g | |
| s | | enerator */ | |
| gsl_vector* lower, ///< [out] Lower bounds on point in dimensio | | const gsl_vector* bbox, /**< [in] Metric ellipse bounding box extent | |
| n | | s */ | |
| gsl_vector* upper, ///< [out] Upper bounds on point in dimensio | | gsl_vector* lower, /**< [out] Lower bounds on point in dimensio | |
| n | | n */ | |
| double* lower_pad, ///< [out] Padding of lower parameter space | | gsl_vector* upper, /**< [out] Upper bounds on point in dimensio | |
| bounds | | n */ | |
| double* upper_pad ///< [out] Padding of upper parameter space | | double* lower_pad, /**< [out] Padding of lower parameter space | |
| bounds | | bounds */ | |
| | | double* upper_pad /**< [out] Padding of upper parameter space | |
| | | bounds */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Flat tiling lattice generator function */ | |
| /// Flat tiling lattice generator function | | | |
| /// | | | |
| typedef int (*FlatLatticeGenerator)( | | typedef int (*FlatLatticeGenerator)( | |
|
| const size_t dimensions, ///< [in] Number of dimensions | | const size_t dimensions, /**< [in] Number of dimensions */ | |
| gsl_matrix** generator, ///< [out] Generator matrix | | gsl_matrix** generator, /**< [out] Generator matrix */ | |
| double* norm_thickness ///< [out] Normalised thickness | | double* norm_thickness /**< [out] Normalised thickness */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Flat lattice tiling state structure */ | |
| /// Flat lattice tiling state structure | | | |
| /// | | | |
| typedef struct tagFlatLatticeTiling FlatLatticeTiling; | | typedef struct tagFlatLatticeTiling FlatLatticeTiling; | |
| | | | |
|
| /// | | /** Create a new flat lattice tiling state structure */ | |
| /// Create a new flat lattice tiling state structure | | | |
| /// | | | |
| FlatLatticeTiling* XLALCreateFlatLatticeTiling( | | FlatLatticeTiling* XLALCreateFlatLatticeTiling( | |
|
| const size_t dimensions ///< [in] Number of parameter space dimensio
ns | | const size_t dimensions /**< [in] Number of parameter space dimensio
ns */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Destroy a flat lattice tiling state structure */ | |
| /// Destroy a flat lattice tiling state structure | | | |
| /// | | | |
| void XLALDestroyFlatLatticeTiling( | | void XLALDestroyFlatLatticeTiling( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Return the number of dimensions being tiled */ | |
| /// Return the number of dimensions being tiled | | | |
| /// | | | |
| size_t XLALGetFlatLatticeDimensions( | | size_t XLALGetFlatLatticeDimensions( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(GET_OBJECT(XLALGetFlatLatticePoint)); | | SWIGLAL(RETURNS_PROPERTY(XLALGetFlatLatticePoint)); | |
| #endif | | #endif | |
|
| /// | | /** Return the current lattice tiling parameter space point */ | |
| /// Return the current lattice tiling parameter space point | | | |
| /// | | | |
| const gsl_vector* XLALGetFlatLatticePoint( | | const gsl_vector* XLALGetFlatLatticePoint( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Return the current number of flat lattice tiling parameter space points | |
| /// Return the current number of flat lattice tiling parameter space points | | */ | |
| /// | | | |
| unsigned long XLALGetFlatLatticePointCount( | | unsigned long XLALGetFlatLatticePointCount( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Return the increment vectors which are used to generate the lattice. */ | |
| /// Return the increment vectors which are used to generate the lattice. | | | |
| /// | | | |
| gsl_matrix* XLALGetFlatLatticeIncrements( | | gsl_matrix* XLALGetFlatLatticeIncrements( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Set a parameter space bound on the flat lattice tiling */ | |
| /// Set a parameter space bound on the flat lattice tiling | | | |
| /// | | | |
| int XLALSetFlatLatticeBound( | | int XLALSetFlatLatticeBound( | |
|
| FlatLatticeTiling* tiling, ///< [in] Tiling state | | FlatLatticeTiling* tiling, /**< [in] Tiling state */ | |
| const size_t dimension, ///< [in] Dimension on which bound a | | const size_t dimension, /**< [in] Dimension on which bound a | |
| pplies | | pplies */ | |
| const bool singular, ///< [in] Is bound composed of singl | | const bool singular, /**< [in] Is bound composed of singl | |
| e points? | | e points? */ | |
| const FlatLatticeBound func, ///< [in] Parameter space bound func | | const FlatLatticeBound func, /**< [in] Parameter space bound func | |
| tion | | tion */ | |
| void* data ///< [in] Arbitrary data describing | | void* data /**< [in] Arbitrary data describing | |
| parameter space | | parameter space */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Set the flat tiling lattice generator */ | |
| /// Set the flat tiling lattice generator | | | |
| /// | | | |
| int XLALSetFlatLatticeGenerator( | | int XLALSetFlatLatticeGenerator( | |
|
| FlatLatticeTiling* tiling, ///< [in] Tiling state | | FlatLatticeTiling* tiling, /**< [in] Tiling state */ | |
| const FlatLatticeGenerator generator ///< [in] Lattice generator function | | const FlatLatticeGenerator generator /**< [in] Lattice generator function | |
| | | */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Set the flat lattice tiling metric and maximum mismatch */ | |
| /// Set the flat lattice tiling metric and maximum mismatch | | | |
| /// | | | |
| int XLALSetFlatLatticeMetric( | | int XLALSetFlatLatticeMetric( | |
|
| FlatLatticeTiling* tiling, ///< [in] Tiling state | | FlatLatticeTiling* tiling, /**< [in] Tiling state */ | |
| const gsl_matrix* metric, ///< [in] Parameter space metric | | const gsl_matrix* metric, /**< [in] Parameter space metric */ | |
| const double max_mismatch ///< [in] Maximum prescribed mismatc | | const double max_mismatch /**< [in] Maximum prescribed mismatc | |
| h | | h */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Move to the next point in the flat lattice tiling parameter space. */ | |
| /// Move to the next point in the flat lattice tiling parameter space. | | /** Returns the index of the lowest dimension where the point has changed, | |
| /// Returns the index of the lowest dimension where the point has changed, | | */ | |
| /// or a negative number when the template bank is exhausted. | | /** or a negative number when the template bank is exhausted. */ | |
| /// | | | |
| int XLALNextFlatLatticePoint( | | int XLALNextFlatLatticePoint( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Return to the beginning of a flat lattice tiling */ | |
| /// Return to the beginning of a flat lattice tiling | | | |
| /// | | | |
| int XLALRestartFlatLatticeTiling( | | int XLALRestartFlatLatticeTiling( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Calculate the total number of flat lattice tiling parameter space point | |
| /// Calculate the total number of flat lattice tiling parameter space point | | s */ | |
| s | | | |
| /// | | | |
| unsigned long XLALCountTotalFlatLatticePoints( | | unsigned long XLALCountTotalFlatLatticePoints( | |
|
| FlatLatticeTiling* tiling ///< [in] Tiling state | | FlatLatticeTiling* tiling /**< [in] Tiling state */ | |
| ); | | ); | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(INOUT_STRUCTS(gsl_matrix**, random_points, workspace)); | | SWIGLAL(INOUT_STRUCTS(gsl_matrix**, random_points, workspace)); | |
| SWIGLAL(INOUT_STRUCTS(gsl_vector**, nearest_distances)); | | SWIGLAL(INOUT_STRUCTS(gsl_vector**, nearest_distances)); | |
| SWIGLAL(INOUT_STRUCTS(gsl_vector_ulong**, nearest_indices)); | | SWIGLAL(INOUT_STRUCTS(gsl_vector_ulong**, nearest_indices)); | |
| #endif | | #endif | |
|
| /// | | /** Generate random points within the flat lattice tiling parameter space, | |
| /// Generate random points within the flat lattice tiling parameter space, | | */ | |
| /// then calculate the nearest flat lattice point to each random point | | /** then calculate the nearest flat lattice point to each random point */ | |
| /// | | | |
| int XLALNearestFlatLatticePointToRandomPoints( | | int XLALNearestFlatLatticePointToRandomPoints( | |
|
| FlatLatticeTiling* tiling, ///< [in] Tiling state | | FlatLatticeTiling* tiling, /**< [in] Tiling state */ | |
| RandomParams* rng, ///< [in] Random number generator | | RandomParams* rng, /**< [in] Random number generator */ | |
| const size_t num_random_points, ///< [in] Number of random points to | | const size_t num_random_points, /**< [in] Number of random points to | |
| generate | | generate */ | |
| gsl_matrix** random_points, ///< [in/out] Pointer to matrix of r | | gsl_matrix** random_points, /**< [in/out] Pointer to matrix of r | |
| andom points | | andom points */ | |
| gsl_vector_ulong** nearest_indices, ///< [in/out] Pointer to vector of i | | gsl_vector_ulong** nearest_indices, /**< [in/out] Pointer to vector of i | |
| ndices of nearest lattice point | | ndices of nearest lattice point */ | |
| gsl_vector** nearest_distances, ///< [in/out] Pointer to vector of d | | gsl_vector** nearest_distances, /**< [in/out] Pointer to vector of d | |
| istances to nearest lattice point | | istances to nearest lattice point */ | |
| gsl_matrix** workspace ///< [in/out] Pointer to workspace m | | gsl_matrix** workspace /**< [in/out] Pointer to workspace m | |
| atrix for computing distances | | atrix for computing distances */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Find the bounding box of the mismatch ellipses of a metric */ | |
| /// Find the bounding box of the mismatch ellipses of a metric | | | |
| /// | | | |
| gsl_vector* XLALMetricEllipseBoundingBox( | | gsl_vector* XLALMetricEllipseBoundingBox( | |
|
| const gsl_matrix* metric, ///< [in] Metric to bound | | const gsl_matrix* metric, /**< [in] Metric to bound */ | |
| const double max_mismatch ///< [in] Maximum mismatch with respect to m | | const double max_mismatch /**< [in] Maximum mismatch with respect to m | |
| etric | | etric */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Find the lattice increment vectors for a given metric and mismatch */ | |
| /// Find the lattice increment vectors for a given metric and mismatch | | | |
| /// | | | |
| gsl_matrix* XLALMetricLatticeIncrements( | | gsl_matrix* XLALMetricLatticeIncrements( | |
|
| const FlatLatticeGenerator generator, ///< [in] Lattice generator | | const FlatLatticeGenerator generator, /**< [in] Lattice generator | |
| function | | function */ | |
| const gsl_matrix* metric, ///< [in] Parameter space metric | | const gsl_matrix* metric, /**< [in] Parameter space metric */ | |
| const double max_mismatch ///< [in] Maximum prescribed mismatc | | const double max_mismatch /**< [in] Maximum prescribed mismatc | |
| h | | h */ | |
| ); | | ); | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(FUNCTION_POINTER(XLALCubicLatticeGenerator)); | | SWIGLAL(FUNCTION_POINTER(XLALCubicLatticeGenerator)); | |
| #endif | | #endif | |
|
| /// | | /** Calculate the generator matrix for a cubic (\f$Z_n\f$) lattice */ | |
| /// Calculate the generator matrix for a cubic (\f$Z_n\f$) lattice | | | |
| /// | | | |
| int XLALCubicLatticeGenerator( | | int XLALCubicLatticeGenerator( | |
|
| const size_t dimensions, ///< [in] Number of dimensions | | const size_t dimensions, /**< [in] Number of dimensions */ | |
| gsl_matrix** generator, ///< [out] Generator matrix | | gsl_matrix** generator, /**< [out] Generator matrix */ | |
| double* norm_thickness ///< [out] Normalised thickness | | double* norm_thickness /**< [out] Normalised thickness */ | |
| ); | | ); | |
| | | | |
|
| #ifdef SWIG // SWIG interface directives | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(FUNCTION_POINTER(XLALAnstarLatticeGenerator)); | | SWIGLAL(FUNCTION_POINTER(XLALAnstarLatticeGenerator)); | |
| #endif | | #endif | |
|
| /// | | /** Calculate the generator matrix for a \f$A_n^*\f$ lattice */ | |
| /// Calculate the generator matrix for a \f$A_n^*\f$ lattice | | | |
| /// | | | |
| int XLALAnstarLatticeGenerator( | | int XLALAnstarLatticeGenerator( | |
|
| const size_t dimensions, ///< [in] Number of dimensions | | const size_t dimensions, /**< [in] Number of dimensions */ | |
| gsl_matrix** generator, ///< [out] Generator matrix | | gsl_matrix** generator, /**< [out] Generator matrix */ | |
| double* norm_thickness ///< [out] Normalised thickness | | double* norm_thickness /**< [out] Normalised thickness */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Set a constant parameter space bound, given by the minimum and */ | |
| /// Set a constant parameter space bound, given by the minimum and | | /** maximum of the two supplied bounds, on the flat lattice tiling */ | |
| /// maximum of the two supplied bounds, on the flat lattice tiling | | | |
| /// | | | |
| int XLALSetFlatLatticeConstantBound( | | int XLALSetFlatLatticeConstantBound( | |
|
| FlatLatticeTiling* tiling, ///< [in] Tiling state | | FlatLatticeTiling* tiling, /**< [in] Tiling state */ | |
| const size_t dimension, ///< [in] Dimension on which bound applies | | const size_t dimension, /**< [in] Dimension on which bound applies * | |
| const double bound1, ///< [in] First bound on dimension | | / | |
| const double bound2 ///< [in] Second bound on dimension | | const double bound1, /**< [in] First bound on dimension */ | |
| | | const double bound2 /**< [in] Second bound on dimension */ | |
| ); | | ); | |
| | | | |
|
| /// | | /** Set elliptical bounds in two dimensions on the flat lattice tiling */ | |
| /// Set elliptical bounds in two dimensions on the flat lattice tiling | | | |
| /// | | | |
| int XLALSetFlatLatticeEllipticalBounds( | | int XLALSetFlatLatticeEllipticalBounds( | |
|
| FlatLatticeTiling* tiling, ///< [in] Tiling state | | FlatLatticeTiling* tiling, /**< [in] Tiling state */ | |
| const size_t dimension, ///< [in] Dimension of X bound (Y bound is o | | const size_t dimension, /**< [in] Dimension of X bound (Y bound is o | |
| ne higher) | | ne higher) */ | |
| const double x_centre, ///< [in] X centre of ellipse | | const double x_centre, /**< [in] X centre of ellipse */ | |
| const double y_centre, ///< [in] Y centre of ellipse | | const double y_centre, /**< [in] Y centre of ellipse */ | |
| const double x_semi, ///< [in] Length of X semi-diameter | | const double x_semi, /**< [in] Length of X semi-diameter */ | |
| const double y_semi ///< [in] Length of Y semi-diameter | | const double y_semi /**< [in] Length of Y semi-diameter */ | |
| ); | | ); | |
| | | | |
|
| /// @} | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 49 change blocks. |
| 184 lines changed or deleted | | 148 lines changed or added | |
|
| FrequencySeries.h | | FrequencySeries.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| #include <stddef.h> | | #include <stddef.h> | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup FrequencySeriesManipulation | | * \addtogroup FrequencySeriesManipulation | |
| \author Kipp Cannon <kipp@gravity.phys.uwm.edu> | | * \author Kipp Cannon <kipp@gravity.phys.uwm.edu> | |
| | | * | |
| \brief This is a suite of functions for creating, destroying, and manipulat | | * \brief This is a suite of functions for creating, destroying, and manipu | |
| ing LAL | | lating LAL | |
| frequency series. One pair of functions (the XLAL version and its LAL | | * frequency series. One pair of functions (the XLAL version and its LAL | |
| counterpart) is available for each method and frequency series type. For | | * counterpart) is available for each method and frequency series type. Fo | |
| example XLALCreateREAL4FrequencySeries() is available for creating | | r | |
| frequency series of \c REAL4 data, and the LAL-stype wrapper | | * example XLALCreateREAL4FrequencySeries() is available for creating | |
| LALCreateREAL4FrequencySeries() is provided which is equivalent to | | * frequency series of \c REAL4 data, and the LAL-stype wrapper | |
| the XLAL version in all respects except that it adheres to the LAL calling | | * LALCreateREAL4FrequencySeries() is provided which is equivalent to | |
| conventions (eg.\ it takes a \c LALStatus pointer as its first | | * the XLAL version in all respects except that it adheres to the LAL calli | |
| argument, its return type is \c void, etc.). | | ng | |
| | | * conventions (eg.\ it takes a \c LALStatus pointer as its first | |
| */ | | * argument, its return type is \c void, etc.). | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| /** \name Creation Functions | | /** | |
| | | * \name Creation Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/FrequencySeries.h> | | * \code | |
| | | * #include <lal/FrequencySeries.h> | |
| XLALCreate<frequencyseriestype>() | | * | |
| LALCreate<frequencyseriestype>() | | * XLALCreate<frequencyseriestype>() | |
| \endcode | | * LALCreate<frequencyseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions create LAL frequency series. An XLAL function returns a | | * | |
| pointer to the newly created series or \c NULL on failure. The LAL | | * These functions create LAL frequency series. An XLAL function returns a | |
| counterpart accepts the address of a pointer which it fills with the | | * pointer to the newly created series or \c NULL on failure. The LAL | |
| address of the newly created series or \c NULL on failure. | | * counterpart accepts the address of a pointer which it fills with the | |
| Additionally, the LAL wrapper provides standard LAL-style error checking | | * address of the newly created series or \c NULL on failure. | |
| via a \c LALStatus pointer. | | * Additionally, the LAL wrapper provides standard LAL-style error checking | |
| | | * via a \c LALStatus pointer. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8FrequencySeries *XLALCreateCOMPLEX8FrequencySeries ( const CHAR *na
me, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sample
Units, size_t length ); | | COMPLEX8FrequencySeries *XLALCreateCOMPLEX8FrequencySeries ( const CHAR *na
me, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sample
Units, size_t length ); | |
| COMPLEX16FrequencySeries *XLALCreateCOMPLEX16FrequencySeries ( const CHAR *
name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *samp
leUnits, size_t length ); | | COMPLEX16FrequencySeries *XLALCreateCOMPLEX16FrequencySeries ( const CHAR *
name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *samp
leUnits, size_t length ); | |
| REAL4FrequencySeries *XLALCreateREAL4FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | | REAL4FrequencySeries *XLALCreateREAL4FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | |
| REAL8FrequencySeries *XLALCreateREAL8FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | | REAL8FrequencySeries *XLALCreateREAL8FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | |
| INT2FrequencySeries *XLALCreateINT2FrequencySeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s
ize_t length ); | | INT2FrequencySeries *XLALCreateINT2FrequencySeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s
ize_t length ); | |
| INT4FrequencySeries *XLALCreateINT4FrequencySeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s
ize_t length ); | | INT4FrequencySeries *XLALCreateINT4FrequencySeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s
ize_t length ); | |
| INT8FrequencySeries *XLALCreateINT8FrequencySeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s
ize_t length ); | | INT8FrequencySeries *XLALCreateINT8FrequencySeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, s
ize_t length ); | |
| UINT2FrequencySeries *XLALCreateUINT2FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | | UINT2FrequencySeries *XLALCreateUINT2FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | |
| UINT4FrequencySeries *XLALCreateUINT4FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | | UINT4FrequencySeries *XLALCreateUINT4FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | |
| UINT8FrequencySeries *XLALCreateUINT8FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | | UINT8FrequencySeries *XLALCreateUINT8FrequencySeries ( const CHAR *name, co
nst LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits,
size_t length ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Destruction Functions | | /** | |
| | | * \name Destruction Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/FrequencySeries.h> | | * \code | |
| | | * #include <lal/FrequencySeries.h> | |
| XLALDestroy<frequencyseriestype>() | | * | |
| LALDestroy<frequencyseriestype>() | | * XLALDestroy<frequencyseriestype>() | |
| \endcode | | * LALDestroy<frequencyseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions free all memory associated with a LAL frequency series. It | | * | |
| is safe to pass \c NULL to these functions. | | * These functions free all memory associated with a LAL frequency series. | |
| | | It | |
| */ | | * is safe to pass \c NULL to these functions. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| void XLALDestroyCOMPLEX8FrequencySeries ( COMPLEX8FrequencySeries *series )
; | | void XLALDestroyCOMPLEX8FrequencySeries ( COMPLEX8FrequencySeries *series )
; | |
| void XLALDestroyCOMPLEX16FrequencySeries ( COMPLEX16FrequencySeries *series
); | | void XLALDestroyCOMPLEX16FrequencySeries ( COMPLEX16FrequencySeries *series
); | |
| void XLALDestroyREAL4FrequencySeries ( REAL4FrequencySeries *series ); | | void XLALDestroyREAL4FrequencySeries ( REAL4FrequencySeries *series ); | |
| void XLALDestroyREAL8FrequencySeries ( REAL8FrequencySeries *series ); | | void XLALDestroyREAL8FrequencySeries ( REAL8FrequencySeries *series ); | |
| void XLALDestroyINT2FrequencySeries ( INT2FrequencySeries *series ); | | void XLALDestroyINT2FrequencySeries ( INT2FrequencySeries *series ); | |
| void XLALDestroyINT4FrequencySeries ( INT4FrequencySeries *series ); | | void XLALDestroyINT4FrequencySeries ( INT4FrequencySeries *series ); | |
| void XLALDestroyINT8FrequencySeries ( INT8FrequencySeries *series ); | | void XLALDestroyINT8FrequencySeries ( INT8FrequencySeries *series ); | |
| void XLALDestroyUINT2FrequencySeries ( UINT2FrequencySeries *series ); | | void XLALDestroyUINT2FrequencySeries ( UINT2FrequencySeries *series ); | |
| void XLALDestroyUINT4FrequencySeries ( UINT4FrequencySeries *series ); | | void XLALDestroyUINT4FrequencySeries ( UINT4FrequencySeries *series ); | |
| void XLALDestroyUINT8FrequencySeries ( UINT8FrequencySeries *series ); | | void XLALDestroyUINT8FrequencySeries ( UINT8FrequencySeries *series ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Cutting Functions | | /** | |
| | | * \name Cutting Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/FrequencySeries.h> | | * \code | |
| | | * #include <lal/FrequencySeries.h> | |
| XLALCut<frequencyseriestype>() | | * | |
| \endcode | | * XLALCut<frequencyseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions create a new frequency series by extracting a section of an | | * | |
| existing frequency series. | | * These functions create a new frequency series by extracting a section of | |
| | | an | |
| */ | | * existing frequency series. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8FrequencySeries *XLALCutCOMPLEX8FrequencySeries ( const COMPLEX8Fre
quencySeries *series, size_t first, size_t length ); | | COMPLEX8FrequencySeries *XLALCutCOMPLEX8FrequencySeries ( const COMPLEX8Fre
quencySeries *series, size_t first, size_t length ); | |
| COMPLEX16FrequencySeries *XLALCutCOMPLEX16FrequencySeries ( const COMPLEX16
FrequencySeries *series, size_t first, size_t length ); | | COMPLEX16FrequencySeries *XLALCutCOMPLEX16FrequencySeries ( const COMPLEX16
FrequencySeries *series, size_t first, size_t length ); | |
| REAL4FrequencySeries *XLALCutREAL4FrequencySeries ( const REAL4FrequencySer
ies *series, size_t first, size_t length ); | | REAL4FrequencySeries *XLALCutREAL4FrequencySeries ( const REAL4FrequencySer
ies *series, size_t first, size_t length ); | |
| REAL8FrequencySeries *XLALCutREAL8FrequencySeries ( const REAL8FrequencySer
ies *series, size_t first, size_t length ); | | REAL8FrequencySeries *XLALCutREAL8FrequencySeries ( const REAL8FrequencySer
ies *series, size_t first, size_t length ); | |
| INT2FrequencySeries *XLALCutINT2FrequencySeries ( const INT2FrequencySeries
*series, size_t first, size_t length ); | | INT2FrequencySeries *XLALCutINT2FrequencySeries ( const INT2FrequencySeries
*series, size_t first, size_t length ); | |
| INT4FrequencySeries *XLALCutINT4FrequencySeries ( const INT4FrequencySeries
*series, size_t first, size_t length ); | | INT4FrequencySeries *XLALCutINT4FrequencySeries ( const INT4FrequencySeries
*series, size_t first, size_t length ); | |
| INT8FrequencySeries *XLALCutINT8FrequencySeries ( const INT8FrequencySeries
*series, size_t first, size_t length ); | | INT8FrequencySeries *XLALCutINT8FrequencySeries ( const INT8FrequencySeries
*series, size_t first, size_t length ); | |
| UINT2FrequencySeries *XLALCutUINT2FrequencySeries ( const UINT2FrequencySer
ies *series, size_t first, size_t length ); | | UINT2FrequencySeries *XLALCutUINT2FrequencySeries ( const UINT2FrequencySer
ies *series, size_t first, size_t length ); | |
| UINT4FrequencySeries *XLALCutUINT4FrequencySeries ( const UINT4FrequencySer
ies *series, size_t first, size_t length ); | | UINT4FrequencySeries *XLALCutUINT4FrequencySeries ( const UINT4FrequencySer
ies *series, size_t first, size_t length ); | |
| UINT8FrequencySeries *XLALCutUINT8FrequencySeries ( const UINT8FrequencySer
ies *series, size_t first, size_t length ); | | UINT8FrequencySeries *XLALCutUINT8FrequencySeries ( const UINT8FrequencySer
ies *series, size_t first, size_t length ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Resizing Functions | | /** | |
| | | * \name Resizing Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/FrequencySeries.h> | | * \code | |
| | | * #include <lal/FrequencySeries.h> | |
| XLALResize<frequencyseriestype>() | | * | |
| XLALShrink<frequencyseriestype>() | | * XLALResize<frequencyseriestype>() | |
| LALShrink<frequencyseriestype>() | | * XLALShrink<frequencyseriestype>() | |
| \endcode | | * LALShrink<frequencyseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions resize an existing frequency series. The new frequency | | * | |
| series will have the given length, and its contents will consist of that | | * These functions resize an existing frequency series. The new frequency | |
| part of the original time series that started at sample \c first. If | | * series will have the given length, and its contents will consist of that | |
| \c first is negative, then the new time series is padded at the start | | * part of the original time series that started at sample \c first. If | |
| by that many samples. The frequency series' heterodyne frequency, | | * \c first is negative, then the new time series is padded at the start | |
| (f_{0}), is adjusted appropriately. | | * by that many samples. The frequency series' heterodyne frequency, | |
| | | * (f_{0}), is adjusted appropriately. | |
| The "Shrink" functions accept non-negative values for the parameter | | * | |
| \c first, and are retained only for historical purposes. New code | | * The "Shrink" functions accept non-negative values for the parameter | |
| should use the "Resize" variants. | | * \c first, and are retained only for historical purposes. New code | |
| | | * should use the "Resize" variants. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8FrequencySeries *XLALResizeCOMPLEX8FrequencySeries ( COMPLEX8Freque
ncySeries *series, int first, size_t length ); | | COMPLEX8FrequencySeries *XLALResizeCOMPLEX8FrequencySeries ( COMPLEX8Freque
ncySeries *series, int first, size_t length ); | |
| COMPLEX16FrequencySeries *XLALResizeCOMPLEX16FrequencySeries ( COMPLEX16Fre
quencySeries *series, int first, size_t length ); | | COMPLEX16FrequencySeries *XLALResizeCOMPLEX16FrequencySeries ( COMPLEX16Fre
quencySeries *series, int first, size_t length ); | |
| REAL4FrequencySeries *XLALResizeREAL4FrequencySeries ( REAL4FrequencySeries
*series, int first, size_t length ); | | REAL4FrequencySeries *XLALResizeREAL4FrequencySeries ( REAL4FrequencySeries
*series, int first, size_t length ); | |
| REAL8FrequencySeries *XLALResizeREAL8FrequencySeries ( REAL8FrequencySeries
*series, int first, size_t length ); | | REAL8FrequencySeries *XLALResizeREAL8FrequencySeries ( REAL8FrequencySeries
*series, int first, size_t length ); | |
| INT2FrequencySeries *XLALResizeINT2FrequencySeries ( INT2FrequencySeries *s
eries, int first, size_t length ); | | INT2FrequencySeries *XLALResizeINT2FrequencySeries ( INT2FrequencySeries *s
eries, int first, size_t length ); | |
| INT4FrequencySeries *XLALResizeINT4FrequencySeries ( INT4FrequencySeries *s
eries, int first, size_t length ); | | INT4FrequencySeries *XLALResizeINT4FrequencySeries ( INT4FrequencySeries *s
eries, int first, size_t length ); | |
| INT8FrequencySeries *XLALResizeINT8FrequencySeries ( INT8FrequencySeries *s
eries, int first, size_t length ); | | INT8FrequencySeries *XLALResizeINT8FrequencySeries ( INT8FrequencySeries *s
eries, int first, size_t length ); | |
| UINT2FrequencySeries *XLALResizeUINT2FrequencySeries ( UINT2FrequencySeries
*series, int first, size_t length ); | | UINT2FrequencySeries *XLALResizeUINT2FrequencySeries ( UINT2FrequencySeries
*series, int first, size_t length ); | |
| UINT4FrequencySeries *XLALResizeUINT4FrequencySeries ( UINT4FrequencySeries
*series, int first, size_t length ); | | UINT4FrequencySeries *XLALResizeUINT4FrequencySeries ( UINT4FrequencySeries
*series, int first, size_t length ); | |
| | | | |
| skipping to change at line 192 | | skipping to change at line 196 | |
| REAL4FrequencySeries *XLALShrinkREAL4FrequencySeries ( REAL4FrequencySeries
*series, size_t first, size_t length ); | | REAL4FrequencySeries *XLALShrinkREAL4FrequencySeries ( REAL4FrequencySeries
*series, size_t first, size_t length ); | |
| REAL8FrequencySeries *XLALShrinkREAL8FrequencySeries ( REAL8FrequencySeries
*series, size_t first, size_t length ); | | REAL8FrequencySeries *XLALShrinkREAL8FrequencySeries ( REAL8FrequencySeries
*series, size_t first, size_t length ); | |
| INT2FrequencySeries *XLALShrinkINT2FrequencySeries ( INT2FrequencySeries *s
eries, size_t first, size_t length ); | | INT2FrequencySeries *XLALShrinkINT2FrequencySeries ( INT2FrequencySeries *s
eries, size_t first, size_t length ); | |
| INT4FrequencySeries *XLALShrinkINT4FrequencySeries ( INT4FrequencySeries *s
eries, size_t first, size_t length ); | | INT4FrequencySeries *XLALShrinkINT4FrequencySeries ( INT4FrequencySeries *s
eries, size_t first, size_t length ); | |
| INT8FrequencySeries *XLALShrinkINT8FrequencySeries ( INT8FrequencySeries *s
eries, size_t first, size_t length ); | | INT8FrequencySeries *XLALShrinkINT8FrequencySeries ( INT8FrequencySeries *s
eries, size_t first, size_t length ); | |
| UINT2FrequencySeries *XLALShrinkUINT2FrequencySeries ( UINT2FrequencySeries
*series, size_t first, size_t length ); | | UINT2FrequencySeries *XLALShrinkUINT2FrequencySeries ( UINT2FrequencySeries
*series, size_t first, size_t length ); | |
| UINT4FrequencySeries *XLALShrinkUINT4FrequencySeries ( UINT4FrequencySeries
*series, size_t first, size_t length ); | | UINT4FrequencySeries *XLALShrinkUINT4FrequencySeries ( UINT4FrequencySeries
*series, size_t first, size_t length ); | |
| UINT8FrequencySeries *XLALShrinkUINT8FrequencySeries ( UINT8FrequencySeries
*series, size_t first, size_t length ); | | UINT8FrequencySeries *XLALShrinkUINT8FrequencySeries ( UINT8FrequencySeries
*series, size_t first, size_t length ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Addition Functions | | /** | |
| | | * \name Addition Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/FrequencySeries.h> | | * \code | |
| | | * #include <lal/FrequencySeries.h> | |
| XLALAdd<frequencyseriestype>() | | * | |
| \endcode | | * XLALAdd<frequencyseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions add the second argument to the first argument, returning a | | * | |
| pointer to the first argument on success or NULL on failure. The two | | * These functions add the second argument to the first argument, returning | |
| series must have the same epoch and frequency resolution, and have units | | a | |
| that differ only by a dimensionless factor. | | * pointer to the first argument on success or NULL on failure. The two | |
| | | * series must have the same epoch and frequency resolution, and have units | |
| */ | | * that differ only by a dimensionless factor. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8FrequencySeries *XLALAddCOMPLEX8FrequencySeries ( COMPLEX8Frequency
Series *arg1, const COMPLEX8FrequencySeries *arg2 ); | | COMPLEX8FrequencySeries *XLALAddCOMPLEX8FrequencySeries ( COMPLEX8Frequency
Series *arg1, const COMPLEX8FrequencySeries *arg2 ); | |
| COMPLEX16FrequencySeries *XLALAddCOMPLEX16FrequencySeries ( COMPLEX16Freque
ncySeries *arg1, const COMPLEX16FrequencySeries *arg2 ); | | COMPLEX16FrequencySeries *XLALAddCOMPLEX16FrequencySeries ( COMPLEX16Freque
ncySeries *arg1, const COMPLEX16FrequencySeries *arg2 ); | |
| REAL4FrequencySeries *XLALAddREAL4FrequencySeries ( REAL4FrequencySeries *a
rg1, const REAL4FrequencySeries *arg2 ); | | REAL4FrequencySeries *XLALAddREAL4FrequencySeries ( REAL4FrequencySeries *a
rg1, const REAL4FrequencySeries *arg2 ); | |
| REAL8FrequencySeries *XLALAddREAL8FrequencySeries ( REAL8FrequencySeries *a
rg1, const REAL8FrequencySeries *arg2 ); | | REAL8FrequencySeries *XLALAddREAL8FrequencySeries ( REAL8FrequencySeries *a
rg1, const REAL8FrequencySeries *arg2 ); | |
| INT2FrequencySeries *XLALAddINT2FrequencySeries ( INT2FrequencySeries *arg1
, const INT2FrequencySeries *arg2 ); | | INT2FrequencySeries *XLALAddINT2FrequencySeries ( INT2FrequencySeries *arg1
, const INT2FrequencySeries *arg2 ); | |
| INT4FrequencySeries *XLALAddINT4FrequencySeries ( INT4FrequencySeries *arg1
, const INT4FrequencySeries *arg2 ); | | INT4FrequencySeries *XLALAddINT4FrequencySeries ( INT4FrequencySeries *arg1
, const INT4FrequencySeries *arg2 ); | |
| INT8FrequencySeries *XLALAddINT8FrequencySeries ( INT8FrequencySeries *arg1
, const INT8FrequencySeries *arg2 ); | | INT8FrequencySeries *XLALAddINT8FrequencySeries ( INT8FrequencySeries *arg1
, const INT8FrequencySeries *arg2 ); | |
| UINT2FrequencySeries *XLALAddUINT2FrequencySeries ( UINT2FrequencySeries *a
rg1, const UINT2FrequencySeries *arg2 ); | | UINT2FrequencySeries *XLALAddUINT2FrequencySeries ( UINT2FrequencySeries *a
rg1, const UINT2FrequencySeries *arg2 ); | |
| UINT4FrequencySeries *XLALAddUINT4FrequencySeries ( UINT4FrequencySeries *a
rg1, const UINT4FrequencySeries *arg2 ); | | UINT4FrequencySeries *XLALAddUINT4FrequencySeries ( UINT4FrequencySeries *a
rg1, const UINT4FrequencySeries *arg2 ); | |
| UINT8FrequencySeries *XLALAddUINT8FrequencySeries ( UINT8FrequencySeries *a
rg1, const UINT8FrequencySeries *arg2 ); | | UINT8FrequencySeries *XLALAddUINT8FrequencySeries ( UINT8FrequencySeries *a
rg1, const UINT8FrequencySeries *arg2 ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Conjugation Functions | | /** | |
| | | * \name Conjugation Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/FrequencySeries.h> | | * \code | |
| | | * #include <lal/FrequencySeries.h> | |
| XLALConjugate<frequencyseriestype>() | | * | |
| \endcode | | * XLALConjugate<frequencyseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions replace a frequency series with its complex conjugate. | | * | |
| | | * These functions replace a frequency series with its complex conjugate. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8FrequencySeries *XLALConjugateCOMPLEX8FrequencySeries ( COMPLEX8Fre
quencySeries *series ); | | COMPLEX8FrequencySeries *XLALConjugateCOMPLEX8FrequencySeries ( COMPLEX8Fre
quencySeries *series ); | |
| COMPLEX16FrequencySeries *XLALConjugateCOMPLEX16FrequencySeries ( COMPLEX16
FrequencySeries *series ); | | COMPLEX16FrequencySeries *XLALConjugateCOMPLEX16FrequencySeries ( COMPLEX16
FrequencySeries *series ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Multiplication Functions | | /** | |
| | | * \name Multiplication Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/FrequencySeries.h> | | * \code | |
| | | * #include <lal/FrequencySeries.h> | |
| XLALMultiply<frequencyseriestype>() | | * | |
| \endcode | | * XLALMultiply<frequencyseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions multiply the first argument by the second argument, | | * | |
| returning a pointer to the first argument on success or NULL on failure. | | * These functions multiply the first argument by the second argument, | |
| The two series must have the same epoch and frequency resolution, and have | | * returning a pointer to the first argument on success or NULL on failure. | |
| units that differ only by a dimensionless factor. | | * The two series must have the same epoch and frequency resolution, and ha | |
| | | ve | |
| */ | | * units that differ only by a dimensionless factor. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8FrequencySeries *XLALMultiplyCOMPLEX8FrequencySeries ( COMPLEX8Freq
uencySeries *arg1, const COMPLEX8FrequencySeries *arg2 ); | | COMPLEX8FrequencySeries *XLALMultiplyCOMPLEX8FrequencySeries ( COMPLEX8Freq
uencySeries *arg1, const COMPLEX8FrequencySeries *arg2 ); | |
| COMPLEX16FrequencySeries *XLALMultiplyCOMPLEX16FrequencySeries ( COMPLEX16F
requencySeries *arg1, const COMPLEX16FrequencySeries *arg2 ); | | COMPLEX16FrequencySeries *XLALMultiplyCOMPLEX16FrequencySeries ( COMPLEX16F
requencySeries *arg1, const COMPLEX16FrequencySeries *arg2 ); | |
| REAL4FrequencySeries *XLALMultiplyREAL4FrequencySeries ( REAL4FrequencySeri
es *arg1, const REAL4FrequencySeries *arg2 ); | | REAL4FrequencySeries *XLALMultiplyREAL4FrequencySeries ( REAL4FrequencySeri
es *arg1, const REAL4FrequencySeries *arg2 ); | |
| REAL8FrequencySeries *XLALMultiplyREAL8FrequencySeries ( REAL8FrequencySeri
es *arg1, const REAL8FrequencySeries *arg2 ); | | REAL8FrequencySeries *XLALMultiplyREAL8FrequencySeries ( REAL8FrequencySeri
es *arg1, const REAL8FrequencySeries *arg2 ); | |
| INT2FrequencySeries *XLALMultiplyINT2FrequencySeries ( INT2FrequencySeries
*arg1, const INT2FrequencySeries *arg2 ); | | INT2FrequencySeries *XLALMultiplyINT2FrequencySeries ( INT2FrequencySeries
*arg1, const INT2FrequencySeries *arg2 ); | |
| INT4FrequencySeries *XLALMultiplyINT4FrequencySeries ( INT4FrequencySeries
*arg1, const INT4FrequencySeries *arg2 ); | | INT4FrequencySeries *XLALMultiplyINT4FrequencySeries ( INT4FrequencySeries
*arg1, const INT4FrequencySeries *arg2 ); | |
| INT8FrequencySeries *XLALMultiplyINT8FrequencySeries ( INT8FrequencySeries
*arg1, const INT8FrequencySeries *arg2 ); | | INT8FrequencySeries *XLALMultiplyINT8FrequencySeries ( INT8FrequencySeries
*arg1, const INT8FrequencySeries *arg2 ); | |
| UINT2FrequencySeries *XLALMultiplyUINT2FrequencySeries ( UINT2FrequencySeri
es *arg1, const UINT2FrequencySeries *arg2 ); | | UINT2FrequencySeries *XLALMultiplyUINT2FrequencySeries ( UINT2FrequencySeri
es *arg1, const UINT2FrequencySeries *arg2 ); | |
| UINT4FrequencySeries *XLALMultiplyUINT4FrequencySeries ( UINT4FrequencySeri
es *arg1, const UINT4FrequencySeries *arg2 ); | | UINT4FrequencySeries *XLALMultiplyUINT4FrequencySeries ( UINT4FrequencySeri
es *arg1, const UINT4FrequencySeries *arg2 ); | |
| | | | |
End of changes. 8 change blocks. |
| 146 lines changed or deleted | | 159 lines changed or added | |
|
| IIRFilter.h | | IIRFilter.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| #include <lal/LALStdlib.h> | | #include <lal/LALStdlib.h> | |
| #include <lal/ZPGFilter.h> | | #include <lal/ZPGFilter.h> | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup IIRFilter_h | | * \addtogroup IIRFilter_h | |
| \author Creighton, T. D. | | * \author Creighton, T. D. | |
| | | * | |
| \brief Provides routines to make and apply IIR filters. | | * \brief Provides routines to make and apply IIR filters. | |
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/IIRFilter.h> | | * \code | |
| \endcode | | * #include <lal/IIRFilter.h> | |
| | | * \endcode | |
| This header covers routines that create, destroy, and apply | | * | |
| generic time-domain filters, given by objects of type | | * This header covers routines that create, destroy, and apply | |
| <tt>\<datatype\>IIRFilter</tt>, where <tt>\<datatype\></tt> is either | | * generic time-domain filters, given by objects of type | |
| \c REAL4 or \c REAL8. | | * <tt>\<datatype\>IIRFilter</tt>, where <tt>\<datatype\></tt> is either | |
| | | * \c REAL4 or \c REAL8. | |
| An IIR (Infinite Impulse Response) filter is a generalized linear | | * | |
| causal time-domain filter, in which the filter output \f$y_n=y(t_n)\f$ at | | * An IIR (Infinite Impulse Response) filter is a generalized linear | |
| any sampled time \f$t_n=t_0+n\Delta t\f$ is a linear combination of the | | * causal time-domain filter, in which the filter output \f$y_n=y(t_n)\f$ a | |
| input \f$x\f$ \e and output \f$y\f$ at previous sampled times: | | t | |
| \f[ | | * any sampled time \f$t_n=t_0+n\Delta t\f$ is a linear combination of the | |
| y_n = \sum_{k=0}^M c_k x_{n-k} + \sum_{l=1}^N d_l y_{n-l} \; . | | * input \f$x\f$ \e and output \f$y\f$ at previous sampled times: | |
| \f] | | * \f[ | |
| The coefficients \f$c_k\f$ are called the direct filter coefficients, and | | * y_n = \sum_{k=0}^M c_k x_{n-k} + \sum_{l=1}^N d_l y_{n-l} \; . | |
| the coefficients \f$d_l\f$ are the recursive filter coefficients. The | | * \f] | |
| filter order is the larger of \f$M\f$ or \f$N\f$, and determines how far ba | | * The coefficients \f$c_k\f$ are called the direct filter coefficients, an | |
| ck | | d | |
| in time the filter must look to determine its next output. However, | | * the coefficients \f$d_l\f$ are the recursive filter coefficients. The | |
| the recursive nature of the filter means that the output can depend on | | * filter order is the larger of \f$M\f$ or \f$N\f$, and determines how far | |
| input arbitrarily far in the past; hence the name "infinite impulse | | back | |
| response". Nonetheless, for a well-designed, stable filter, the | | * in time the filter must look to determine its next output. However, | |
| actual filter response to an impulse should diminish rapidly beyond | | * the recursive nature of the filter means that the output can depend on | |
| some characteristic timescale. | | * input arbitrarily far in the past; hence the name "infinite impulse | |
| | | * response". Nonetheless, for a well-designed, stable filter, the | |
| Note that nonrecursive FIR (Finite Impulse Response) filters are | | * actual filter response to an impulse should diminish rapidly beyond | |
| considered a subset of IIR filters, having \f$N=0\f$. | | * some characteristic timescale. | |
| | | * | |
| For practical implementation, it is convenient to express the bilinear | | * Note that nonrecursive FIR (Finite Impulse Response) filters are | |
| equation above as two linear equations involving an auxiliary sequence | | * considered a subset of IIR filters, having \f$N=0\f$. | |
| \f$w\f$: | | * | |
| \f[ | | * For practical implementation, it is convenient to express the bilinear | |
| w_n = x_n + \sum_{l=1}^N d_l w_{n-l} \; , | | * equation above as two linear equations involving an auxiliary sequence | |
| \f] | | * \f$w\f$: | |
| \f[ | | * \f[ | |
| y_n = \sum_{k=0}^M c_k w_{n-k} \; . | | * w_n = x_n + \sum_{l=1}^N d_l w_{n-l} \; , | |
| \f] | | * \f] | |
| The equivalence of this to the first expression is not obvious, but | | * \f[ | |
| can be proven by mathematical induction. The advantage of the | | * y_n = \sum_{k=0}^M c_k w_{n-k} \; . | |
| auxiliary variable representation is twofold. First, when one is | | * \f] | |
| feeding data point by point to the filter, the filter needs only | | * The equivalence of this to the first expression is not obvious, but | |
| "remember" the previous \f$M\f$ or \f$N\f$ (whichever is larger) values of | | * can be proven by mathematical induction. The advantage of the | |
| \f$w\f$, rather than remembering the previous \f$M\f$ values of \f$x\f$ \e | | * auxiliary variable representation is twofold. First, when one is | |
| and | | * feeding data point by point to the filter, the filter needs only | |
| the previous \f$N\f$ values of \f$y\f$. Second, when filtering a large sto | | * "remember" the previous \f$M\f$ or \f$N\f$ (whichever is larger) values | |
| red | | of | |
| data vector, the filter response can be computed in place: one first | | * \f$w\f$, rather than remembering the previous \f$M\f$ values of \f$x\f$ | |
| runs forward through the vector replacing \f$x\f$ with \f$w\f$, and then | | \e and | |
| backward replacing \f$w\f$ with \f$y\f$. | | * the previous \f$N\f$ values of \f$y\f$. Second, when filtering a large | |
| | | stored | |
| Although the IIR filters in these routines are explicitly real, one | | * data vector, the filter response can be computed in place: one first | |
| can consider formally their complex response. A sinusoidal input can | | * runs forward through the vector replacing \f$x\f$ with \f$w\f$, and then | |
| thus be written as \f$x_n=X\exp(2\pi ifn\Delta t)=Xz^n\f$, where \f$X\f$ is | | * backward replacing \f$w\f$ with \f$y\f$. | |
| a | | * | |
| complex amplitude and \f$z=\exp(2\pi if\Delta t)\f$ is a complex | | * Although the IIR filters in these routines are explicitly real, one | |
| parametrization of the frequency. By linearity, the output must also | | * can consider formally their complex response. A sinusoidal input can | |
| be sinusoidal: \f$y_m=Y\exp(2\pi ifm\Delta t)=Yz^m\f$. Putting these into | | * thus be written as \f$x_n=X\exp(2\pi ifn\Delta t)=Xz^n\f$, where \f$X\f$ | |
| the bilinear equation, one can easily compute the filter's complex | | is a | |
| transfer function: | | * complex amplitude and \f$z=\exp(2\pi if\Delta t)\f$ is a complex | |
| \f[ | | * parametrization of the frequency. By linearity, the output must also | |
| T(z) = \frac{Y}{X} = \frac{\sum_{k=0}^M c_k z^{-k}} | | * be sinusoidal: \f$y_m=Y\exp(2\pi ifm\Delta t)=Yz^m\f$. Putting these in | |
| {1 - \sum_{l=1}^N d_l z^{-l}} | | to | |
| \f] | | * the bilinear equation, one can easily compute the filter's complex | |
| This can be readily converted to and from the "zeros, poles, gain" | | * transfer function: | |
| representation of a filter, which expresses \f$T(z)\f$ as a factored | | * \f[ | |
| rational function of \f$z\f$. | | * T(z) = \frac{Y}{X} = \frac{\sum_{k=0}^M c_k z^{-k}} | |
| | | * {1 - \sum_{l=1}^N d_l z^{-l}} | |
| It should also be noted that, in the routines covered by this header, | | * \f] | |
| I have adopted the convention of including a redundant recursive | | * This can be readily converted to and from the "zeros, poles, gain" | |
| coefficient \f$d_0\f$, in order to make the indexing more intuitive. For | | * representation of a filter, which expresses \f$T(z)\f$ as a factored | |
| formal correctness \f$d_0\f$ should be set to \f$-1\f$, although the filter | | * rational function of \f$z\f$. | |
| ing | | * | |
| routines never actually use this coefficient. | | * It should also be noted that, in the routines covered by this header, | |
| | | * I have adopted the convention of including a redundant recursive | |
| */ | | * coefficient \f$d_0\f$, in order to make the indexing more intuitive. Fo | |
| | | r | |
| | | * formal correctness \f$d_0\f$ should be set to \f$-1\f$, although the fil | |
| | | tering | |
| | | * routines never actually use this coefficient. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** | | /** | |
|
| @{ | | * @{ | |
| \defgroup CreateIIRFilter_c Module CreateIIRFilter.c | | * \defgroup CreateIIRFilter_c Module CreateIIRFilter.c | |
| \defgroup DestroyIIRFilter_c Module DestroyIIRFilter.c | | * \defgroup DestroyIIRFilter_c Module DestroyIIRFilter.c | |
| \defgroup IIRFilter_c Module IIRFilter.c | | * \defgroup IIRFilter_c Module IIRFilter.c | |
| \defgroup IIRFilterVector_c Module IIRFilterVector.c | | * \defgroup IIRFilterVector_c Module IIRFilterVector.c | |
| \defgroup IIRFilterVectorR_c Module IIRFilterVectorR.c | | * \defgroup IIRFilterVectorR_c Module IIRFilterVectorR.c | |
| @} | | * @} | |
| */ | | */ | |
| | | | |
| /** \name Error Codes */ | | /** \name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define IIRFILTERH_ENUL 1 /**< Unexpected null pointer in arguments */ | | #define IIRFILTERH_ENUL 1 /**< Unexpected null pointer in arguments */ | |
| #define IIRFILTERH_EOUT 2 /**< Output handle points to a non-null poin
ter */ | | #define IIRFILTERH_EOUT 2 /**< Output handle points to a non-null poin
ter */ | |
| #define IIRFILTERH_EMEM 3 /**< Memory allocation error */ | | #define IIRFILTERH_EMEM 3 /**< Memory allocation error */ | |
| #define IIRFILTERH_EPAIR 4 /**< Input has unpaired nonreal poles or zer
os */ | | #define IIRFILTERH_EPAIR 4 /**< Input has unpaired nonreal poles or zer
os */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \cond DONT_DOXYGEN */ | | /** \cond DONT_DOXYGEN */ | |
| #define IIRFILTERH_MSGENUL "Unexpected null pointer in arguments" | | #define IIRFILTERH_MSGENUL "Unexpected null pointer in arguments" | |
| #define IIRFILTERH_MSGEOUT "Output handle points to a non-null pointer" | | #define IIRFILTERH_MSGEOUT "Output handle points to a non-null pointer" | |
| #define IIRFILTERH_MSGEMEM "Memory allocation error" | | #define IIRFILTERH_MSGEMEM "Memory allocation error" | |
| #define IIRFILTERH_MSGEPAIR "Input has unpaired nonreal poles or zeros" | | #define IIRFILTERH_MSGEPAIR "Input has unpaired nonreal poles or zeros" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** This structure stores the direct and recursive REAL4 filter coefficient | | /** | |
| s, as | | * This structure stores the direct and recursive REAL4 filter coefficients | |
| | | , as | |
| * well as the history of the auxiliary sequence \f$w\f$. | | * well as the history of the auxiliary sequence \f$w\f$. | |
| * The length of the history vector gives the order of the filter | | * The length of the history vector gives the order of the filter | |
| */ | | */ | |
| #ifdef SWIG /* SWIG interface directives */ | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(IMMUTABLE_MEMBERS(tagREAL4IIRFilter, name)); | | SWIGLAL(IMMUTABLE_MEMBERS(tagREAL4IIRFilter, name)); | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| typedef struct tagREAL4IIRFilter{ | | typedef struct tagREAL4IIRFilter{ | |
| const CHAR *name; /**< User assigned name. */ | | const CHAR *name; /**< User assigned name. */ | |
| REAL8 deltaT; /**< Sampling time interval of the filter; If \f
$\leq0\f$, it will be ignored (ie it will be taken from the data stream) */ | | REAL8 deltaT; /**< Sampling time interval of the filter; If \f
$\leq0\f$, it will be ignored (ie it will be taken from the data stream) */ | |
| REAL4Vector *directCoef; /**< The direct filter coefficients. */ | | REAL4Vector *directCoef; /**< The direct filter coefficients. */ | |
| REAL4Vector *recursCoef; /**< The recursive filter coefficients. */ | | REAL4Vector *recursCoef; /**< The recursive filter coefficients. */ | |
| REAL4Vector *history; /**< The previous values of w. */ | | REAL4Vector *history; /**< The previous values of w. */ | |
| } REAL4IIRFilter; | | } REAL4IIRFilter; | |
| | | | |
|
| /** This structure stores the direct and recursive REAL8 filter coefficient | | /** | |
| s, as | | * This structure stores the direct and recursive REAL8 filter coefficients | |
| | | , as | |
| * well as the history of the auxiliary sequence \f$w\f$. | | * well as the history of the auxiliary sequence \f$w\f$. | |
| * The length of the history vector gives the order of the filter | | * The length of the history vector gives the order of the filter | |
| */ | | */ | |
| #ifdef SWIG /* SWIG interface directives */ | | #ifdef SWIG /* SWIG interface directives */ | |
| SWIGLAL(IMMUTABLE_MEMBERS(tagREAL8IIRFilter, name)); | | SWIGLAL(IMMUTABLE_MEMBERS(tagREAL8IIRFilter, name)); | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| typedef struct tagREAL8IIRFilter{ | | typedef struct tagREAL8IIRFilter{ | |
| const CHAR *name; /**< User assigned name. */ | | const CHAR *name; /**< User assigned name. */ | |
| REAL8 deltaT; /**< Sampling time interval of the filter; If \f
$\leq0\f$, it will be ignored (ie it will be taken from the data stream). *
/ | | REAL8 deltaT; /**< Sampling time interval of the filter; If \f
$\leq0\f$, it will be ignored (ie it will be taken from the data stream). *
/ | |
| REAL8Vector *directCoef; /**< The direct filter coefficients. */ | | REAL8Vector *directCoef; /**< The direct filter coefficients. */ | |
| | | | |
End of changes. 4 change blocks. |
| 95 lines changed or deleted | | 103 lines changed or added | |
|
| LALConstants.h | | LALConstants.h | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| #ifndef _LALCONSTANTS_H | | #ifndef _LALCONSTANTS_H | |
| #define _LALCONSTANTS_H | | #define _LALCONSTANTS_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| /** \name Floating-point constants | | /** | |
| | | * \name Floating-point constants | |
| * The following constants define the precision and range of | | * The following constants define the precision and range of | |
| * floating-point arithmetic in LAL. They are taken from the IEEE | | * floating-point arithmetic in LAL. They are taken from the IEEE | |
|
| * standard 754 for binary arithmetic. All numbers are dimensionless. */ | | * standard 754 for binary arithmetic. All numbers are dimensionless. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_REAL4_MANT 24 /**< Bits of precision in the mantissa of a REAL4
*/ | | #define LAL_REAL4_MANT 24 /**< Bits of precision in the mantissa of a REAL4
*/ | |
| #define LAL_REAL4_MAX 3.40282347e+38 /**< Largest REAL4 */ | | #define LAL_REAL4_MAX 3.40282347e+38 /**< Largest REAL4 */ | |
| #define LAL_REAL4_MIN 1.17549435e-38 /**< Smallest nonzero REAL4 */ | | #define LAL_REAL4_MIN 1.17549435e-38 /**< Smallest nonzero REAL4 */ | |
| #define LAL_REAL4_EPS 1.19209290e-07 /**< 0.5^(LAL_REAL4_MANT-1), ie the di
fference between 1 and the next resolveable REAL4 */ | | #define LAL_REAL4_EPS 1.19209290e-07 /**< 0.5^(LAL_REAL4_MANT-1), ie the di
fference between 1 and the next resolveable REAL4 */ | |
| #define LAL_REAL8_MANT 53 /**< Bits of precision in the mantissa of a REAL8
*/ | | #define LAL_REAL8_MANT 53 /**< Bits of precision in the mantissa of a REAL8
*/ | |
| #define LAL_REAL8_MAX 1.7976931348623157e+308 /**< Largest REAL8 */ | | #define LAL_REAL8_MAX 1.7976931348623157e+308 /**< Largest REAL8 */ | |
| #define LAL_REAL8_MIN 2.2250738585072014e-308 /**< Smallest nonzero REAL8 *
/ | | #define LAL_REAL8_MIN 2.2250738585072014e-308 /**< Smallest nonzero REAL8 *
/ | |
| #define LAL_REAL8_EPS 2.2204460492503131e-16 /**< 0.5^(LAL_REAL8_MANT-1),
ie the difference between 1 and the next resolveable REAL8 */ | | #define LAL_REAL8_EPS 2.2204460492503131e-16 /**< 0.5^(LAL_REAL8_MANT-1),
ie the difference between 1 and the next resolveable REAL8 */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Mathematical constants | | /** | |
| | | * \name Mathematical constants | |
| * The following are fundamental mathematical constants. They are mostly | | * The following are fundamental mathematical constants. They are mostly | |
| * taken from the GNU C <tt>math.h</tt> header (with the exception of | | * taken from the GNU C <tt>math.h</tt> header (with the exception of | |
| * <tt>LAL_TWOPI</tt>, which was computed using Maple). All numbers are | | * <tt>LAL_TWOPI</tt>, which was computed using Maple). All numbers are | |
| * dimensionless. The value of exp(gamma) is taken from | | * dimensionless. The value of exp(gamma) is taken from | |
|
| * http://www.research.att.com/~njas/sequences/A073004 */ | | * http://www.research.att.com/~njas/sequences/A073004 | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_E 2.7182818284590452353602874713526625 /**< e */ | | #define LAL_E 2.7182818284590452353602874713526625 /**< e */ | |
| #define LAL_LOG2E 1.4426950408889634073599246810018922 /**< log_2 e */ | | #define LAL_LOG2E 1.4426950408889634073599246810018922 /**< log_2 e */ | |
| #define LAL_LOG10E 0.4342944819032518276511289189166051 /**< log_10 e *
/ | | #define LAL_LOG10E 0.4342944819032518276511289189166051 /**< log_10 e *
/ | |
| #define LAL_LN2 0.6931471805599453094172321214581766 /**< log_e 2 */ | | #define LAL_LN2 0.6931471805599453094172321214581766 /**< log_e 2 */ | |
| #define LAL_LN10 2.3025850929940456840179914546843642 /**< log_e 10 *
/ | | #define LAL_LN10 2.3025850929940456840179914546843642 /**< log_e 10 *
/ | |
| #define LAL_SQRT2 1.4142135623730950488016887242096981 /**< sqrt(2) */ | | #define LAL_SQRT2 1.4142135623730950488016887242096981 /**< sqrt(2) */ | |
| #define LAL_SQRT1_2 0.7071067811865475244008443621048490 /**< 1/sqrt(2)
*/ | | #define LAL_SQRT1_2 0.7071067811865475244008443621048490 /**< 1/sqrt(2)
*/ | |
| #define LAL_GAMMA 0.5772156649015328606065120900824024 /**< gamma */ | | #define LAL_GAMMA 0.5772156649015328606065120900824024 /**< gamma */ | |
| #define LAL_EXPGAMMA 1.7810724179901979852365041031071795 /**< exp(gamma)
*/ | | #define LAL_EXPGAMMA 1.7810724179901979852365041031071795 /**< exp(gamma)
*/ | |
| | | | |
| skipping to change at line 87 | | skipping to change at line 91 | |
| #define LAL_TWOPI 6.2831853071795864769252867665590058 /**< 2*pi */ | | #define LAL_TWOPI 6.2831853071795864769252867665590058 /**< 2*pi */ | |
| #define LAL_PI_2 1.5707963267948966192313216916397514 /**< pi/2 */ | | #define LAL_PI_2 1.5707963267948966192313216916397514 /**< pi/2 */ | |
| #define LAL_PI_4 0.7853981633974483096156608458198757 /**< pi/4 */ | | #define LAL_PI_4 0.7853981633974483096156608458198757 /**< pi/4 */ | |
| #define LAL_1_PI 0.3183098861837906715377675267450287 /**< 1/pi */ | | #define LAL_1_PI 0.3183098861837906715377675267450287 /**< 1/pi */ | |
| #define LAL_2_PI 0.6366197723675813430755350534900574 /**< 2/pi */ | | #define LAL_2_PI 0.6366197723675813430755350534900574 /**< 2/pi */ | |
| #define LAL_2_SQRTPI 1.1283791670955125738961589031215452 /**< 2/sqrt(pi)
*/ | | #define LAL_2_SQRTPI 1.1283791670955125738961589031215452 /**< 2/sqrt(pi)
*/ | |
| #define LAL_PI_180 1.7453292519943295769236907684886127e-2 /**< pi/180 *
/ | | #define LAL_PI_180 1.7453292519943295769236907684886127e-2 /**< pi/180 *
/ | |
| #define LAL_180_PI 57.295779513082320876798154814105170 /**< 180/pi */ | | #define LAL_180_PI 57.295779513082320876798154814105170 /**< 180/pi */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Exact physical constants | | /** | |
| | | * \name Exact physical constants | |
| * The following physical constants are defined to have exact values. | | * The following physical constants are defined to have exact values. | |
|
| * The values of \f$c\f$ and \f$g\f$ are taken from \ref Barnet_1996, | | * The values of \f$c\f$ and \f$g\f$ are taken from \cite Barnet_1996, | |
| * \f$p_\mathrm{atm}\f$ is from \ref Lang_1992, while \f$\epsilon_0\f$ and | | * \f$p_\mathrm{atm}\f$ is from \cite Lang_1992, while \f$\epsilon_0\f$ and | |
| * \f$\mu_0\f$ are computed from \f$c\f$ using exact formulae. The use | | * \f$\mu_0\f$ are computed from \f$c\f$ using exact formulae. The use | |
| * of a Julian year (365.25 days) as standard is specified by the IAU. | | * of a Julian year (365.25 days) as standard is specified by the IAU. | |
|
| * They are given in the SI units shown. */ | | * They are given in the SI units shown. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_C_SI 299792458 /**< Speed of light in vacuo, m s^-1 */ | | #define LAL_C_SI 299792458 /**< Speed of light in vacuo, m s^-1 */ | |
| #define LAL_EPSILON0_SI 8.8541878176203898505365630317107503e-12 /**< Perm
ittivity of free space, C^2 N^-1 m^-2 */ | | #define LAL_EPSILON0_SI 8.8541878176203898505365630317107503e-12 /**< Perm
ittivity of free space, C^2 N^-1 m^-2 */ | |
| #define LAL_MU0_SI 1.2566370614359172953850573533118012e-6 /**< Permeabi
lity of free space, N A^-2 */ | | #define LAL_MU0_SI 1.2566370614359172953850573533118012e-6 /**< Permeabi
lity of free space, N A^-2 */ | |
| #define LAL_GEARTH_SI 9.80665 /**< Standard gravity, m s^-2 */ | | #define LAL_GEARTH_SI 9.80665 /**< Standard gravity, m s^-2 */ | |
| #define LAL_PATM_SI 101325 /**< Standard atmosphere, Pa */ | | #define LAL_PATM_SI 101325 /**< Standard atmosphere, Pa */ | |
| #define LAL_YRJUL_SI 31557600 /**< Julian year, s */ | | #define LAL_YRJUL_SI 31557600 /**< Julian year, s */ | |
| #define LAL_LYR_SI 9.4607304725808e15 /**< (Julian) Lightyear, m */ | | #define LAL_LYR_SI 9.4607304725808e15 /**< (Julian) Lightyear, m */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Physical constants | | /** | |
| | | * \name Physical constants | |
| * The following are measured fundamental physical constants, with values | | * The following are measured fundamental physical constants, with values | |
|
| * given in \ref Barnet_1996. When not dimensionless, they are given | | * given in \cite Barnet_1996. When not dimensionless, they are given | |
| * in the SI units shown. */ | | * in the SI units shown. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_G_SI 6.67259e-11 /**< Gravitational constant, N m^2 kg^
-2 */ | | #define LAL_G_SI 6.67259e-11 /**< Gravitational constant, N m^2 kg^
-2 */ | |
| #define LAL_H_SI 6.6260755e-34 /**< Planck constant, J s */ | | #define LAL_H_SI 6.6260755e-34 /**< Planck constant, J s */ | |
| #define LAL_HBAR_SI 1.0545726691251019773669079307477023e-34 /**< Reduced
Planck constant, J s. = LAL_H_SI / LAL_TWOPI */ | | #define LAL_HBAR_SI 1.0545726691251019773669079307477023e-34 /**< Reduced
Planck constant, J s. = LAL_H_SI / LAL_TWOPI */ | |
| #define LAL_MPL_SI 2.1767140835297016797409334934257335e-8 /**< Planck
mass, kg. = sqrt{LAL_HBAR_SI * LAL_C_SI / LAL_G_SI} */ | | #define LAL_MPL_SI 2.1767140835297016797409334934257335e-8 /**< Planck
mass, kg. = sqrt{LAL_HBAR_SI * LAL_C_SI / LAL_G_SI} */ | |
| #define LAL_LPL_SI 1.6160486159348859434398861412879278e-35 /**< Planck
length, m. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^3} */ | | #define LAL_LPL_SI 1.6160486159348859434398861412879278e-35 /**< Planck
length, m. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^3} */ | |
| #define LAL_TPL_SI 5.3905579437054615411301846068720240e-44 /**< Planck
time, s. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^5} */ | | #define LAL_TPL_SI 5.3905579437054615411301846068720240e-44 /**< Planck
time, s. = sqrt{LAL_HBAR_SI * LAL_G_SI / LAL_C_SI^5} */ | |
| #define LAL_K_SI 1.380658e-23 /**< Boltzmann constant, J K^-1 */ | | #define LAL_K_SI 1.380658e-23 /**< Boltzmann constant, J K^-1 */ | |
| #define LAL_R_SI 8.314511 /**< Ideal gas constant, J K^-1 */ | | #define LAL_R_SI 8.314511 /**< Ideal gas constant, J K^-1 */ | |
| #define LAL_MOL 6.0221367e23 /**< Avogadro constant, dimensionless
*/ | | #define LAL_MOL 6.0221367e23 /**< Avogadro constant, dimensionless
*/ | |
| | | | |
| skipping to change at line 132 | | skipping to change at line 140 | |
| #define LAL_ME_SI 9.1093897e-31 /**< Electron mass, kg */ | | #define LAL_ME_SI 9.1093897e-31 /**< Electron mass, kg */ | |
| #define LAL_QE_SI 1.60217733e-19 /**< Electron charge, C */ | | #define LAL_QE_SI 1.60217733e-19 /**< Electron charge, C */ | |
| #define LAL_ALPHA 7.297354677e-3 /**< Fine structure constant, dimensionle
ss */ | | #define LAL_ALPHA 7.297354677e-3 /**< Fine structure constant, dimensionle
ss */ | |
| #define LAL_RE_SI 2.81794092e-15 /**< Classical electron radius, m */ | | #define LAL_RE_SI 2.81794092e-15 /**< Classical electron radius, m */ | |
| #define LAL_LAMBDAE_SI 3.86159323e-13 /**< Electron Compton wavelength, m *
/ | | #define LAL_LAMBDAE_SI 3.86159323e-13 /**< Electron Compton wavelength, m *
/ | |
| #define LAL_AB_SI 5.29177249e-11 /**< Bohr radius, m */ | | #define LAL_AB_SI 5.29177249e-11 /**< Bohr radius, m */ | |
| #define LAL_MUB_SI 9.27401543e-24 /**< Bohr magneton, J T^-1 */ | | #define LAL_MUB_SI 9.27401543e-24 /**< Bohr magneton, J T^-1 */ | |
| #define LAL_MUN_SI 5.05078658e-27 /**< Nuclear magneton, J T^-1 */ | | #define LAL_MUN_SI 5.05078658e-27 /**< Nuclear magneton, J T^-1 */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Astrophysical parameters | | /** | |
| | | * \name Astrophysical parameters | |
| * The following parameters are derived from measured properties of the | | * The following parameters are derived from measured properties of the | |
|
| * Earth and Sun. The values are taken from \ref Barnet_1996, except | | * Earth and Sun. The values are taken from \cite Barnet_1996, except | |
| * for the obliquity of the ecliptic plane and the eccentricity of | | * for the obliquity of the ecliptic plane and the eccentricity of | |
|
| * Earth's orbit, which are taken from \ref Lang_1992. All values are | | * Earth's orbit, which are taken from \cite Lang_1992. All values are | |
| * given in the SI units shown. Note that the ``year'' and | | * given in the SI units shown. Note that the ``year'' and | |
| * ``light-year'' have exactly defined values, and appear under | | * ``light-year'' have exactly defined values, and appear under | |
| * ``Exact physical constants''. | | * ``Exact physical constants''. | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_REARTH_SI 6.378140e6 /**< Earth equatorial radius, m */ | | #define LAL_REARTH_SI 6.378140e6 /**< Earth equatorial radius, m */ | |
| #define LAL_AWGS84_SI 6.378137e6 /**< Semimajor axis of WGS-84 Referen
ce Ellipsoid, m */ | | #define LAL_AWGS84_SI 6.378137e6 /**< Semimajor axis of WGS-84 Referen
ce Ellipsoid, m */ | |
| #define LAL_BWGS84_SI 6.356752314e6 /**< Semiminor axis of WGS-84 Referen
ce Ellipsoid, m */ | | #define LAL_BWGS84_SI 6.356752314e6 /**< Semiminor axis of WGS-84 Referen
ce Ellipsoid, m */ | |
| #define LAL_MEARTH_SI 5.97370e24 /**< Earth mass, kg */ | | #define LAL_MEARTH_SI 5.97370e24 /**< Earth mass, kg */ | |
| #define LAL_IEARTH 0.409092804 /**< Earth inclination (2000), radian
s */ | | #define LAL_IEARTH 0.409092804 /**< Earth inclination (2000), radian
s */ | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 171 | |
| #define LAL_MRSUN_SI 1.4766254500421874513093320107664308e3 /**< Geometri
zed solar mass, m. = LAL_MSUN_SI / LAL_MPL_SI * LAL_LPL_SI */ | | #define LAL_MRSUN_SI 1.4766254500421874513093320107664308e3 /**< Geometri
zed solar mass, m. = LAL_MSUN_SI / LAL_MPL_SI * LAL_LPL_SI */ | |
| #define LAL_MTSUN_SI 4.9254923218988636432342917247829673e-6 /**< Geometri
zed solar mass, s. = LAL_MSUN_SI / LAL_MPL_SI * LAL_TPL_SI */ | | #define LAL_MTSUN_SI 4.9254923218988636432342917247829673e-6 /**< Geometri
zed solar mass, s. = LAL_MSUN_SI / LAL_MPL_SI * LAL_TPL_SI */ | |
| #define LAL_LSUN_SI 3.846e26 /**< Solar luminosity, W */ | | #define LAL_LSUN_SI 3.846e26 /**< Solar luminosity, W */ | |
| #define LAL_AU_SI 1.4959787066e11 /**< Astronomical unit, m */ | | #define LAL_AU_SI 1.4959787066e11 /**< Astronomical unit, m */ | |
| #define LAL_PC_SI 3.0856775807e16 /**< Parsec, m */ | | #define LAL_PC_SI 3.0856775807e16 /**< Parsec, m */ | |
| #define LAL_YRTROP_SI 31556925.2 /**< Tropical year (1994), s */ | | #define LAL_YRTROP_SI 31556925.2 /**< Tropical year (1994), s */ | |
| #define LAL_YRSID_SI 31558149.8 /**< Sidereal year (1994), s */ | | #define LAL_YRSID_SI 31558149.8 /**< Sidereal year (1994), s */ | |
| #define LAL_DAYSID_SI 86164.09053 /**< Mean sidereal day, s */ | | #define LAL_DAYSID_SI 86164.09053 /**< Mean sidereal day, s */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Cosmological parameters | | /** | |
| | | * \name Cosmological parameters | |
| * The following cosmological parameters are derived from measurements of | | * The following cosmological parameters are derived from measurements of | |
| * the Hubble expansion rate and of the cosmic background radiation | | * the Hubble expansion rate and of the cosmic background radiation | |
|
| * (CBR). Data are taken from \ref Barnet_1996. In what follows, the | | * (CBR). Data are taken from \cite Barnet_1996. In what follows, the | |
| * normalized Hubble constant \f$h_0\f$ is equal to the actual Hubble | | * normalized Hubble constant \f$h_0\f$ is equal to the actual Hubble | |
| * constant \f$H_0\f$ divided by \f$\langle H | | * constant \f$H_0\f$ divided by \f$\langle H | |
| * \rangle=100\,\mathrm{km}\,\mathrm{s}^{-1}\mathrm{Mpc}^{-1}\f$. Thus the | | * \rangle=100\,\mathrm{km}\,\mathrm{s}^{-1}\mathrm{Mpc}^{-1}\f$. Thus the | |
| * Hubble constant can be written as: | | * Hubble constant can be written as: | |
| * \f$H_0 = \langle H \rangle h_0\f$. | | * \f$H_0 = \langle H \rangle h_0\f$. | |
| * Similarly, the critical energy density \f$\rho_c\f$ required for spatial | | * Similarly, the critical energy density \f$\rho_c\f$ required for spatial | |
| * flatness is given by: \f$\rho_c = \langle\rho\rangle h_0^2\f$. | | * flatness is given by: \f$\rho_c = \langle\rho\rangle h_0^2\f$. | |
| * Current estimates give \f$h_0\f$ a value of around 0.65, which is what i
s | | * Current estimates give \f$h_0\f$ a value of around 0.65, which is what i
s | |
|
| * assumed below. All values are in the SI units shown. */ | | * assumed below. All values are in the SI units shown. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_H0FAC_SI 3.2407792903e-18 /**< Hubble constant prefactor, s^-1
*/ | | #define LAL_H0FAC_SI 3.2407792903e-18 /**< Hubble constant prefactor, s^-1
*/ | |
| #define LAL_H0_SI 2e-18 /**< Approximate Hubble constant, s^
-1 */ | | #define LAL_H0_SI 2e-18 /**< Approximate Hubble constant, s^
-1 */ | |
| /* Hubble constant H0 = h0*HOFAC, where h0 is around 0.65 */ | | /* Hubble constant H0 = h0*HOFAC, where h0 is around 0.65 */ | |
| #define LAL_RHOCFAC_SI 1.68860e-9 /**< Critical density prefactor, J m^-3
*/ | | #define LAL_RHOCFAC_SI 1.68860e-9 /**< Critical density prefactor, J m^-3
*/ | |
| #define LAL_RHOC_SI 7e-10 /**< Approximate critical density, J m^
-3 */ | | #define LAL_RHOC_SI 7e-10 /**< Approximate critical density, J m^
-3 */ | |
| /* Critical density RHOC = h0*h0*RHOCFAC, where h0 is around 0.65 */ | | /* Critical density RHOC = h0*h0*RHOCFAC, where h0 is around 0.65 */ | |
| #define LAL_TCBR_SI 2.726 /**< Cosmic background radiation temperature,
K */ | | #define LAL_TCBR_SI 2.726 /**< Cosmic background radiation temperature,
K */ | |
| #define LAL_VCBR_SI 3.695e5 /**< Solar velocity with respect to CBR, m s^
-1 */ | | #define LAL_VCBR_SI 3.695e5 /**< Solar velocity with respect to CBR, m s^
-1 */ | |
| #define LAL_RHOCBR_SI 4.177e-14 /**< Energy density of CBR, J m^-3 */ | | #define LAL_RHOCBR_SI 4.177e-14 /**< Energy density of CBR, J m^-3 */ | |
| | | | |
End of changes. 15 change blocks. |
| 17 lines changed or deleted | | 28 lines changed or added | |
|
| LALDetectors.h | | LALDetectors.h | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| | | | |
| #ifndef _LALDETECTORS_H | | #ifndef _LALDETECTORS_H | |
| #define _LALDETECTORS_H | | #define _LALDETECTORS_H | |
| | | | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| /** \addtogroup LALDetectors_h | | /** | |
| \author J. T. Whelan and J. D. E. Creighton | | * \addtogroup LALDetectors_h | |
| | | * \author J. T. Whelan and J. D. E. Creighton | |
| \brief This header defines structures to hold the basic data describing | | * | |
| a gravitational wave detector. | | * \brief This header defines structures to hold the basic data describing | |
| | | a gravitational wave detector. | |
| \heading{Synopsis} | | * | |
| \code | | * ### Synopsis ### | |
| #include <lal/LALDetectors.h> | | * | |
| \endcode | | * \code | |
| | | * #include <lal/LALDetectors.h> | |
| According to the common frame format specification | | * \endcode | |
| [\ref LIGOVIRGO_2000] the geometry of an interferometric | | * | |
| detector will be stored in a \c FrDetector structure, specifying | | * According to the common frame format specification | |
| the location of the detector vertex and the orientation of its arms in | | * \cite LIGOVIRGO_2000 the geometry of an interferometric | |
| geodetic coördinates suited to geographical surveying. Resonant | | * detector will be stored in a \c FrDetector structure, specifying | |
| bars and other sorts of detectors, if they write their data to frames, | | * the location of the detector vertex and the orientation of its arms in | |
| are expected to fill this structure with their location and | | * geodetic coördinates suited to geographical surveying. Resonant | |
| orientation in some way suited to the detector type. | | * bars and other sorts of detectors, if they write their data to frames, | |
| | | * are expected to fill this structure with their location and | |
| For most data analysis tasks, however, any gravitational wave detector | | * orientation in some way suited to the detector type. | |
| can be described by its location in an Earth-fixed rotating reference | | * | |
| frame, as well as a <em>response tensor</em> \f$d^{ab}\f$, constant in the | | * For most data analysis tasks, however, any gravitational wave detector | |
| same frame, which defines the "strain" \f$h\f$ measured by the detector in | | * can be described by its location in an Earth-fixed rotating reference | |
| terms of the metric perturbation \f$h_{ab}\f$ as | | * frame, as well as a <em>response tensor</em> \f$d^{ab}\f$, constant in t | |
| \f{equation}{ | | he | |
| h = h_{ab} \, d^{ab} | | * same frame, which defines the "strain" \f$h\f$ measured by the detector | |
| \ . | | in | |
| \f} | | * terms of the metric perturbation \f$h_{ab}\f$ as | |
| | | * \f{equation}{ | |
| This header defines a \c ::LALFrDetector structure which contains | | * h = h_{ab} \, d^{ab} | |
| essentially the same information as the \c FrDetector structure, | | * \ . | |
| as well as a \c LALDetector structure which contains the | | * \f} | |
| Cartesian coördinates of the detector along with the components of | | * | |
| the response tensor \f$d^{ab}\f$ in the same coördinate system. | | * This header defines a \c ::LALFrDetector structure which contains | |
| | | * essentially the same information as the \c FrDetector structure, | |
| \heading{The Geodetic Coördinate System} | | * as well as a \c LALDetector structure which contains the | |
| | | * Cartesian coördinates of the detector along with the components of | |
| Geodetic coördinates are spheroidal coördinates | | * the response tensor \f$d^{ab}\f$ in the same coördinate system. | |
| based on the WGS-84 Earth Model, which is an | | * | |
| oblate spheroid with equatorial radius \f$a=6.378137\times | | * ### The Geodetic Coördinate System ### | |
| 10^6\,\textrm{m}\f$ and polar radius \f$b=6.356752314\times | | * | |
| 10^6\,\textrm{m}\f$. Any point in space can be located according to its | | * Geodetic coördinates are spheroidal coördinates | |
| longitude, latitude, and elevation. The \e longitude \f$\lambda\f$ | | * based on the WGS-84 Earth Model, which is an | |
| is the angle between the half-plane bounded by the symmetry axis of | | * oblate spheroid with equatorial radius \f$a=6.378137\times | |
| the reference ellipsoid containing the point in question and the | | * 10^6\,\textrm{m}\f$ and polar radius \f$b=6.356752314\times | |
| half-plane plane containing the Prime Meridian; it is measured in | | * 10^6\,\textrm{m}\f$. Any point in space can be located according to its | |
| radians, increases to the East, and ranges from | | * longitude, latitude, and elevation. The \e longitude \f$\lambda\f$ | |
| \f$-\pi\f$ to \f$\pi\f$. The \e latitude \f$\beta\f$ is the | | * is the angle between the half-plane bounded by the symmetry axis of | |
| angle between the ray which is normal to the ellipsoid and passes | | * the reference ellipsoid containing the point in question and the | |
| through the point in question and the equatorial plane; it is measured | | * half-plane plane containing the Prime Meridian; it is measured in | |
| in radians, increases to the North, and ranges | | * radians, increases to the East, and ranges from | |
| from \f$-\pi/2\f$ to \f$\pi/2\f$. The \e elevation \f$h\f$ is the | | * \f$-\pi\f$ to \f$\pi\f$. The \e latitude \f$\beta\f$ is the | |
| signed distance along this ray from the reference ellipsoid to the | | * angle between the ray which is normal to the ellipsoid and passes | |
| point in question. This coördinate system is described in more | | * through the point in question and the equatorial plane; it is measured | |
| detail in [\ref Althouse_1999]. | | * in radians, increases to the North, and ranges | |
| | | * from \f$-\pi/2\f$ to \f$\pi/2\f$. The \e elevation \f$h\f$ is the | |
| \heading{Altitude and Azimuth Angles} | | * signed distance along this ray from the reference ellipsoid to the | |
| | | * point in question. This coördinate system is described in more | |
| The \c LALFrDetector structure stores the directions along the | | * detail in \cite Althouse_1999. | |
| two arms of an interferometer in an altitude/azimuth representation | | * | |
| with respect to the local tangent plane to the reference ellipsoid, | | * ### Altitude and Azimuth Angles ### | |
| known as the local horizontal. The altitude \f${\mathcal{A}}\f$ is the ang | | * | |
| le the | | * The \c LALFrDetector structure stores the directions along the | |
| direction vector makes with the horizontal, \f${\mathcal{A}} > 0\f$ meaning | | * two arms of an interferometer in an altitude/azimuth representation | |
| above | | * with respect to the local tangent plane to the reference ellipsoid, | |
| horizontal, \f${\mathcal{A}} < 0\f$ below. The azimuth angle \f$\zeta\f$ i | | * known as the local horizontal. The altitude \f${\mathcal{A}}\f$ is the | |
| s found by | | angle the | |
| projecting the direction onto the local horizontal plane, then | | * direction vector makes with the horizontal, \f${\mathcal{A}} > 0\f$ mean | |
| measuring the angle clockwise from North to this projected direction. | | ing above | |
| | | * horizontal, \f${\mathcal{A}} < 0\f$ below. The azimuth angle \f$\zeta\f | |
| \heading{The Cartesian Coördinate System} | | $ is found by | |
| | | * projecting the direction onto the local horizontal plane, then | |
| The position vector and response tensor contained in the | | * measuring the angle clockwise from North to this projected direction. | |
| \c LALDetector structure are defined in | | * | |
| a simple orthonormal coördinate system with its origin at | | * ### The Cartesian Coördinate System ### | |
| the center of the earth, an \f$x^1\f$ axis which pierces the Earth's | | * | |
| surface at the intersection of the equator and the prime meridian, an | | * The position vector and response tensor contained in the | |
| \f$x^2\f$ axis which pierces the earth's surface at \f$\pi/2\f$ radians Eas | | * \c LALDetector structure are defined in | |
| t | | * a simple orthonormal coördinate system with its origin at | |
| longitude on the equator, and an \f$x^3\f$ axis which pierces the Earth's | | * the center of the earth, an \f$x^1\f$ axis which pierces the Earth's | |
| surface at the North Pole. The coördinates \f$x^1\f$, \f$x^2\f$, \f$x^3\f | | * surface at the intersection of the equator and the prime meridian, an | |
| $ | | * \f$x^2\f$ axis which pierces the earth's surface at \f$\pi/2\f$ radians | |
| correspond to the Earth-fixed coördinates \f$X_E\f$, \f$Y_E\f$, \f$Z_E\f$ | | East | |
| defined in [\ref Althouse_1999], respectively. | | * longitude on the equator, and an \f$x^3\f$ axis which pierces the Earth' | |
| | | s | |
| The relationship between geodetic and Cartesian coördinates is | | * surface at the North Pole. The coördinates \f$x^1\f$, \f$x^2\f$, \f$x^ | |
| given by | | 3\f$ | |
| \anchor tools_e_cart1 | | * correspond to the Earth-fixed coördinates \f$X_E\f$, \f$Y_E\f$, \f$Z_E\ | |
| \anchor tools_e_cart2 | | f$ | |
| \anchor tools_e_cart3 | | * defined in \cite Althouse_1999, respectively. | |
| \f{align}{ | | * | |
| x^1 &=\left( | | * The relationship between geodetic and Cartesian coördinates is | |
| \frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} | | * given by | |
| + h | | * \f{align}{ | |
| \right) \cos\beta\cos\lambda \label{tools_e_cart1}\\ | | * \label{tools_e_cart1} | |
| x^2 &=\left( | | * x^1 &=\left( | |
| \frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} | | * \frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} | |
| + h | | * + h | |
| \right) \cos\beta\sin\lambda \label{tools_e_cart2}\\ | | * \right) \cos\beta\cos\lambda \\ | |
| x^3 &=\left( | | * \label{tools_e_cart2} | |
| \frac{b^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} | | * x^2 &=\left( | |
| + h | | * \frac{a^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} | |
| \right) \sin\beta \label{tools_e_cart3} \\ | | * + h | |
| \f} | | * \right) \cos\beta\sin\lambda \\ | |
| | | * \label{tools_e_cart3} | |
| * \heading{Cached Detectors} | | * x^3 &=\left( | |
| | | * \frac{b^2}{\sqrt{a^2\cos^2\beta+b^2\sin^2\beta}} | |
| | | * + h | |
| | | * \right) \sin\beta \\ | |
| | | * \f} | |
| | | * | |
| | | * ### Cached Detectors ### | |
| * | | * | |
| * In practice, we will often be | | * In practice, we will often be | |
| * working with fixed unchanging site geometry, e.g., for the LIGO | | * working with fixed unchanging site geometry, e.g., for the LIGO | |
| * interferometers; to avoid constantly reconstructing the corresponding | | * interferometers; to avoid constantly reconstructing the corresponding | |
| * \c LALDetectors, we should define some constant | | * \c LALDetectors, we should define some constant | |
| * \c LALDetectors describing them. Those are stored in a constant | | * \c LALDetectors describing them. Those are stored in a constant | |
| * array of \c LALDetector structures known as | | * array of \c LALDetector structures known as | |
| * \c lalCachedDetectors, which is declared \c extern in this | | * \c lalCachedDetectors, which is declared \c extern in this | |
| * header and defined in \ref CreateDetector_c. | | * header and defined in \ref CreateDetector_c. | |
| * | | * | |
| * The <tt>LALCreateDetector()</tt> routine will first look through the | | * The <tt>LALCreateDetector()</tt> routine will first look through the | |
| * \c lalCachedDetectors array for a \c LALDetector structure | | * \c lalCachedDetectors array for a \c LALDetector structure | |
| * with matching \c type and <tt>frDetector.name</tt> fields; if it | | * with matching \c type and <tt>frDetector.name</tt> fields; if it | |
| * finds one, it returns a copy of that; if not, it creates one. | | * finds one, it returns a copy of that; if not, it creates one. | |
| * | | * | |
| * For example, the \c LALDetector representing LIGO Hanford 4km (H1) in | | * For example, the \c LALDetector representing LIGO Hanford 4km (H1) in | |
| * differential mode is <tt>lalCachedDetectors[LAL_LHO_4K_DETECTOR]</tt>. | | * differential mode is <tt>lalCachedDetectors[LAL_LHO_4K_DETECTOR]</tt>. | |
| * | | * | |
|
| * | | | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name Error Codes */ | | /** \name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define LALDETECTORSH_ENULLP 1 /**< Null pointer */ | | #define LALDETECTORSH_ENULLP 1 /**< Null pointer */ | |
| #define LALDETECTORSH_ETYPE 2 /**< Unsupported detector type */ | | #define LALDETECTORSH_ETYPE 2 /**< Unsupported detector type */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \cond DONT_DOXYGEN */ | | /** \cond DONT_DOXYGEN */ | |
| | | | |
| skipping to change at line 197 | | skipping to change at line 198 | |
| LAL_LHO_2K_DETECTOR_BIT = 1 << 2 * LAL_LHO_2K_DETECTOR
, | | LAL_LHO_2K_DETECTOR_BIT = 1 << 2 * LAL_LHO_2K_DETECTOR
, | |
| LAL_LHO_4K_DETECTOR_BIT = 1 << 2 * LAL_LHO_4K_DETECTOR
, | | LAL_LHO_4K_DETECTOR_BIT = 1 << 2 * LAL_LHO_4K_DETECTOR
, | |
| LAL_LLO_4K_DETECTOR_BIT = 1 << 2 * LAL_LLO_4K_DETECTOR
, | | LAL_LLO_4K_DETECTOR_BIT = 1 << 2 * LAL_LLO_4K_DETECTOR
, | |
| LAL_CIT_40_DETECTOR_BIT = 1 << 2 * LAL_CIT_40_DETECTOR
, | | LAL_CIT_40_DETECTOR_BIT = 1 << 2 * LAL_CIT_40_DETECTOR
, | |
| LAL_ALLEGRO_DETECTOR_BIT = 1 << 2 * LAL_ALLEGRO_DETECTO
R, | | LAL_ALLEGRO_DETECTOR_BIT = 1 << 2 * LAL_ALLEGRO_DETECTO
R, | |
| LAL_AURIGA_DETECTOR_BIT = 1 << 2 * LAL_AURIGA_DETECTOR
, | | LAL_AURIGA_DETECTOR_BIT = 1 << 2 * LAL_AURIGA_DETECTOR
, | |
| LAL_NIOBE_DETECTOR_BIT = 1 << 2 * LAL_NIOBE_DETECTOR, | | LAL_NIOBE_DETECTOR_BIT = 1 << 2 * LAL_NIOBE_DETECTOR, | |
| LAL_NAUTILUS_DETECTOR_BIT = 1 << 2 * LAL_NAUTILUS_DETECT
OR | | LAL_NAUTILUS_DETECTOR_BIT = 1 << 2 * LAL_NAUTILUS_DETECT
OR | |
| }; | | }; | |
| | | | |
|
| /** Detector type, which determines how the detector response is determined | | /** | |
| . | | * Detector type, which determines how the detector response is determined. | |
| * | | | |
| * Since data from bars as well as interferometers can be written to | | * Since data from bars as well as interferometers can be written to | |
| * frames, we need an additional piece of information to interpret the | | * frames, we need an additional piece of information to interpret the | |
| * site geometry data specified in the \c LALFrDetector | | * site geometry data specified in the \c LALFrDetector | |
| * structure; for instance, is the x arm really the x arm or is it the | | * structure; for instance, is the x arm really the x arm or is it the | |
| * long axis of a bar? The \c LALDetectorType enumeration | | * long axis of a bar? The \c LALDetectorType enumeration | |
| * provides a way to keep track of that. | | * provides a way to keep track of that. | |
| * | | * | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| LALDETECTORTYPE_ABSENT, /**< No FrDetector associated with t
his detector */ | | LALDETECTORTYPE_ABSENT, /**< No FrDetector associated with t
his detector */ | |
| LALDETECTORTYPE_IFODIFF, /**< IFO in differential mode */ | | LALDETECTORTYPE_IFODIFF, /**< IFO in differential mode */ | |
| LALDETECTORTYPE_IFOXARM, /**< IFO in one-armed mode (X arm) *
/ | | LALDETECTORTYPE_IFOXARM, /**< IFO in one-armed mode (X arm) *
/ | |
| LALDETECTORTYPE_IFOYARM, /**< IFO in one-armed mode (Y arm) *
/ | | LALDETECTORTYPE_IFOYARM, /**< IFO in one-armed mode (Y arm) *
/ | |
| LALDETECTORTYPE_IFOCOMM, /**< IFO in common mode */ | | LALDETECTORTYPE_IFOCOMM, /**< IFO in common mode */ | |
| LALDETECTORTYPE_CYLBAR /**< Cylindrical bar */ | | LALDETECTORTYPE_CYLBAR /**< Cylindrical bar */ | |
| } | | } | |
| LALDetectorType; | | LALDetectorType; | |
| | | | |
|
| /** Detector frame data structure | | /** | |
| * | | * Detector frame data structure | |
| * Structure to contain the data that appears in a FrDetector structure | | * Structure to contain the data that appears in a FrDetector structure | |
| * in frame data. | | * in frame data. | |
| */ | | */ | |
| typedef struct tagLALFrDetector | | typedef struct tagLALFrDetector | |
| { | | { | |
| CHAR name[LALNameLength]; /**< A unique identifying string */ | | CHAR name[LALNameLength]; /**< A unique identifying string */ | |
| CHAR prefix[3]; /**< Two-letter prefix for detector'
s channel names */ | | CHAR prefix[3]; /**< Two-letter prefix for detector'
s channel names */ | |
| REAL8 vertexLongitudeRadians; /**< The geodetic longitude \f$\lamb
da\f$ of the vertex in radians */ | | REAL8 vertexLongitudeRadians; /**< The geodetic longitude \f$\lamb
da\f$ of the vertex in radians */ | |
| REAL8 vertexLatitudeRadians; /**< The geodetic latitude \f$\beta\
f$ of the vertex in radians */ | | REAL8 vertexLatitudeRadians; /**< The geodetic latitude \f$\beta\
f$ of the vertex in radians */ | |
| REAL4 vertexElevation; /**< The height of the vertex above
the reference ellipsoid in meters */ | | REAL4 vertexElevation; /**< The height of the vertex above
the reference ellipsoid in meters */ | |
| REAL4 xArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_X\f$
up from the local tangent plane of the reference ellipsoid to the X arm (o
r bar's cylidrical axis) in radians */ | | REAL4 xArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_X\f$
up from the local tangent plane of the reference ellipsoid to the X arm (o
r bar's cylidrical axis) in radians */ | |
| REAL4 xArmAzimuthRadians; /**< The angle \f$\zeta_X\f$ clockwi
se from North to the projection of the X arm (or bar's cylidrical axis) int
o the local tangent plane of the reference ellipsoid in radians */ | | REAL4 xArmAzimuthRadians; /**< The angle \f$\zeta_X\f$ clockwi
se from North to the projection of the X arm (or bar's cylidrical axis) int
o the local tangent plane of the reference ellipsoid in radians */ | |
| REAL4 yArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_Y\f$
up from the local tangent plane of the reference ellipsoid to the Y arm in
radians (unused for bars: set it to zero) */ | | REAL4 yArmAltitudeRadians; /**< The angle \f${\mathcal{A}}_Y\f$
up from the local tangent plane of the reference ellipsoid to the Y arm in
radians (unused for bars: set it to zero) */ | |
| REAL4 yArmAzimuthRadians; /**< The angle \f$\zeta_Y\f$ clockwi
se from North to the projection of the Y arm into the local tangent plane o
f the reference ellipsoid in radians (unused for bars: set it to zero) */ | | REAL4 yArmAzimuthRadians; /**< The angle \f$\zeta_Y\f$ clockwi
se from North to the projection of the Y arm into the local tangent plane o
f the reference ellipsoid in radians (unused for bars: set it to zero) */ | |
| REAL4 xArmMidpoint; /**< The distance to the midpoint of
the X arm in meters (unused for bars: set it to zero) */ | | REAL4 xArmMidpoint; /**< The distance to the midpoint of
the X arm in meters (unused for bars: set it to zero) */ | |
| REAL4 yArmMidpoint; /**< The distance to the midpoint of
the Y arm in meters (unused for bars: set it to zero) */ | | REAL4 yArmMidpoint; /**< The distance to the midpoint of
the Y arm in meters (unused for bars: set it to zero) */ | |
| } | | } | |
| LALFrDetector; | | LALFrDetector; | |
| | | | |
|
| /** Detector structure | | /** | |
| | | * Detector structure | |
| * | | * | |
| * Structure to contain detector data in the format most easily used | | * Structure to contain detector data in the format most easily used | |
| * by the LAL routines. | | * by the LAL routines. | |
| */ | | */ | |
| typedef struct tagLALDetector | | typedef struct tagLALDetector | |
| { | | { | |
| REAL8 location[3]; /**< The three components, in an Ear
th-fixed Cartesian coordinate system, of the position vector from the cente
r of the Earth to the detector in meters */ | | REAL8 location[3]; /**< The three components, in an Ear
th-fixed Cartesian coordinate system, of the position vector from the cente
r of the Earth to the detector in meters */ | |
| REAL4 response[3][3]; /**< The Earth-fixed Cartesian compo
nents of the detector's response tensor \f$d^{ab}\f$ */ | | REAL4 response[3][3]; /**< The Earth-fixed Cartesian compo
nents of the detector's response tensor \f$d^{ab}\f$ */ | |
| LALDetectorType type; /**< The type of the detector (e.g.,
IFO in differential mode, cylindrical bar, etc.) */ | | LALDetectorType type; /**< The type of the detector (e.g.,
IFO in differential mode, cylindrical bar, etc.) */ | |
| LALFrDetector frDetector; /**< The original LALFrDetector stru
cture from which this was created */ | | LALFrDetector frDetector; /**< The original LALFrDetector stru
cture from which this was created */ | |
| | | | |
| skipping to change at line 263 | | skipping to change at line 265 | |
| extern const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]; | | extern const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]; | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /* Routine to create a LALDetector. */ | | /* Routine to create a LALDetector. */ | |
| LALDetector * XLALCreateDetector( LALDetector *detector, const LALFrDetecto
r *frDetector, LALDetectorType type ); | | LALDetector * XLALCreateDetector( LALDetector *detector, const LALFrDetecto
r *frDetector, LALDetectorType type ); | |
| void LALCreateDetector( LALStatus *status, LALDetector *output, const LALFr
Detector *input, const LALDetectorType type ); | | void LALCreateDetector( LALStatus *status, LALDetector *output, const LALFr
Detector *input, const LALDetectorType type ); | |
| | | | |
| /* Interferometric Detectors */ | | /* Interferometric Detectors */ | |
| | | | |
|
| /** \defgroup DetectorConstants Detector Constants | | /** | |
| | | * \defgroup DetectorConstants Detector Constants | |
| * \ingroup LALDetectors_h | | * \ingroup LALDetectors_h | |
| * \brief Constants describing various gravitational wave detectors | | * \brief Constants describing various gravitational wave detectors | |
| * | | * | |
| * The \ref LALDetectors_h also defines numerical constants that describe t
he location and | | * The \ref LALDetectors_h also defines numerical constants that describe t
he location and | |
| * geometry of several operating gravitational wave detectors. | | * geometry of several operating gravitational wave detectors. | |
| * These detectors are both resonant mass (bar) detectors and interferometr
ic | | * These detectors are both resonant mass (bar) detectors and interferometr
ic | |
| * detectors. | | * detectors. | |
| * <ul> | | * <ul> | |
| * <li> Data for the resonant mass detectors is taken from: | | * <li> Data for the resonant mass detectors is taken from: | |
|
| * http://igec.lnl.infn.it/cgi-bin/browser.pl?Level=0,3,1 | | * http://igec.lnl.infn.it/cgi-bin/browser.pl?Level=0,3,1 | |
| * and [\ref FinnLazzarini_2001] | | * and \cite FinnLazzarini_2001 | |
| * | | * | |
|
| * <li> Data for LIGO detectors is taken from [\ref Althouse_1999] | | * <li> Data for LIGO detectors is taken from \cite Althouse_1999 | |
| * | | * | |
| * <li> Data for the VIRGO detector is provided by Benoit Mours. | | * <li> Data for the VIRGO detector is provided by Benoit Mours. | |
| * | | * | |
| * <li> Data for the GEO detector is taken from: | | * <li> Data for the GEO detector is taken from: | |
| * | | * | |
|
| * http://www.geo600.uni-hannover.de/geo600/project/location.html | | * http://www.geo600.uni-hannover.de/geo600/project/location.html | |
| * | | * | |
| * <li> Data for the TAMA detector is provided by Masa-Katsu Fujimoto | | * <li> Data for the TAMA detector is provided by Masa-Katsu Fujimoto | |
| * | | * | |
|
| * <li> Data for the Caltech detector is taken from [\ref Allen_1996] | | * <li> Data for the Caltech detector is taken from \cite Allen_1996 | |
| * </ul> | | * </ul> | |
| * | | * | |
|
| * See the technical document [\ref ABCCRW_2001] for details. | | * See the technical document \cite ABCCRW_2001 for details. | |
| * | | * | |
| * Data in this file (e.g., angle conventions etc.) is intended | | * Data in this file (e.g., angle conventions etc.) is intended | |
|
| * to conform to the conventions of the Frame format specification [\ref LI
GOVIRGO_2000] | | * to conform to the conventions of the Frame format specification \cite LI
GOVIRGO_2000 | |
| * | | * | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| /** \name TAMA 300m Interferometric Detector constants | | /** | |
| | | * \name TAMA 300m Interferometric Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * TAMA 300m Interferometric Detector. */ | | * TAMA 300m Interferometric Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_TAMA_300_DETECTOR_NAME "TAMA_300" /**<
TAMA_300 detector name string */ | | #define LAL_TAMA_300_DETECTOR_NAME "TAMA_300" /**<
TAMA_300 detector name string */ | |
| #define LAL_TAMA_300_DETECTOR_PREFIX "T1" /**< TAMA_30
0 detector prefix string */ | | #define LAL_TAMA_300_DETECTOR_PREFIX "T1" /**< TAMA_30
0 detector prefix string */ | |
| #define LAL_TAMA_300_DETECTOR_LONGITUDE_RAD 2.43536359469 /**<
TAMA_300 vertex longitude (rad) */ | | #define LAL_TAMA_300_DETECTOR_LONGITUDE_RAD 2.43536359469 /**<
TAMA_300 vertex longitude (rad) */ | |
| #define LAL_TAMA_300_DETECTOR_LATITUDE_RAD 0.62267336022 /**<
TAMA_300 vertex latitude (rad) */ | | #define LAL_TAMA_300_DETECTOR_LATITUDE_RAD 0.62267336022 /**<
TAMA_300 vertex latitude (rad) */ | |
| #define LAL_TAMA_300_DETECTOR_ELEVATION_SI 90 /**< TAMA_30
0 vertex elevation (m) */ | | #define LAL_TAMA_300_DETECTOR_ELEVATION_SI 90 /**< TAMA_30
0 vertex elevation (m) */ | |
| #define LAL_TAMA_300_DETECTOR_ARM_X_AZIMUTH_RAD 4.71238898038 /**<
TAMA_300 x arm azimuth (rad) */ | | #define LAL_TAMA_300_DETECTOR_ARM_X_AZIMUTH_RAD 4.71238898038 /**<
TAMA_300 x arm azimuth (rad) */ | |
| #define LAL_TAMA_300_DETECTOR_ARM_Y_AZIMUTH_RAD 3.14159265359 /**<
TAMA_300 y arm azimuth (rad) */ | | #define LAL_TAMA_300_DETECTOR_ARM_Y_AZIMUTH_RAD 3.14159265359 /**<
TAMA_300 y arm azimuth (rad) */ | |
| #define LAL_TAMA_300_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
TAMA_300 x arm altitude (rad) */ | | #define LAL_TAMA_300_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
TAMA_300 x arm altitude (rad) */ | |
| #define LAL_TAMA_300_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
TAMA_300 y arm altitude (rad) */ | | #define LAL_TAMA_300_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
TAMA_300 y arm altitude (rad) */ | |
| | | | |
| skipping to change at line 323 | | skipping to change at line 328 | |
| #define LAL_TAMA_300_VERTEX_LOCATION_Y_SI 3.36625902802e+06
/**< TAMA_300 y-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_TAMA_300_VERTEX_LOCATION_Y_SI 3.36625902802e+06
/**< TAMA_300 y-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_TAMA_300_VERTEX_LOCATION_Z_SI 3.69915069233e+06
/**< TAMA_300 z-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_TAMA_300_VERTEX_LOCATION_Z_SI 3.69915069233e+06
/**< TAMA_300 z-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_TAMA_300_ARM_X_DIRECTION_X 0.64896940530 /**<
TAMA_300 x-component of unit vector pointing along x arm in Earth-centered
frame */ | | #define LAL_TAMA_300_ARM_X_DIRECTION_X 0.64896940530 /**<
TAMA_300 x-component of unit vector pointing along x arm in Earth-centered
frame */ | |
| #define LAL_TAMA_300_ARM_X_DIRECTION_Y 0.76081450498 /**<
TAMA_300 y-component of unit vector pointing along x arm in Earth-centered
frame */ | | #define LAL_TAMA_300_ARM_X_DIRECTION_Y 0.76081450498 /**<
TAMA_300 y-component of unit vector pointing along x arm in Earth-centered
frame */ | |
| #define LAL_TAMA_300_ARM_X_DIRECTION_Z -0.00000000000 /**<
TAMA_300 z-component of unit vector pointing along x arm in Earth-centered
frame */ | | #define LAL_TAMA_300_ARM_X_DIRECTION_Z -0.00000000000 /**<
TAMA_300 z-component of unit vector pointing along x arm in Earth-centered
frame */ | |
| #define LAL_TAMA_300_ARM_Y_DIRECTION_X -0.44371376921 /**<
TAMA_300 x-component of unit vector pointing along y arm in Earth-centered
frame */ | | #define LAL_TAMA_300_ARM_Y_DIRECTION_X -0.44371376921 /**<
TAMA_300 x-component of unit vector pointing along y arm in Earth-centered
frame */ | |
| #define LAL_TAMA_300_ARM_Y_DIRECTION_Y 0.37848471479 /**<
TAMA_300 y-component of unit vector pointing along y arm in Earth-centered
frame */ | | #define LAL_TAMA_300_ARM_Y_DIRECTION_Y 0.37848471479 /**<
TAMA_300 y-component of unit vector pointing along y arm in Earth-centered
frame */ | |
| #define LAL_TAMA_300_ARM_Y_DIRECTION_Z -0.81232223390 /**<
TAMA_300 z-component of unit vector pointing along y arm in Earth-centered
frame */ | | #define LAL_TAMA_300_ARM_Y_DIRECTION_Z -0.81232223390 /**<
TAMA_300 z-component of unit vector pointing along y arm in Earth-centered
frame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name VIRGO 3km Interferometric Detector constants | | /** | |
| | | * \name VIRGO 3km Interferometric Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * VIRGO 3km Interferometric Detector. */ | | * VIRGO 3km Interferometric Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_VIRGO_DETECTOR_NAME "VIRGO" /**< VIRGO detector
name string */ | | #define LAL_VIRGO_DETECTOR_NAME "VIRGO" /**< VIRGO detector
name string */ | |
| #define LAL_VIRGO_DETECTOR_PREFIX "V1" /**< VIRGO detector
prefix string */ | | #define LAL_VIRGO_DETECTOR_PREFIX "V1" /**< VIRGO detector
prefix string */ | |
| #define LAL_VIRGO_DETECTOR_LONGITUDE_RAD 0.18333805213 /**< VIRGO v
ertex longitude (rad) */ | | #define LAL_VIRGO_DETECTOR_LONGITUDE_RAD 0.18333805213 /**< VIRGO v
ertex longitude (rad) */ | |
| #define LAL_VIRGO_DETECTOR_LATITUDE_RAD 0.76151183984 /**< VIRGO v
ertex latitude (rad) */ | | #define LAL_VIRGO_DETECTOR_LATITUDE_RAD 0.76151183984 /**< VIRGO v
ertex latitude (rad) */ | |
| #define LAL_VIRGO_DETECTOR_ELEVATION_SI 51.884 /**< VIRGO vertex el
evation (m) */ | | #define LAL_VIRGO_DETECTOR_ELEVATION_SI 51.884 /**< VIRGO vertex el
evation (m) */ | |
| #define LAL_VIRGO_DETECTOR_ARM_X_AZIMUTH_RAD 0.33916285222 /**< VIRGO x
arm azimuth (rad) */ | | #define LAL_VIRGO_DETECTOR_ARM_X_AZIMUTH_RAD 0.33916285222 /**< VIRGO x
arm azimuth (rad) */ | |
| #define LAL_VIRGO_DETECTOR_ARM_Y_AZIMUTH_RAD 5.05155183261 /**< VIRGO y
arm azimuth (rad) */ | | #define LAL_VIRGO_DETECTOR_ARM_Y_AZIMUTH_RAD 5.05155183261 /**< VIRGO y
arm azimuth (rad) */ | |
| #define LAL_VIRGO_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< VIRGO x
arm altitude (rad) */ | | #define LAL_VIRGO_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< VIRGO x
arm altitude (rad) */ | |
| #define LAL_VIRGO_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< VIRGO y
arm altitude (rad) */ | | #define LAL_VIRGO_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< VIRGO y
arm altitude (rad) */ | |
| | | | |
| skipping to change at line 349 | | skipping to change at line 356 | |
| #define LAL_VIRGO_VERTEX_LOCATION_Y_SI 8.42989697626e+05 /**<
VIRGO y-component of vertex location in Earth-centered frame (m) */ | | #define LAL_VIRGO_VERTEX_LOCATION_Y_SI 8.42989697626e+05 /**<
VIRGO y-component of vertex location in Earth-centered frame (m) */ | |
| #define LAL_VIRGO_VERTEX_LOCATION_Z_SI 4.37857696241e+06 /**<
VIRGO z-component of vertex location in Earth-centered frame (m) */ | | #define LAL_VIRGO_VERTEX_LOCATION_Z_SI 4.37857696241e+06 /**<
VIRGO z-component of vertex location in Earth-centered frame (m) */ | |
| #define LAL_VIRGO_ARM_X_DIRECTION_X -0.70045821479 /**< VIRGO x
-component of unit vector pointing along x arm in Earth-centered frame */ | | #define LAL_VIRGO_ARM_X_DIRECTION_X -0.70045821479 /**< VIRGO x
-component of unit vector pointing along x arm in Earth-centered frame */ | |
| #define LAL_VIRGO_ARM_X_DIRECTION_Y 0.20848948619 /**< VIRGO y
-component of unit vector pointing along x arm in Earth-centered frame */ | | #define LAL_VIRGO_ARM_X_DIRECTION_Y 0.20848948619 /**< VIRGO y
-component of unit vector pointing along x arm in Earth-centered frame */ | |
| #define LAL_VIRGO_ARM_X_DIRECTION_Z 0.68256166277 /**< VIRGO z
-component of unit vector pointing along x arm in Earth-centered frame */ | | #define LAL_VIRGO_ARM_X_DIRECTION_Z 0.68256166277 /**< VIRGO z
-component of unit vector pointing along x arm in Earth-centered frame */ | |
| #define LAL_VIRGO_ARM_Y_DIRECTION_X -0.05379255368 /**< VIRGO x
-component of unit vector pointing along y arm in Earth-centered frame */ | | #define LAL_VIRGO_ARM_Y_DIRECTION_X -0.05379255368 /**< VIRGO x
-component of unit vector pointing along y arm in Earth-centered frame */ | |
| #define LAL_VIRGO_ARM_Y_DIRECTION_Y -0.96908180549 /**< VIRGO y
-component of unit vector pointing along y arm in Earth-centered frame */ | | #define LAL_VIRGO_ARM_Y_DIRECTION_Y -0.96908180549 /**< VIRGO y
-component of unit vector pointing along y arm in Earth-centered frame */ | |
| #define LAL_VIRGO_ARM_Y_DIRECTION_Z 0.24080451708 /**< VIRGO z
-component of unit vector pointing along y arm in Earth-centered frame */ | | #define LAL_VIRGO_ARM_Y_DIRECTION_Z 0.24080451708 /**< VIRGO z
-component of unit vector pointing along y arm in Earth-centered frame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name GEO 600m Interferometric Detector constants | | /** | |
| | | * \name GEO 600m Interferometric Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * GEO 600m Interferometric Detector. */ | | * GEO 600m Interferometric Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_GEO_600_DETECTOR_NAME "GEO_600" /**<
GEO_600 detector name string */ | | #define LAL_GEO_600_DETECTOR_NAME "GEO_600" /**<
GEO_600 detector name string */ | |
| #define LAL_GEO_600_DETECTOR_PREFIX "G1" /**< GEO_600
detector prefix string */ | | #define LAL_GEO_600_DETECTOR_PREFIX "G1" /**< GEO_600
detector prefix string */ | |
| #define LAL_GEO_600_DETECTOR_LONGITUDE_RAD 0.17116780435 /**<
GEO_600 vertex longitude (rad) */ | | #define LAL_GEO_600_DETECTOR_LONGITUDE_RAD 0.17116780435 /**<
GEO_600 vertex longitude (rad) */ | |
| #define LAL_GEO_600_DETECTOR_LATITUDE_RAD 0.91184982752 /**<
GEO_600 vertex latitude (rad) */ | | #define LAL_GEO_600_DETECTOR_LATITUDE_RAD 0.91184982752 /**<
GEO_600 vertex latitude (rad) */ | |
| #define LAL_GEO_600_DETECTOR_ELEVATION_SI 114.425 /**< GEO_600
vertex elevation (m) */ | | #define LAL_GEO_600_DETECTOR_ELEVATION_SI 114.425 /**< GEO_600
vertex elevation (m) */ | |
| #define LAL_GEO_600_DETECTOR_ARM_X_AZIMUTH_RAD 1.19360100484 /**<
GEO_600 x arm azimuth (rad) */ | | #define LAL_GEO_600_DETECTOR_ARM_X_AZIMUTH_RAD 1.19360100484 /**<
GEO_600 x arm azimuth (rad) */ | |
| #define LAL_GEO_600_DETECTOR_ARM_Y_AZIMUTH_RAD 5.83039279401 /**<
GEO_600 y arm azimuth (rad) */ | | #define LAL_GEO_600_DETECTOR_ARM_Y_AZIMUTH_RAD 5.83039279401 /**<
GEO_600 y arm azimuth (rad) */ | |
| #define LAL_GEO_600_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
GEO_600 x arm altitude (rad) */ | | #define LAL_GEO_600_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
GEO_600 x arm altitude (rad) */ | |
| #define LAL_GEO_600_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
GEO_600 y arm altitude (rad) */ | | #define LAL_GEO_600_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
GEO_600 y arm altitude (rad) */ | |
| | | | |
| skipping to change at line 375 | | skipping to change at line 384 | |
| #define LAL_GEO_600_VERTEX_LOCATION_Y_SI 6.66598956317e+05
/**< GEO_600 y-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_GEO_600_VERTEX_LOCATION_Y_SI 6.66598956317e+05
/**< GEO_600 y-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_GEO_600_VERTEX_LOCATION_Z_SI 5.01964141725e+06
/**< GEO_600 z-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_GEO_600_VERTEX_LOCATION_Z_SI 5.01964141725e+06
/**< GEO_600 z-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_GEO_600_ARM_X_DIRECTION_X -0.44530676905 /**<
GEO_600 x-component of unit vector pointing along x arm in Earth-centered
frame */ | | #define LAL_GEO_600_ARM_X_DIRECTION_X -0.44530676905 /**<
GEO_600 x-component of unit vector pointing along x arm in Earth-centered
frame */ | |
| #define LAL_GEO_600_ARM_X_DIRECTION_Y 0.86651354130 /**<
GEO_600 y-component of unit vector pointing along x arm in Earth-centered
frame */ | | #define LAL_GEO_600_ARM_X_DIRECTION_Y 0.86651354130 /**<
GEO_600 y-component of unit vector pointing along x arm in Earth-centered
frame */ | |
| #define LAL_GEO_600_ARM_X_DIRECTION_Z 0.22551311312 /**<
GEO_600 z-component of unit vector pointing along x arm in Earth-centered
frame */ | | #define LAL_GEO_600_ARM_X_DIRECTION_Z 0.22551311312 /**<
GEO_600 z-component of unit vector pointing along x arm in Earth-centered
frame */ | |
| #define LAL_GEO_600_ARM_Y_DIRECTION_X -0.62605756776 /**<
GEO_600 x-component of unit vector pointing along y arm in Earth-centered
frame */ | | #define LAL_GEO_600_ARM_Y_DIRECTION_X -0.62605756776 /**<
GEO_600 x-component of unit vector pointing along y arm in Earth-centered
frame */ | |
| #define LAL_GEO_600_ARM_Y_DIRECTION_Y -0.55218609524 /**<
GEO_600 y-component of unit vector pointing along y arm in Earth-centered
frame */ | | #define LAL_GEO_600_ARM_Y_DIRECTION_Y -0.55218609524 /**<
GEO_600 y-component of unit vector pointing along y arm in Earth-centered
frame */ | |
| #define LAL_GEO_600_ARM_Y_DIRECTION_Z 0.55058372486 /**<
GEO_600 z-component of unit vector pointing along y arm in Earth-centered
frame */ | | #define LAL_GEO_600_ARM_Y_DIRECTION_Z 0.55058372486 /**<
GEO_600 z-component of unit vector pointing along y arm in Earth-centered
frame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name LIGO Hanford Observatory 2km Interferometric Detector constants | | /** | |
| | | * \name LIGO Hanford Observatory 2km Interferometric Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * LIGO Hanford Observatory 2km Interferometric Detector. */ | | * LIGO Hanford Observatory 2km Interferometric Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_LHO_2K_DETECTOR_NAME "LHO_2k" /**<
LHO_2k detector name string */ | | #define LAL_LHO_2K_DETECTOR_NAME "LHO_2k" /**<
LHO_2k detector name string */ | |
| #define LAL_LHO_2K_DETECTOR_PREFIX "H2" /**< LHO_2k
detector prefix string */ | | #define LAL_LHO_2K_DETECTOR_PREFIX "H2" /**< LHO_2k
detector prefix string */ | |
| #define LAL_LHO_2K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**<
LHO_2k vertex longitude (rad) */ | | #define LAL_LHO_2K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**<
LHO_2k vertex longitude (rad) */ | |
| #define LAL_LHO_2K_DETECTOR_LATITUDE_RAD 0.81079526383 /**<
LHO_2k vertex latitude (rad) */ | | #define LAL_LHO_2K_DETECTOR_LATITUDE_RAD 0.81079526383 /**<
LHO_2k vertex latitude (rad) */ | |
| #define LAL_LHO_2K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_2k
vertex elevation (m) */ | | #define LAL_LHO_2K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_2k
vertex elevation (m) */ | |
| #define LAL_LHO_2K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**<
LHO_2k x arm azimuth (rad) */ | | #define LAL_LHO_2K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**<
LHO_2k x arm azimuth (rad) */ | |
| #define LAL_LHO_2K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**<
LHO_2k y arm azimuth (rad) */ | | #define LAL_LHO_2K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**<
LHO_2k y arm azimuth (rad) */ | |
| #define LAL_LHO_2K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**<
LHO_2k x arm altitude (rad) */ | | #define LAL_LHO_2K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**<
LHO_2k x arm altitude (rad) */ | |
| #define LAL_LHO_2K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**<
LHO_2k y arm altitude (rad) */ | | #define LAL_LHO_2K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**<
LHO_2k y arm altitude (rad) */ | |
| | | | |
| skipping to change at line 401 | | skipping to change at line 412 | |
| #define LAL_LHO_2K_VERTEX_LOCATION_Y_SI -3.83469517889e+06
/**< LHO_2k y-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_LHO_2K_VERTEX_LOCATION_Y_SI -3.83469517889e+06
/**< LHO_2k y-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_LHO_2K_VERTEX_LOCATION_Z_SI 4.60035022664e+06
/**< LHO_2k z-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_LHO_2K_VERTEX_LOCATION_Z_SI 4.60035022664e+06
/**< LHO_2k z-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_LHO_2K_ARM_X_DIRECTION_X -0.22389266154 /**<
LHO_2k x-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LHO_2K_ARM_X_DIRECTION_X -0.22389266154 /**<
LHO_2k x-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LHO_2K_ARM_X_DIRECTION_Y 0.79983062746 /**<
LHO_2k y-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LHO_2K_ARM_X_DIRECTION_Y 0.79983062746 /**<
LHO_2k y-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LHO_2K_ARM_X_DIRECTION_Z 0.55690487831 /**<
LHO_2k z-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LHO_2K_ARM_X_DIRECTION_Z 0.55690487831 /**<
LHO_2k z-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LHO_2K_ARM_Y_DIRECTION_X -0.91397818574 /**<
LHO_2k x-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LHO_2K_ARM_Y_DIRECTION_X -0.91397818574 /**<
LHO_2k x-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_LHO_2K_ARM_Y_DIRECTION_Y 0.02609403989 /**<
LHO_2k y-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LHO_2K_ARM_Y_DIRECTION_Y 0.02609403989 /**<
LHO_2k y-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_LHO_2K_ARM_Y_DIRECTION_Z -0.40492342125 /**<
LHO_2k z-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LHO_2K_ARM_Y_DIRECTION_Z -0.40492342125 /**<
LHO_2k z-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name LIGO Hanford Observatory 4km Interferometric Detector constants | | /** | |
| | | * \name LIGO Hanford Observatory 4km Interferometric Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * LIGO Hanford Observatory 4km Interferometric Detector. */ | | * LIGO Hanford Observatory 4km Interferometric Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_LHO_4K_DETECTOR_NAME "LHO_4k" /**<
LHO_4k detector name string */ | | #define LAL_LHO_4K_DETECTOR_NAME "LHO_4k" /**<
LHO_4k detector name string */ | |
| #define LAL_LHO_4K_DETECTOR_PREFIX "H1" /**< LHO_4k
detector prefix string */ | | #define LAL_LHO_4K_DETECTOR_PREFIX "H1" /**< LHO_4k
detector prefix string */ | |
| #define LAL_LHO_4K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**<
LHO_4k vertex longitude (rad) */ | | #define LAL_LHO_4K_DETECTOR_LONGITUDE_RAD -2.08405676917 /**<
LHO_4k vertex longitude (rad) */ | |
| #define LAL_LHO_4K_DETECTOR_LATITUDE_RAD 0.81079526383 /**<
LHO_4k vertex latitude (rad) */ | | #define LAL_LHO_4K_DETECTOR_LATITUDE_RAD 0.81079526383 /**<
LHO_4k vertex latitude (rad) */ | |
| #define LAL_LHO_4K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_4k
vertex elevation (m) */ | | #define LAL_LHO_4K_DETECTOR_ELEVATION_SI 142.554 /**< LHO_4k
vertex elevation (m) */ | |
| #define LAL_LHO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**<
LHO_4k x arm azimuth (rad) */ | | #define LAL_LHO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 5.65487724844 /**<
LHO_4k x arm azimuth (rad) */ | |
| #define LAL_LHO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**<
LHO_4k y arm azimuth (rad) */ | | #define LAL_LHO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 4.08408092164 /**<
LHO_4k y arm azimuth (rad) */ | |
| #define LAL_LHO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**<
LHO_4k x arm altitude (rad) */ | | #define LAL_LHO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00061950000 /**<
LHO_4k x arm altitude (rad) */ | |
| #define LAL_LHO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**<
LHO_4k y arm altitude (rad) */ | | #define LAL_LHO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00001250000 /**<
LHO_4k y arm altitude (rad) */ | |
| | | | |
| skipping to change at line 427 | | skipping to change at line 440 | |
| #define LAL_LHO_4K_VERTEX_LOCATION_Y_SI -3.83469517889e+06
/**< LHO_4k y-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_LHO_4K_VERTEX_LOCATION_Y_SI -3.83469517889e+06
/**< LHO_4k y-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_LHO_4K_VERTEX_LOCATION_Z_SI 4.60035022664e+06
/**< LHO_4k z-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_LHO_4K_VERTEX_LOCATION_Z_SI 4.60035022664e+06
/**< LHO_4k z-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_LHO_4K_ARM_X_DIRECTION_X -0.22389266154 /**<
LHO_4k x-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LHO_4K_ARM_X_DIRECTION_X -0.22389266154 /**<
LHO_4k x-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LHO_4K_ARM_X_DIRECTION_Y 0.79983062746 /**<
LHO_4k y-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LHO_4K_ARM_X_DIRECTION_Y 0.79983062746 /**<
LHO_4k y-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LHO_4K_ARM_X_DIRECTION_Z 0.55690487831 /**<
LHO_4k z-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LHO_4K_ARM_X_DIRECTION_Z 0.55690487831 /**<
LHO_4k z-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LHO_4K_ARM_Y_DIRECTION_X -0.91397818574 /**<
LHO_4k x-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LHO_4K_ARM_Y_DIRECTION_X -0.91397818574 /**<
LHO_4k x-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_LHO_4K_ARM_Y_DIRECTION_Y 0.02609403989 /**<
LHO_4k y-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LHO_4K_ARM_Y_DIRECTION_Y 0.02609403989 /**<
LHO_4k y-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_LHO_4K_ARM_Y_DIRECTION_Z -0.40492342125 /**<
LHO_4k z-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LHO_4K_ARM_Y_DIRECTION_Z -0.40492342125 /**<
LHO_4k z-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name LIGO Livingston Observatory 4km Interferometric Detector constant | | /** | |
| s | | * \name LIGO Livingston Observatory 4km Interferometric Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * LIGO Livingston Observatory 4km Interferometric Detector. */ | | * LIGO Livingston Observatory 4km Interferometric Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_LLO_4K_DETECTOR_NAME "LLO_4k" /**<
LLO_4k detector name string */ | | #define LAL_LLO_4K_DETECTOR_NAME "LLO_4k" /**<
LLO_4k detector name string */ | |
| #define LAL_LLO_4K_DETECTOR_PREFIX "L1" /**< LLO_4k
detector prefix string */ | | #define LAL_LLO_4K_DETECTOR_PREFIX "L1" /**< LLO_4k
detector prefix string */ | |
| #define LAL_LLO_4K_DETECTOR_LONGITUDE_RAD -1.58430937078 /**<
LLO_4k vertex longitude (rad) */ | | #define LAL_LLO_4K_DETECTOR_LONGITUDE_RAD -1.58430937078 /**<
LLO_4k vertex longitude (rad) */ | |
| #define LAL_LLO_4K_DETECTOR_LATITUDE_RAD 0.53342313506 /**<
LLO_4k vertex latitude (rad) */ | | #define LAL_LLO_4K_DETECTOR_LATITUDE_RAD 0.53342313506 /**<
LLO_4k vertex latitude (rad) */ | |
| #define LAL_LLO_4K_DETECTOR_ELEVATION_SI -6.574 /**< LLO_4k
vertex elevation (m) */ | | #define LAL_LLO_4K_DETECTOR_ELEVATION_SI -6.574 /**< LLO_4k
vertex elevation (m) */ | |
| #define LAL_LLO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 4.40317772346 /**<
LLO_4k x arm azimuth (rad) */ | | #define LAL_LLO_4K_DETECTOR_ARM_X_AZIMUTH_RAD 4.40317772346 /**<
LLO_4k x arm azimuth (rad) */ | |
| #define LAL_LLO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 2.83238139666 /**<
LLO_4k y arm azimuth (rad) */ | | #define LAL_LLO_4K_DETECTOR_ARM_Y_AZIMUTH_RAD 2.83238139666 /**<
LLO_4k y arm azimuth (rad) */ | |
| #define LAL_LLO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00031210000 /**<
LLO_4k x arm altitude (rad) */ | | #define LAL_LLO_4K_DETECTOR_ARM_X_ALTITUDE_RAD -0.00031210000 /**<
LLO_4k x arm altitude (rad) */ | |
| #define LAL_LLO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD -0.00061070000 /**<
LLO_4k y arm altitude (rad) */ | | #define LAL_LLO_4K_DETECTOR_ARM_Y_ALTITUDE_RAD -0.00061070000 /**<
LLO_4k y arm altitude (rad) */ | |
| | | | |
| skipping to change at line 453 | | skipping to change at line 468 | |
| #define LAL_LLO_4K_VERTEX_LOCATION_Y_SI -5.49628371971e+06
/**< LLO_4k y-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_LLO_4K_VERTEX_LOCATION_Y_SI -5.49628371971e+06
/**< LLO_4k y-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_LLO_4K_VERTEX_LOCATION_Z_SI 3.22425701744e+06
/**< LLO_4k z-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_LLO_4K_VERTEX_LOCATION_Z_SI 3.22425701744e+06
/**< LLO_4k z-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_LLO_4K_ARM_X_DIRECTION_X -0.95457412153 /**<
LLO_4k x-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LLO_4K_ARM_X_DIRECTION_X -0.95457412153 /**<
LLO_4k x-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LLO_4K_ARM_X_DIRECTION_Y -0.14158077340 /**<
LLO_4k y-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LLO_4K_ARM_X_DIRECTION_Y -0.14158077340 /**<
LLO_4k y-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LLO_4K_ARM_X_DIRECTION_Z -0.26218911324 /**<
LLO_4k z-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_LLO_4K_ARM_X_DIRECTION_Z -0.26218911324 /**<
LLO_4k z-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_LLO_4K_ARM_Y_DIRECTION_X 0.29774156894 /**<
LLO_4k x-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LLO_4K_ARM_Y_DIRECTION_X 0.29774156894 /**<
LLO_4k x-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_LLO_4K_ARM_Y_DIRECTION_Y -0.48791033647 /**<
LLO_4k y-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LLO_4K_ARM_Y_DIRECTION_Y -0.48791033647 /**<
LLO_4k y-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_LLO_4K_ARM_Y_DIRECTION_Z -0.82054461286 /**<
LLO_4k z-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_LLO_4K_ARM_Y_DIRECTION_Z -0.82054461286 /**<
LLO_4k z-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Caltech 40m Prototype Detector constants | | /** | |
| | | * \name Caltech 40m Prototype Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * Caltech 40m Prototype Detector. */ | | * Caltech 40m Prototype Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_CIT_40_DETECTOR_NAME "CIT_40" /**<
CIT_40 detector name string */ | | #define LAL_CIT_40_DETECTOR_NAME "CIT_40" /**<
CIT_40 detector name string */ | |
| #define LAL_CIT_40_DETECTOR_PREFIX "P1" /**< CIT_40
detector prefix string */ | | #define LAL_CIT_40_DETECTOR_PREFIX "P1" /**< CIT_40
detector prefix string */ | |
| #define LAL_CIT_40_DETECTOR_LONGITUDE_RAD -2.06175744538 /**<
CIT_40 vertex longitude (rad) */ | | #define LAL_CIT_40_DETECTOR_LONGITUDE_RAD -2.06175744538 /**<
CIT_40 vertex longitude (rad) */ | |
| #define LAL_CIT_40_DETECTOR_LATITUDE_RAD 0.59637900541 /**<
CIT_40 vertex latitude (rad) */ | | #define LAL_CIT_40_DETECTOR_LATITUDE_RAD 0.59637900541 /**<
CIT_40 vertex latitude (rad) */ | |
| #define LAL_CIT_40_DETECTOR_ELEVATION_SI 0 /**< CIT_40
vertex elevation (m) */ | | #define LAL_CIT_40_DETECTOR_ELEVATION_SI 0 /**< CIT_40
vertex elevation (m) */ | |
| #define LAL_CIT_40_DETECTOR_ARM_X_AZIMUTH_RAD 3.14159265359 /**<
CIT_40 x arm azimuth (rad) */ | | #define LAL_CIT_40_DETECTOR_ARM_X_AZIMUTH_RAD 3.14159265359 /**<
CIT_40 x arm azimuth (rad) */ | |
| #define LAL_CIT_40_DETECTOR_ARM_Y_AZIMUTH_RAD 1.57079632679 /**<
CIT_40 y arm azimuth (rad) */ | | #define LAL_CIT_40_DETECTOR_ARM_Y_AZIMUTH_RAD 1.57079632679 /**<
CIT_40 y arm azimuth (rad) */ | |
| #define LAL_CIT_40_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
CIT_40 x arm altitude (rad) */ | | #define LAL_CIT_40_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
CIT_40 x arm altitude (rad) */ | |
| #define LAL_CIT_40_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
CIT_40 y arm altitude (rad) */ | | #define LAL_CIT_40_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
CIT_40 y arm altitude (rad) */ | |
| | | | |
| skipping to change at line 481 | | skipping to change at line 498 | |
| #define LAL_CIT_40_ARM_X_DIRECTION_X -0.26480331633 /**<
CIT_40 x-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_CIT_40_ARM_X_DIRECTION_X -0.26480331633 /**<
CIT_40 x-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_CIT_40_ARM_X_DIRECTION_Y -0.49530818538 /**<
CIT_40 y-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_CIT_40_ARM_X_DIRECTION_Y -0.49530818538 /**<
CIT_40 y-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_CIT_40_ARM_X_DIRECTION_Z -0.82737476706 /**<
CIT_40 z-component of unit vector pointing along x arm in Earth-centered f
rame */ | | #define LAL_CIT_40_ARM_X_DIRECTION_Z -0.82737476706 /**<
CIT_40 z-component of unit vector pointing along x arm in Earth-centered f
rame */ | |
| #define LAL_CIT_40_ARM_Y_DIRECTION_X 0.88188012386 /**<
CIT_40 x-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_CIT_40_ARM_Y_DIRECTION_X 0.88188012386 /**<
CIT_40 x-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_CIT_40_ARM_Y_DIRECTION_Y -0.47147369718 /**<
CIT_40 y-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_CIT_40_ARM_Y_DIRECTION_Y -0.47147369718 /**<
CIT_40 y-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| #define LAL_CIT_40_ARM_Y_DIRECTION_Z 0.00000000000 /**<
CIT_40 z-component of unit vector pointing along y arm in Earth-centered f
rame */ | | #define LAL_CIT_40_ARM_Y_DIRECTION_Z 0.00000000000 /**<
CIT_40 z-component of unit vector pointing along y arm in Earth-centered f
rame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /* Resonant Mass (Bar) Detectors */ | | /* Resonant Mass (Bar) Detectors */ | |
| | | | |
|
| /** \name ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis | | /** | |
| " constants | | * \name ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis" | |
| | | constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis". */ | | * ALLEGRO Resonant Mass Detector with 320 degree azimuth "IGEC axis". | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_ALLEGRO_320_DETECTOR_NAME "ALLEGRO_320" /**<
ALLEGRO_320 detector name string */ | | #define LAL_ALLEGRO_320_DETECTOR_NAME "ALLEGRO_320" /**<
ALLEGRO_320 detector name string */ | |
| #define LAL_ALLEGRO_320_DETECTOR_PREFIX "A1" /**< ALLEGRO
_320 detector prefix string */ | | #define LAL_ALLEGRO_320_DETECTOR_PREFIX "A1" /**< ALLEGRO
_320 detector prefix string */ | |
| #define LAL_ALLEGRO_320_DETECTOR_LONGITUDE_RAD -1.59137068496 /**<
ALLEGRO_320 vertex longitude (rad) */ | | #define LAL_ALLEGRO_320_DETECTOR_LONGITUDE_RAD -1.59137068496 /**<
ALLEGRO_320 vertex longitude (rad) */ | |
| #define LAL_ALLEGRO_320_DETECTOR_LATITUDE_RAD 0.53079879206 /**<
ALLEGRO_320 vertex latitude (rad) */ | | #define LAL_ALLEGRO_320_DETECTOR_LATITUDE_RAD 0.53079879206 /**<
ALLEGRO_320 vertex latitude (rad) */ | |
| #define LAL_ALLEGRO_320_DETECTOR_ELEVATION_SI 0 /**< ALLEGRO
_320 vertex elevation (m) */ | | #define LAL_ALLEGRO_320_DETECTOR_ELEVATION_SI 0 /**< ALLEGRO
_320 vertex elevation (m) */ | |
| #define LAL_ALLEGRO_320_DETECTOR_ARM_X_AZIMUTH_RAD -0.69813170080 /**<
ALLEGRO_320 x arm azimuth (rad) */ | | #define LAL_ALLEGRO_320_DETECTOR_ARM_X_AZIMUTH_RAD -0.69813170080 /**<
ALLEGRO_320 x arm azimuth (rad) */ | |
| #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
ALLEGRO_320 y arm azimuth (rad) UNUSED FOR BARS */ | | #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
ALLEGRO_320 y arm azimuth (rad) UNUSED FOR BARS */ | |
| #define LAL_ALLEGRO_320_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
ALLEGRO_320 x arm altitude (rad) */ | | #define LAL_ALLEGRO_320_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
ALLEGRO_320 x arm altitude (rad) */ | |
| #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
ALLEGRO_320 y arm altitude (rad) UNUSED FOR BARS */ | | #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
ALLEGRO_320 y arm altitude (rad) UNUSED FOR BARS */ | |
| #define LAL_ALLEGRO_320_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
ALLEGRO_320 x arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_ALLEGRO_320_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
ALLEGRO_320 x arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
ALLEGRO_320 y arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_ALLEGRO_320_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
ALLEGRO_320 y arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_ALLEGRO_320_VERTEX_LOCATION_X_SI -1.13258964140e+05
/**< ALLEGRO_320 x-component of vertex location in Earth-centered frame
(m) */ | | #define LAL_ALLEGRO_320_VERTEX_LOCATION_X_SI -1.13258964140e+05
/**< ALLEGRO_320 x-component of vertex location in Earth-centered frame
(m) */ | |
| #define LAL_ALLEGRO_320_VERTEX_LOCATION_Y_SI -5.50408337391e+06
/**< ALLEGRO_320 y-component of vertex location in Earth-centered frame
(m) */ | | #define LAL_ALLEGRO_320_VERTEX_LOCATION_Y_SI -5.50408337391e+06
/**< ALLEGRO_320 y-component of vertex location in Earth-centered frame
(m) */ | |
| #define LAL_ALLEGRO_320_VERTEX_LOCATION_Z_SI 3.20989567981e+06
/**< ALLEGRO_320 z-component of vertex location in Earth-centered frame
(m) */ | | #define LAL_ALLEGRO_320_VERTEX_LOCATION_Z_SI 3.20989567981e+06
/**< ALLEGRO_320 z-component of vertex location in Earth-centered frame
(m) */ | |
| #define LAL_ALLEGRO_320_AXIS_DIRECTION_X -0.63467362345 /**<
ALLEGRO_320 x-component of unit vector pointing along axis in Earth-center
ed frame */ | | #define LAL_ALLEGRO_320_AXIS_DIRECTION_X -0.63467362345 /**<
ALLEGRO_320 x-component of unit vector pointing along axis in Earth-center
ed frame */ | |
| #define LAL_ALLEGRO_320_AXIS_DIRECTION_Y 0.40093077976 /**<
ALLEGRO_320 y-component of unit vector pointing along axis in Earth-center
ed frame */ | | #define LAL_ALLEGRO_320_AXIS_DIRECTION_Y 0.40093077976 /**<
ALLEGRO_320 y-component of unit vector pointing along axis in Earth-center
ed frame */ | |
| #define LAL_ALLEGRO_320_AXIS_DIRECTION_Z 0.66063901000 /**<
ALLEGRO_320 z-component of unit vector pointing along axis in Earth-center
ed frame */ | | #define LAL_ALLEGRO_320_AXIS_DIRECTION_Z 0.66063901000 /**<
ALLEGRO_320 z-component of unit vector pointing along axis in Earth-center
ed frame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name AURIGA Resonant Mass Detector constants | | /** | |
| | | * \name AURIGA Resonant Mass Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * AURIGA Resonant Mass Detector. */ | | * AURIGA Resonant Mass Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_AURIGA_DETECTOR_NAME "AURIGA" /**<
AURIGA detector name string */ | | #define LAL_AURIGA_DETECTOR_NAME "AURIGA" /**<
AURIGA detector name string */ | |
| #define LAL_AURIGA_DETECTOR_PREFIX "O1" /**< AURIGA
detector prefix string */ | | #define LAL_AURIGA_DETECTOR_PREFIX "O1" /**< AURIGA
detector prefix string */ | |
| #define LAL_AURIGA_DETECTOR_LONGITUDE_RAD 0.20853775679 /**<
AURIGA vertex longitude (rad) */ | | #define LAL_AURIGA_DETECTOR_LONGITUDE_RAD 0.20853775679 /**<
AURIGA vertex longitude (rad) */ | |
| #define LAL_AURIGA_DETECTOR_LATITUDE_RAD 0.79156499342 /**<
AURIGA vertex latitude (rad) */ | | #define LAL_AURIGA_DETECTOR_LATITUDE_RAD 0.79156499342 /**<
AURIGA vertex latitude (rad) */ | |
| #define LAL_AURIGA_DETECTOR_ELEVATION_SI 0 /**< AURIGA
vertex elevation (m) */ | | #define LAL_AURIGA_DETECTOR_ELEVATION_SI 0 /**< AURIGA
vertex elevation (m) */ | |
| #define LAL_AURIGA_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**<
AURIGA x arm azimuth (rad) */ | | #define LAL_AURIGA_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**<
AURIGA x arm azimuth (rad) */ | |
| #define LAL_AURIGA_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
AURIGA y arm azimuth (rad) UNUSED FOR BARS */ | | #define LAL_AURIGA_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
AURIGA y arm azimuth (rad) UNUSED FOR BARS */ | |
| #define LAL_AURIGA_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
AURIGA x arm altitude (rad) */ | | #define LAL_AURIGA_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
AURIGA x arm altitude (rad) */ | |
| #define LAL_AURIGA_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
AURIGA y arm altitude (rad) UNUSED FOR BARS */ | | #define LAL_AURIGA_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
AURIGA y arm altitude (rad) UNUSED FOR BARS */ | |
| #define LAL_AURIGA_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
AURIGA x arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_AURIGA_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
AURIGA x arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_AURIGA_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
AURIGA y arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_AURIGA_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
AURIGA y arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_AURIGA_VERTEX_LOCATION_X_SI 4.39246733007e+06
/**< AURIGA x-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_AURIGA_VERTEX_LOCATION_X_SI 4.39246733007e+06
/**< AURIGA x-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_AURIGA_VERTEX_LOCATION_Y_SI 9.29508666967e+05
/**< AURIGA y-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_AURIGA_VERTEX_LOCATION_Y_SI 9.29508666967e+05
/**< AURIGA y-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_AURIGA_VERTEX_LOCATION_Z_SI 4.51502913071e+06
/**< AURIGA z-component of vertex location in Earth-centered frame (m)
*/ | | #define LAL_AURIGA_VERTEX_LOCATION_Z_SI 4.51502913071e+06
/**< AURIGA z-component of vertex location in Earth-centered frame (m)
*/ | |
| #define LAL_AURIGA_AXIS_DIRECTION_X -0.64450412225 /**<
AURIGA x-component of unit vector pointing along axis in Earth-centered fr
ame */ | | #define LAL_AURIGA_AXIS_DIRECTION_X -0.64450412225 /**<
AURIGA x-component of unit vector pointing along axis in Earth-centered fr
ame */ | |
| #define LAL_AURIGA_AXIS_DIRECTION_Y 0.57365538956 /**<
AURIGA y-component of unit vector pointing along axis in Earth-centered fr
ame */ | | #define LAL_AURIGA_AXIS_DIRECTION_Y 0.57365538956 /**<
AURIGA y-component of unit vector pointing along axis in Earth-centered fr
ame */ | |
| #define LAL_AURIGA_AXIS_DIRECTION_Z 0.50550364038 /**<
AURIGA z-component of unit vector pointing along axis in Earth-centered fr
ame */ | | #define LAL_AURIGA_AXIS_DIRECTION_Z 0.50550364038 /**<
AURIGA z-component of unit vector pointing along axis in Earth-centered fr
ame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name EXPLORER Resonant Mass Detector constants | | /** | |
| | | * \name EXPLORER Resonant Mass Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * EXPLORER Resonant Mass Detector. */ | | * EXPLORER Resonant Mass Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_EXPLORER_DETECTOR_NAME "EXPLORER" /**<
EXPLORER detector name string */ | | #define LAL_EXPLORER_DETECTOR_NAME "EXPLORER" /**<
EXPLORER detector name string */ | |
| #define LAL_EXPLORER_DETECTOR_PREFIX "E1" /**< EXPLORE
R detector prefix string */ | | #define LAL_EXPLORER_DETECTOR_PREFIX "E1" /**< EXPLORE
R detector prefix string */ | |
| #define LAL_EXPLORER_DETECTOR_LONGITUDE_RAD 0.10821041362 /**<
EXPLORER vertex longitude (rad) */ | | #define LAL_EXPLORER_DETECTOR_LONGITUDE_RAD 0.10821041362 /**<
EXPLORER vertex longitude (rad) */ | |
| #define LAL_EXPLORER_DETECTOR_LATITUDE_RAD 0.81070543755 /**<
EXPLORER vertex latitude (rad) */ | | #define LAL_EXPLORER_DETECTOR_LATITUDE_RAD 0.81070543755 /**<
EXPLORER vertex latitude (rad) */ | |
| #define LAL_EXPLORER_DETECTOR_ELEVATION_SI 0 /**< EXPLORE
R vertex elevation (m) */ | | #define LAL_EXPLORER_DETECTOR_ELEVATION_SI 0 /**< EXPLORE
R vertex elevation (m) */ | |
| #define LAL_EXPLORER_DETECTOR_ARM_X_AZIMUTH_RAD 0.68067840828 /**<
EXPLORER x arm azimuth (rad) */ | | #define LAL_EXPLORER_DETECTOR_ARM_X_AZIMUTH_RAD 0.68067840828 /**<
EXPLORER x arm azimuth (rad) */ | |
| #define LAL_EXPLORER_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
EXPLORER y arm azimuth (rad) UNUSED FOR BARS */ | | #define LAL_EXPLORER_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
EXPLORER y arm azimuth (rad) UNUSED FOR BARS */ | |
| #define LAL_EXPLORER_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
EXPLORER x arm altitude (rad) */ | | #define LAL_EXPLORER_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
EXPLORER x arm altitude (rad) */ | |
| #define LAL_EXPLORER_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
EXPLORER y arm altitude (rad) UNUSED FOR BARS */ | | #define LAL_EXPLORER_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
EXPLORER y arm altitude (rad) UNUSED FOR BARS */ | |
| #define LAL_EXPLORER_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
EXPLORER x arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_EXPLORER_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
EXPLORER x arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_EXPLORER_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
EXPLORER y arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_EXPLORER_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
EXPLORER y arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_EXPLORER_VERTEX_LOCATION_X_SI 4.37645395452e+06
/**< EXPLORER x-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_EXPLORER_VERTEX_LOCATION_X_SI 4.37645395452e+06
/**< EXPLORER x-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_EXPLORER_VERTEX_LOCATION_Y_SI 4.75435044067e+05
/**< EXPLORER y-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_EXPLORER_VERTEX_LOCATION_Y_SI 4.75435044067e+05
/**< EXPLORER y-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_EXPLORER_VERTEX_LOCATION_Z_SI 4.59985274450e+06
/**< EXPLORER z-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_EXPLORER_VERTEX_LOCATION_Z_SI 4.59985274450e+06
/**< EXPLORER z-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_EXPLORER_AXIS_DIRECTION_X -0.62792641437 /**<
EXPLORER x-component of unit vector pointing along axis in Earth-centered
frame */ | | #define LAL_EXPLORER_AXIS_DIRECTION_X -0.62792641437 /**<
EXPLORER x-component of unit vector pointing along axis in Earth-centered
frame */ | |
| #define LAL_EXPLORER_AXIS_DIRECTION_Y 0.56480832712 /**<
EXPLORER y-component of unit vector pointing along axis in Earth-centered
frame */ | | #define LAL_EXPLORER_AXIS_DIRECTION_Y 0.56480832712 /**<
EXPLORER y-component of unit vector pointing along axis in Earth-centered
frame */ | |
| #define LAL_EXPLORER_AXIS_DIRECTION_Z 0.53544371484 /**<
EXPLORER z-component of unit vector pointing along axis in Earth-centered
frame */ | | #define LAL_EXPLORER_AXIS_DIRECTION_Z 0.53544371484 /**<
EXPLORER z-component of unit vector pointing along axis in Earth-centered
frame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Nautilus Resonant Mass Detector constants | | /** | |
| | | * \name Nautilus Resonant Mass Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * Nautilus Resonant Mass Detector. */ | | * Nautilus Resonant Mass Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_NAUTILUS_DETECTOR_NAME "Nautilus" /**<
Nautilus detector name string */ | | #define LAL_NAUTILUS_DETECTOR_NAME "Nautilus" /**<
Nautilus detector name string */ | |
| #define LAL_NAUTILUS_DETECTOR_PREFIX "N1" /**< Nautilu
s detector prefix string */ | | #define LAL_NAUTILUS_DETECTOR_PREFIX "N1" /**< Nautilu
s detector prefix string */ | |
| #define LAL_NAUTILUS_DETECTOR_LONGITUDE_RAD 0.22117684946 /**<
Nautilus vertex longitude (rad) */ | | #define LAL_NAUTILUS_DETECTOR_LONGITUDE_RAD 0.22117684946 /**<
Nautilus vertex longitude (rad) */ | |
| #define LAL_NAUTILUS_DETECTOR_LATITUDE_RAD 0.72996456710 /**<
Nautilus vertex latitude (rad) */ | | #define LAL_NAUTILUS_DETECTOR_LATITUDE_RAD 0.72996456710 /**<
Nautilus vertex latitude (rad) */ | |
| #define LAL_NAUTILUS_DETECTOR_ELEVATION_SI 0 /**< Nautilu
s vertex elevation (m) */ | | #define LAL_NAUTILUS_DETECTOR_ELEVATION_SI 0 /**< Nautilu
s vertex elevation (m) */ | |
| #define LAL_NAUTILUS_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**<
Nautilus x arm azimuth (rad) */ | | #define LAL_NAUTILUS_DETECTOR_ARM_X_AZIMUTH_RAD 0.76794487088 /**<
Nautilus x arm azimuth (rad) */ | |
| #define LAL_NAUTILUS_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
Nautilus y arm azimuth (rad) UNUSED FOR BARS */ | | #define LAL_NAUTILUS_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**<
Nautilus y arm azimuth (rad) UNUSED FOR BARS */ | |
| #define LAL_NAUTILUS_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
Nautilus x arm altitude (rad) */ | | #define LAL_NAUTILUS_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**<
Nautilus x arm altitude (rad) */ | |
| #define LAL_NAUTILUS_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
Nautilus y arm altitude (rad) UNUSED FOR BARS */ | | #define LAL_NAUTILUS_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**<
Nautilus y arm altitude (rad) UNUSED FOR BARS */ | |
| #define LAL_NAUTILUS_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
Nautilus x arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_NAUTILUS_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**<
Nautilus x arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_NAUTILUS_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
Nautilus y arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_NAUTILUS_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**<
Nautilus y arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_NAUTILUS_VERTEX_LOCATION_X_SI 4.64410999868e+06
/**< Nautilus x-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_NAUTILUS_VERTEX_LOCATION_X_SI 4.64410999868e+06
/**< Nautilus x-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_NAUTILUS_VERTEX_LOCATION_Y_SI 1.04425342477e+06
/**< Nautilus y-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_NAUTILUS_VERTEX_LOCATION_Y_SI 1.04425342477e+06
/**< Nautilus y-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_NAUTILUS_VERTEX_LOCATION_Z_SI 4.23104713307e+06
/**< Nautilus z-component of vertex location in Earth-centered frame (m
) */ | | #define LAL_NAUTILUS_VERTEX_LOCATION_Z_SI 4.23104713307e+06
/**< Nautilus z-component of vertex location in Earth-centered frame (m
) */ | |
| #define LAL_NAUTILUS_AXIS_DIRECTION_X -0.62039441384 /**<
Nautilus x-component of unit vector pointing along axis in Earth-centered
frame */ | | #define LAL_NAUTILUS_AXIS_DIRECTION_X -0.62039441384 /**<
Nautilus x-component of unit vector pointing along axis in Earth-centered
frame */ | |
| #define LAL_NAUTILUS_AXIS_DIRECTION_Y 0.57250373141 /**<
Nautilus y-component of unit vector pointing along axis in Earth-centered
frame */ | | #define LAL_NAUTILUS_AXIS_DIRECTION_Y 0.57250373141 /**<
Nautilus y-component of unit vector pointing along axis in Earth-centered
frame */ | |
| #define LAL_NAUTILUS_AXIS_DIRECTION_Z 0.53605060283 /**<
Nautilus z-component of unit vector pointing along axis in Earth-centered
frame */ | | #define LAL_NAUTILUS_AXIS_DIRECTION_Z 0.53605060283 /**<
Nautilus z-component of unit vector pointing along axis in Earth-centered
frame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name NIOBE Resonant Mass Detector constants | | /** | |
| | | * \name NIOBE Resonant Mass Detector constants | |
| * The following constants describe the location and geometry of the | | * The following constants describe the location and geometry of the | |
|
| * NIOBE Resonant Mass Detector. */ | | * NIOBE Resonant Mass Detector. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define LAL_NIOBE_DETECTOR_NAME "NIOBE" /**< NIOBE detector
name string */ | | #define LAL_NIOBE_DETECTOR_NAME "NIOBE" /**< NIOBE detector
name string */ | |
| #define LAL_NIOBE_DETECTOR_PREFIX "B1" /**< NIOBE detector
prefix string */ | | #define LAL_NIOBE_DETECTOR_PREFIX "B1" /**< NIOBE detector
prefix string */ | |
| #define LAL_NIOBE_DETECTOR_LONGITUDE_RAD 2.02138216202 /**< NIOBE v
ertex longitude (rad) */ | | #define LAL_NIOBE_DETECTOR_LONGITUDE_RAD 2.02138216202 /**< NIOBE v
ertex longitude (rad) */ | |
| #define LAL_NIOBE_DETECTOR_LATITUDE_RAD -0.55734180780 /**< NIOBE v
ertex latitude (rad) */ | | #define LAL_NIOBE_DETECTOR_LATITUDE_RAD -0.55734180780 /**< NIOBE v
ertex latitude (rad) */ | |
| #define LAL_NIOBE_DETECTOR_ELEVATION_SI 0 /**< NIOBE vertex el
evation (m) */ | | #define LAL_NIOBE_DETECTOR_ELEVATION_SI 0 /**< NIOBE vertex el
evation (m) */ | |
| #define LAL_NIOBE_DETECTOR_ARM_X_AZIMUTH_RAD 0.00000000000 /**< NIOBE x
arm azimuth (rad) */ | | #define LAL_NIOBE_DETECTOR_ARM_X_AZIMUTH_RAD 0.00000000000 /**< NIOBE x
arm azimuth (rad) */ | |
| #define LAL_NIOBE_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< NIOBE y
arm azimuth (rad) UNUSED FOR BARS */ | | #define LAL_NIOBE_DETECTOR_ARM_Y_AZIMUTH_RAD 0.00000000000 /**< NIOBE y
arm azimuth (rad) UNUSED FOR BARS */ | |
| #define LAL_NIOBE_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< NIOBE x
arm altitude (rad) */ | | #define LAL_NIOBE_DETECTOR_ARM_X_ALTITUDE_RAD 0.00000000000 /**< NIOBE x
arm altitude (rad) */ | |
| #define LAL_NIOBE_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< NIOBE y
arm altitude (rad) UNUSED FOR BARS */ | | #define LAL_NIOBE_DETECTOR_ARM_Y_ALTITUDE_RAD 0.00000000000 /**< NIOBE y
arm altitude (rad) UNUSED FOR BARS */ | |
| #define LAL_NIOBE_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< NIOBE x
arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_NIOBE_DETECTOR_ARM_X_MIDPOINT_SI 0.00000000000 /**< NIOBE x
arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_NIOBE_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< NIOBE y
arm midpoint (m) UNUSED FOR BARS */ | | #define LAL_NIOBE_DETECTOR_ARM_Y_MIDPOINT_SI 0.00000000000 /**< NIOBE y
arm midpoint (m) UNUSED FOR BARS */ | |
| #define LAL_NIOBE_VERTEX_LOCATION_X_SI -2.35948871453e+06 /**<
NIOBE x-component of vertex location in Earth-centered frame (m) */ | | #define LAL_NIOBE_VERTEX_LOCATION_X_SI -2.35948871453e+06 /**<
NIOBE x-component of vertex location in Earth-centered frame (m) */ | |
| #define LAL_NIOBE_VERTEX_LOCATION_Y_SI 4.87721571259e+06 /**<
NIOBE y-component of vertex location in Earth-centered frame (m) */ | | #define LAL_NIOBE_VERTEX_LOCATION_Y_SI 4.87721571259e+06 /**<
NIOBE y-component of vertex location in Earth-centered frame (m) */ | |
| #define LAL_NIOBE_VERTEX_LOCATION_Z_SI -3.35416003274e+06 /**<
NIOBE z-component of vertex location in Earth-centered frame (m) */ | | #define LAL_NIOBE_VERTEX_LOCATION_Z_SI -3.35416003274e+06 /**<
NIOBE z-component of vertex location in Earth-centered frame (m) */ | |
| #define LAL_NIOBE_AXIS_DIRECTION_X -0.23034623759 /**< NIOBE x
-component of unit vector pointing along axis in Earth-centered frame */ | | #define LAL_NIOBE_AXIS_DIRECTION_X -0.23034623759 /**< NIOBE x
-component of unit vector pointing along axis in Earth-centered frame */ | |
| #define LAL_NIOBE_AXIS_DIRECTION_Y 0.47614056486 /**< NIOBE y
-component of unit vector pointing along axis in Earth-centered frame */ | | #define LAL_NIOBE_AXIS_DIRECTION_Y 0.47614056486 /**< NIOBE y
-component of unit vector pointing along axis in Earth-centered frame */ | |
| #define LAL_NIOBE_AXIS_DIRECTION_Z 0.84866411101 /**< NIOBE z
-component of unit vector pointing along axis in Earth-centered frame */ | | #define LAL_NIOBE_AXIS_DIRECTION_Z 0.84866411101 /**< NIOBE z
-component of unit vector pointing along axis in Earth-centered frame */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /*@}*//* end: DetectorConstants */ | | /*@}*/ /* end: DetectorConstants */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* _LALDETECTORS_H */ | | #endif /* _LALDETECTORS_H */ | |
| | | | |
End of changes. 37 change blocks. |
| 149 lines changed or deleted | | 178 lines changed or added | |
|
| LALMathematica.h | | LALMathematica.h | |
| | | | |
| skipping to change at line 47 | | skipping to change at line 47 | |
| * | | * | |
| * \brief Provides structures, functions and macro definitions for modules
that | | * \brief Provides structures, functions and macro definitions for modules
that | |
| * generate MATHEMATICA notebooks. | | * generate MATHEMATICA notebooks. | |
| * | | * | |
| * Currently, the only modules using this | | * Currently, the only modules using this | |
| * header file are <tt>LALMath3DPlot()</tt>, which generates 3D animated | | * header file are <tt>LALMath3DPlot()</tt>, which generates 3D animated | |
| * plots of template banks having three parameters and | | * plots of template banks having three parameters and | |
| * <tt>LALMathNDPlot()</tt> which plots the 3-dimensional projections of a | | * <tt>LALMathNDPlot()</tt> which plots the 3-dimensional projections of a | |
| * bank that is N-dimensional. | | * bank that is N-dimensional. | |
| * | | * | |
|
| * \heading{Synopsis} | | * ### Synopsis ### | |
| | | * | |
| * \code | | * \code | |
| * #include <lal/LALMathematica.h> | | * #include <lal/LALMathematica.h> | |
| * \endcode | | * \endcode | |
| * | | * | |
| * This header file defines macros containing MATHEMATICA syntax that is | | * This header file defines macros containing MATHEMATICA syntax that is | |
| * otherwise messy to implement into C source files. Here is how to use | | * otherwise messy to implement into C source files. Here is how to use | |
| * these macros to make your own program generate a MATHEMATICA notebook. | | * these macros to make your own program generate a MATHEMATICA notebook. | |
| * | | * | |
| * <ol> | | * <ol> | |
| * <li> Open a file with a pointer named "nb" and a file extensti
on ".nb". | | * <li> Open a file with a pointer named "nb" and a file extensti
on ".nb". | |
| | | | |
| skipping to change at line 70 | | skipping to change at line 71 | |
| * Text") in between to write your text to the cells of the notebook.
If | | * Text") in between to write your text to the cells of the notebook.
If | |
| * you are writing MATHEMATICA commands use the INPUT macros; for plain | | * you are writing MATHEMATICA commands use the INPUT macros; for plain | |
| * text, use TEXT Macros. | | * text, use TEXT Macros. | |
| * </li><li> Denote titles and sections with the appropriate macros. | | * </li><li> Denote titles and sections with the appropriate macros. | |
| * </li><li> Use END_NOTEBOOK to end the notebook and use fclose(nb) to clo
se | | * </li><li> Use END_NOTEBOOK to end the notebook and use fclose(nb) to clo
se | |
| * the file "nb". | | * the file "nb". | |
| * </li></ol> | | * </li></ol> | |
| * | | * | |
| * The result is very readable/changeable source similar in style to most | | * The result is very readable/changeable source similar in style to most | |
| * markup languages. An example program might look like: | | * markup languages. An example program might look like: | |
|
| * \code | | * \code | |
| * FILE *nb; | | * FILE *nb; | |
| * nb = fopen("YourFileName.nb", "rw"); | | * nb = fopen("YourFileName.nb", "rw"); | |
| * BEG_NOTEBOOK; | | * BEG_NOTEBOOK; | |
| * BEG_TITLECELL; | | * BEG_TITLECELL; | |
|
| * fprintf(nb, "Sample Program Title"); | | * fprintf(nb, "Sample Program Title"); | |
| * END_TITLECELL_; | | * END_TITLECELL_; | |
| * BEG_SECTIONCELL; | | * BEG_SECTIONCELL; | |
|
| * fprintf(nb, "Sample Program Section Name"); | | * fprintf(nb, "Sample Program Section Name"); | |
| * END_SECTIONCELL; | | * END_SECTIONCELL; | |
| * END_NOTEBOOK; | | * END_NOTEBOOK; | |
| * fclose(nb); | | * fclose(nb); | |
| * \endcode | | * \endcode | |
| * | | * | |
|
| | | * ### Notes ### | |
| * | | * | |
|
| * \heading{Notes} | | | |
| * <ul> | | * <ul> | |
| * <li> Obviously the definitions and functions associated with this header | | * <li> Obviously the definitions and functions associated with this header | |
| * are NOT LAL compliant and thus do not belong in any lal routines except | | * are NOT LAL compliant and thus do not belong in any lal routines except | |
| * test programs.</li> | | * test programs.</li> | |
| * <li> There are many more commands to manipulate the structure of | | * <li> There are many more commands to manipulate the structure of | |
| * MATHEMATICA notebooks that are not included in this header. The macros | | * MATHEMATICA notebooks that are not included in this header. The macros | |
| * are only what is necessary for a <em>bare minimum</em> interface.</li> | | * are only what is necessary for a <em>bare minimum</em> interface.</li> | |
| * </ul> | | * </ul> | |
| * | | * | |
|
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /**\name Error Codes */ /*@{*/ | | /**\name Error Codes */ /*@{*/ | |
| #define LALMATHEMATICAH_ENULL 1 /**< NULL pointer to a LALMathemati
ca.h input structure */ | | #define LALMATHEMATICAH_ENULL 1 /**< NULL pointer to a LALMathemati
ca.h input structure */ | |
| #define LALMATHEMATICAH_EFILE 2 /**< Could not open file to write a
Mathematica Notebook */ | | #define LALMATHEMATICAH_EFILE 2 /**< Could not open file to write a
Mathematica Notebook */ | |
| #define LALMATHEMATICAH_EVAL 3 /**< Invalid parameter value */ | | #define LALMATHEMATICAH_EVAL 3 /**< Invalid parameter value */ | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \cond DONT_DOXYGEN */ | | /** \cond DONT_DOXYGEN */ | |
| #define LALMATHEMATICAH_MSGENULL "NULL pointer to a LALMathematica.h
input structure" | | #define LALMATHEMATICAH_MSGENULL "NULL pointer to a LALMathematica.h
input structure" | |
| #define LALMATHEMATICAH_MSGEFILE "Could not open file to write a Mat
hematica Notebook" | | #define LALMATHEMATICAH_MSGEFILE "Could not open file to write a Mat
hematica Notebook" | |
| #define LALMATHEMATICAH_MSGEVAL "Invalid parameter value" | | #define LALMATHEMATICAH_MSGEVAL "Invalid parameter value" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** \name Macros | | /** | |
| * | | * \name Macros | |
| * See the source file \ref LALMath3DPlot.c for an example of how to use | | * See the source file \ref LALMath3DPlot.c for an example of how to use | |
| * these macros to generate a MATHEMATICA notebook in your own program. | | * these macros to generate a MATHEMATICA notebook in your own program. | |
| * | | * | |
| * <dl> | | * <dl> | |
| * <dt>NOTEBOOK</dt><dd>Denotes the beginning and ending of the notebook fi
le. A | | * <dt>NOTEBOOK</dt><dd>Denotes the beginning and ending of the notebook fi
le. A | |
| * BEG_NOTEBOOK tag must start the file and an END_NOTEBOOK tag must end | | * BEG_NOTEBOOK tag must start the file and an END_NOTEBOOK tag must end | |
| * it.</dd> | | * it.</dd> | |
| * <dt>TITLE</dt><dd>Placing an fprint(nb, "Your Title") between
BEG and END | | * <dt>TITLE</dt><dd>Placing an fprint(nb, "Your Title") between
BEG and END | |
| * tags will place a <em>title font</em> cell in the notebook.</dd> | | * tags will place a <em>title font</em> cell in the notebook.</dd> | |
| * <dt>GROUP</dt><dd>Cells placed in between these tags will be grouped tog
ether</dd> | | * <dt>GROUP</dt><dd>Cells placed in between these tags will be grouped tog
ether</dd> | |
| | | | |
| skipping to change at line 140 | | skipping to change at line 141 | |
| * Notice that the file pointer must be named "nb" in order to us
e the | | * Notice that the file pointer must be named "nb" in order to us
e the | |
| * macros defined in this header. When grouping several cell objects | | * macros defined in this header. When grouping several cell objects | |
| * together the last object in the list should have an underscored END tag | | * together the last object in the list should have an underscored END tag | |
| * instead of an END tag without an underscore. Although the notebook will | | * instead of an END tag without an underscore. Although the notebook will | |
| * compile (usually) if you use the tags without an ending underscore, the | | * compile (usually) if you use the tags without an ending underscore, the | |
| * dangling comma is taken as a null member of the list of grouped cells. | | * dangling comma is taken as a null member of the list of grouped cells. | |
| * Therefore, when you view the notebook in MATHEMATICA you may see the | | * Therefore, when you view the notebook in MATHEMATICA you may see the | |
| * word "NULL" printed on a line. That is an indication that you
should | | * word "NULL" printed on a line. That is an indication that you
should | |
| * use the underscore version of the tag which preceeded the "NULL&quo
t; | | * use the underscore version of the tag which preceeded the "NULL&quo
t; | |
| * statement. | | * statement. | |
|
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define BEG_NOTEBOOK fprintf(nb, "Notebook[{\n") | | #define BEG_NOTEBOOK fprintf(nb, "Notebook[{\n") | |
| #define END_NOTEBOOK fprintf(nb, "}]\n") | | #define END_NOTEBOOK fprintf(nb, "}]\n") | |
| #define BEG_TITLECELL fprintf(nb, "Cell[\"") | | #define BEG_TITLECELL fprintf(nb, "Cell[\"") | |
| #define END_TITLECELL fprintf(nb, "\", \"Title\"],\n") | | #define END_TITLECELL fprintf(nb, "\", \"Title\"],\n") | |
| #define END_TITLECELL_ fprintf(nb, "\", \"Title\"]\n") | | #define END_TITLECELL_ fprintf(nb, "\", \"Title\"]\n") | |
| #define BEG_GROUPCELL fprintf(nb, "Cell[CellGroupData[{\n"
) | | #define BEG_GROUPCELL fprintf(nb, "Cell[CellGroupData[{\n"
) | |
| #define END_GROUPCELLC fprintf(nb, "}, Closed ]],\n") | | #define END_GROUPCELLC fprintf(nb, "}, Closed ]],\n") | |
| #define END_GROUPCELLC_ fprintf(nb, "}, Closed ]]\n") | | #define END_GROUPCELLC_ fprintf(nb, "}, Closed ]]\n") | |
| #define BEG_SECTIONCELL fprintf(nb, "Cell[\"") | | #define BEG_SECTIONCELL fprintf(nb, "Cell[\"") | |
| #define END_SECTIONCELL fprintf(nb, "\", \"Section\"],\n") | | #define END_SECTIONCELL fprintf(nb, "\", \"Section\"],\n") | |
| #define END_SECTIONCELL_ fprintf(nb, "\", \"Section\"]\n") | | #define END_SECTIONCELL_ fprintf(nb, "\", \"Section\"]\n") | |
| #define BEG_INPUTCELL fprintf(nb, "Cell[BoxData[\\(") | | #define BEG_INPUTCELL fprintf(nb, "Cell[BoxData[\\(") | |
| #define END_INPUTCELL fprintf(nb, "\\)], \"Input\"],\n") | | #define END_INPUTCELL fprintf(nb, "\\)], \"Input\"],\n") | |
| #define END_INPUTCELL_ fprintf(nb, "\\)], \"Input\"]\n") | | #define END_INPUTCELL_ fprintf(nb, "\\)], \"Input\"]\n") | |
| #define BEG_TEXTCELL fprintf(nb, "Cell[\"\\<") | | #define BEG_TEXTCELL fprintf(nb, "Cell[\"\\<") | |
| #define END_TEXTCELL fprintf(nb, "\\>\", \"Text\"],\n") | | #define END_TEXTCELL fprintf(nb, "\\>\", \"Text\"],\n") | |
| #define END_TEXTCELL_ fprintf(nb, "\\>\", \"Text\"]\n") | | #define END_TEXTCELL_ fprintf(nb, "\\>\", \"Text\"]\n") | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** This type is used by \ref LALMath3DPlot.c as an input structure to plot | | /** | |
| 3-dimensional template banks. | | * This type is used by \ref LALMath3DPlot.c as an input structure to plot | |
| | | 3-dimensional template banks. | |
| * It is a linked list with | | * It is a linked list with | |
| * parameters for each coordinate x,y,z and a next pointer. It also has a | | * parameters for each coordinate x,y,z and a next pointer. It also has a | |
| * parameter called grayLevel which must be \f$\epsilon [0,1]\f$. It speci
fies | | * parameter called grayLevel which must be \f$\epsilon [0,1]\f$. It speci
fies | |
| * the shading of the point in the final plot with 0 representing black and | | * the shading of the point in the final plot with 0 representing black and | |
| * 1 representing white. By creatively assigning its value the grayscale | | * 1 representing white. By creatively assigning its value the grayscale | |
| * shade of the points may convey additional information. | | * shade of the points may convey additional information. | |
| */ | | */ | |
| typedef struct tagMath3DPointList{ | | typedef struct tagMath3DPointList{ | |
| struct tagMath3DPointList *next; | | struct tagMath3DPointList *next; | |
| REAL4 x; | | REAL4 x; | |
| REAL4 y; | | REAL4 y; | |
| REAL4 z; | | REAL4 z; | |
| REAL4 grayLevel; | | REAL4 grayLevel; | |
| }Math3DPointList; | | }Math3DPointList; | |
| | | | |
|
| /** This type is similar to Math3DPointList except the coordinates are | | /** | |
| | | * This type is similar to Math3DPointList except the coordinates are | |
| * stored as data in the REAL4Vector \c coordinates. | | * stored as data in the REAL4Vector \c coordinates. | |
| */ | | */ | |
| typedef struct tagMathNDPointList{ | | typedef struct tagMathNDPointList{ | |
| struct tagMathNDPointList *next; | | struct tagMathNDPointList *next; | |
| REAL4Vector *coordinates; | | REAL4Vector *coordinates; | |
| INT4 dimension; | | INT4 dimension; | |
| REAL4 grayLevel; | | REAL4 grayLevel; | |
| } MathNDPointList; | | } MathNDPointList; | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
End of changes. 11 change blocks. |
| 12 lines changed or deleted | | 15 lines changed or added | |
|
| PrintFTSeries.h | | PrintFTSeries.h | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| #ifndef _PRINTFTSERIES_H | | #ifndef _PRINTFTSERIES_H | |
| #define _PRINTFTSERIES_H | | #define _PRINTFTSERIES_H | |
| | | | |
| #include <lal/LALStdlib.h> | | #include <lal/LALStdlib.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup PrintFTSeries_h | | * \addtogroup PrintFTSeries_h | |
| \author J. T. Whelan <jtwhelan@loyno.edu> | | * \author J. T. Whelan <jtwhelan@loyno.edu> | |
| | | * | |
| \brief This is a simple utility to print time and frequency series into | | * \brief This is a simple utility to print time and frequency series into | |
| a file. | | a file. | |
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/PrintFTSeries.h> | | * \code | |
| \endcode | | * #include <lal/PrintFTSeries.h> | |
| | | * \endcode | |
| Provides prototype information for the routines in \ref PrintTimeSeries_ | | * | |
| c and \ref PrintFrequencySeries_c. | | * Provides prototype information for the routines in \ref PrintTimeSeries_ | |
| | | c and \ref PrintFrequencySeries_c. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| /** \defgroup PrintTimeSeries_c Module PrintTimeSeries.c | | /** | |
| | | * \defgroup PrintTimeSeries_c Module PrintTimeSeries.c | |
| Print a \<datatype\>TimeSeries object into a | | * Print a \<datatype\>TimeSeries object into a | |
| file. For use in non-production and test code only. | | * file. For use in non-production and test code only. | |
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| Each member of this family of functions prints the elements of | | * Each member of this family of functions prints the elements of | |
| \f$\langle\mbox{datatype}\rangle\f$\c TimeSeries into a file. Note: | | * \f$\langle\mbox{datatype}\rangle\f$\c TimeSeries into a file. Note: | |
| the file name is specified using a character string. This function is | | * the file name is specified using a character string. This function is | |
| for debugging use only: its arguments do not conform to LAL standards | | * for debugging use only: its arguments do not conform to LAL standards | |
| so it should not be used in any real analysis codes. | | * so it should not be used in any real analysis codes. | |
| | | * | |
| \heading{Notes} | | * ### Notes ### | |
| | | * | |
| This function's arguments do not conform to the LAL spec. For this | | * This function's arguments do not conform to the LAL spec. For this | |
| reason it should only be used for debugging purposes in test | | * reason it should only be used for debugging purposes in test | |
| functions, not in any production code. | | * functions, not in any production code. | |
| | | * | |
| Additionally, since printf cannot handle INT8 as integers, the | | * Additionally, since printf cannot handle INT8 as integers, the | |
| functions <tt>LALI8PrintTimeSeries()</tt> and | | * functions <tt>LALI8PrintTimeSeries()</tt> and | |
| <tt>LALU8PrintTimeSeries()</tt> use a typecast to REAL8 and are thus | | * <tt>LALU8PrintTimeSeries()</tt> use a typecast to REAL8 and are thus | |
| only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15}\f$. | | * only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15}\f$. | |
| | | * | |
| The first five lines of the file are a header containing: | | * The first five lines of the file are a header containing: | |
| <ol> | | * <ol> | |
| <li> the name of the series</li> | | * <li> the name of the series</li> | |
| <li> the starting epoch </li> | | * <li> the starting epoch </li> | |
| <li> the units expressed in terms of the basic SI units</li> | | * <li> the units expressed in terms of the basic SI units</li> | |
| <li> column labels</li> | | * <li> column labels</li> | |
| </ol> | | * </ol> | |
| after which come the data, one per line. | | * after which come the data, one per line. | |
| | | * | |
| The output format is two or three tab-separated columns: the first | | * The output format is two or three tab-separated columns: the first | |
| column is the time corresponding to the row in question, in seconds | | * column is the time corresponding to the row in question, in seconds | |
| after the series' starting epoch; for real and integer time | | * after the series' starting epoch; for real and integer time | |
| series, the second column is the value of the series; for complex time | | * series, the second column is the value of the series; for complex time | |
| series, the second column is the real part and the third the imaginary | | * series, the second column is the real part and the third the imaginary | |
| part of the value. | | * part of the value. | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| void LALI2PrintTimeSeries( INT2TimeSeries *series , const CHAR *filename ); | | void LALI2PrintTimeSeries( INT2TimeSeries *series , const CHAR *filename ); | |
| void LALI4PrintTimeSeries( INT4TimeSeries *series , const CHAR *filename ); | | void LALI4PrintTimeSeries( INT4TimeSeries *series , const CHAR *filename ); | |
| void LALI8PrintTimeSeries( INT8TimeSeries *series , const CHAR *filename ); | | void LALI8PrintTimeSeries( INT8TimeSeries *series , const CHAR *filename ); | |
| void LALU2PrintTimeSeries( UINT2TimeSeries *series , const CHAR *filename )
; | | void LALU2PrintTimeSeries( UINT2TimeSeries *series , const CHAR *filename )
; | |
| void LALU4PrintTimeSeries( UINT4TimeSeries *series , const CHAR *filename )
; | | void LALU4PrintTimeSeries( UINT4TimeSeries *series , const CHAR *filename )
; | |
| void LALU8PrintTimeSeries( UINT8TimeSeries *series , const CHAR *filename )
; | | void LALU8PrintTimeSeries( UINT8TimeSeries *series , const CHAR *filename )
; | |
| void LALPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename ); | | void LALPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename ); | |
| void LALSPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename ); | | void LALSPrintTimeSeries( REAL4TimeSeries *series , const CHAR *filename ); | |
| void LALDPrintTimeSeries( REAL8TimeSeries *series , const CHAR *filename ); | | void LALDPrintTimeSeries( REAL8TimeSeries *series , const CHAR *filename ); | |
| void LALCPrintTimeSeries( COMPLEX8TimeSeries *series , const CHAR *filename
); | | void LALCPrintTimeSeries( COMPLEX8TimeSeries *series , const CHAR *filename
); | |
| void LALZPrintTimeSeries( COMPLEX16TimeSeries *series , const CHAR *filenam
e ); | | void LALZPrintTimeSeries( COMPLEX16TimeSeries *series , const CHAR *filenam
e ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \defgroup PrintFrequencySeries_c Module PrintFrequencySeries.c | | /** | |
| | | * \defgroup PrintFrequencySeries_c Module PrintFrequencySeries.c | |
| Print a \<datatype\>FrequencySeries object into a | | * | |
| file. For use in non-production and test code only. | | * Print a \<datatype\>FrequencySeries object into a | |
| | | * file. For use in non-production and test code only. | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| Each member of this family of functions prints the elements of | | * | |
| \<datatype\>FrequencySeries into a file. | | * Each member of this family of functions prints the elements of | |
| Note: the file name is specified using a character string. This | | * \<datatype\>FrequencySeries into a file. | |
| function is for debugging use only: its arguments do not conform to | | * Note: the file name is specified using a character string. This | |
| LAL standards so it should not be used in any real analysis codes. | | * function is for debugging use only: its arguments do not conform to | |
| | | * LAL standards so it should not be used in any real analysis codes. | |
| \heading{Notes} | | * | |
| | | * ### Notes ### | |
| This function's arguments do not conform to the LAL spec. For this | | * | |
| reason it should only be used for debugging purposes in test | | * This function's arguments do not conform to the LAL spec. For this | |
| functions, not in any production code. | | * reason it should only be used for debugging purposes in test | |
| | | * functions, not in any production code. | |
| Additionally, since printf cannot handle INT8 as integers, the | | * | |
| functions <tt>LALI8PrintFrequencySeries()</tt> and | | * Additionally, since printf cannot handle INT8 as integers, the | |
| <tt>LALU8PrintFrequencySeries()</tt> use a typecast to REAL8 and are | | * functions <tt>LALI8PrintFrequencySeries()</tt> and | |
| thus only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15}\f$ | | * <tt>LALU8PrintFrequencySeries()</tt> use a typecast to REAL8 and are | |
| . | | * thus only valid for numbers between around \f$-10^{15}\f$ and \f$10^{15} | |
| | | \f$. | |
| The first four lines of the file are a header containing: | | * | |
| <ol> | | * The first four lines of the file are a header containing: | |
| <li> the name of the series</li> | | * <ol> | |
| <li> heterodyning information, if any</li> | | * <li> the name of the series</li> | |
| <li> the starting epoch, relative to the GPS reference epoch (1980 January | | * <li> heterodyning information, if any</li> | |
| 6)</li> | | * <li> the starting epoch, relative to the GPS reference epoch (1980 Janua | |
| <li> the units expressed in terms of the basic SI units</li> | | ry 6)</li> | |
| <li> column labels</li> | | * <li> the units expressed in terms of the basic SI units</li> | |
| </ol> | | * <li> column labels</li> | |
| after which come the data, one per line. | | * </ol> | |
| | | * after which come the data, one per line. | |
| The output format is two or three tab-separated columns: the first | | * | |
| column is the frequency in hertz corresponding to the row in question; | | * The output format is two or three tab-separated columns: the first | |
| for real and integer frequency series, the second column is the value | | * column is the frequency in hertz corresponding to the row in question; | |
| of the series; for complex frequency series, the second column is the | | * for real and integer frequency series, the second column is the value | |
| real part and the third the imaginary part of the value. | | * of the series; for complex frequency series, the second column is the | |
| | | * real part and the third the imaginary part of the value. | |
| Note that the frequency given is the physical frequency. In the case | | * | |
| of a heterodyned frequency series, this is the heterodyning frequency | | * Note that the frequency given is the physical frequency. In the case | |
| plus the frequency offset. A frequency series of length \f$[N]\f$ is | | * of a heterodyned frequency series, this is the heterodyning frequency | |
| assumed to be packed so that the 0th element corresponds to zero | | * plus the frequency offset. A frequency series of length \f$[N]\f$ is | |
| frequency offset, elements 1 through \f$[N/2]\f$ to positive frequency | | * assumed to be packed so that the 0th element corresponds to zero | |
| offsets (in ascending order), and elements \f$N-[N/2]\f$ to \f$N-1\f$ to | | * frequency offset, elements 1 through \f$[N/2]\f$ to positive frequency | |
| negative frequency offsets (also in ascending order, so that the | | * offsets (in ascending order), and elements \f$N-[N/2]\f$ to \f$N-1\f$ to | |
| frequency corresponding to the \f$N-1\f$st element is just below that of | | * negative frequency offsets (also in ascending order, so that the | |
| the 0th element). If \f$N\f$ is even, the element in position \f$N/2\f$ is | | * frequency corresponding to the \f$N-1\f$st element is just below that of | |
| assumed to correspond both the maximum poitive and negative frequency | | * the 0th element). If \f$N\f$ is even, the element in position \f$N/2\f$ | |
| offset. | | is | |
| */ | | * assumed to correspond both the maximum poitive and negative frequency | |
| | | * offset. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| void LALI2PrintFrequencySeries( INT2FrequencySeries *series , const CHAR *f
ilename ); | | void LALI2PrintFrequencySeries( INT2FrequencySeries *series , const CHAR *f
ilename ); | |
| void LALI4PrintFrequencySeries( INT4FrequencySeries *series , const CHAR *f
ilename ); | | void LALI4PrintFrequencySeries( INT4FrequencySeries *series , const CHAR *f
ilename ); | |
| void LALI8PrintFrequencySeries( INT8FrequencySeries *series , const CHAR *f
ilename ); | | void LALI8PrintFrequencySeries( INT8FrequencySeries *series , const CHAR *f
ilename ); | |
| void LALU2PrintFrequencySeries( UINT2FrequencySeries *series , const CHAR *
filename ); | | void LALU2PrintFrequencySeries( UINT2FrequencySeries *series , const CHAR *
filename ); | |
| void LALU4PrintFrequencySeries( UINT4FrequencySeries *series , const CHAR *
filename ); | | void LALU4PrintFrequencySeries( UINT4FrequencySeries *series , const CHAR *
filename ); | |
| void LALU8PrintFrequencySeries( UINT8FrequencySeries *series , const CHAR *
filename ); | | void LALU8PrintFrequencySeries( UINT8FrequencySeries *series , const CHAR *
filename ); | |
| void LALPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *fi
lename ); | | void LALPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *fi
lename ); | |
| void LALSPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *f
ilename ); | | void LALSPrintFrequencySeries( REAL4FrequencySeries *series , const CHAR *f
ilename ); | |
| void LALDPrintFrequencySeries( REAL8FrequencySeries *series , const CHAR *f
ilename ); | | void LALDPrintFrequencySeries( REAL8FrequencySeries *series , const CHAR *f
ilename ); | |
| | | | |
End of changes. 3 change blocks. |
| 109 lines changed or deleted | | 112 lines changed or added | |
|
| RealFFT.h | | RealFFT.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| #include <lal/LALStdlib.h> | | #include <lal/LALStdlib.h> | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| * | | | |
| * \addtogroup RealFFT_h | | * \addtogroup RealFFT_h | |
| * \brief Performs real-to-complex and complex-to-real FFTs. | | * \brief Performs real-to-complex and complex-to-real FFTs. | |
| * | | * | |
|
| * \heading{Synopsis} | | * ### Synopsis ### | |
| | | * | |
| * \code | | * \code | |
| * #include <lal/RealFFT.h> | | * #include <lal/RealFFT.h> | |
| * \endcode | | * \endcode | |
| * | | * | |
| * Perform real-to-complex and complex-to-real fast Fourier | | * Perform real-to-complex and complex-to-real fast Fourier | |
| * transforms of vectors, and sequences of vectors using the package | | * transforms of vectors, and sequences of vectors using the package | |
|
| * FFTW [\ref fj_1998]. | | * FFTW \cite fj_1998. | |
| * | | | |
| * | | * | |
| * \section sec_RealFFT_XLAL XLAL Functions | | * \section sec_RealFFT_XLAL XLAL Functions | |
| * | | * | |
|
| * \heading{Synopsis} | | * ### Synopsis ### | |
| | | * | |
| * \code | | * \code | |
| * #include <lal/RealFFT.h> | | * #include <lal/RealFFT.h> | |
| * | | * | |
| * REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measu
relvl ); | | * REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measu
relvl ); | |
| * REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl
); | | * REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl
); | |
| * REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl
); | | * REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl
); | |
| * void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan ); | | * void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan ); | |
| * | | * | |
| * int XLALREAL4ForwardFFT( COMPLEX8Vector *output, REAL4Vector *input, REA
L4FFTPlan *plan ); | | * int XLALREAL4ForwardFFT( COMPLEX8Vector *output, REAL4Vector *input, REA
L4FFTPlan *plan ); | |
| * int XLALREAL4ReverseFFT( REAL4Vector *output, COMPLEX8Vector *input, REA
L4FFTPlan *plan ); | | * int XLALREAL4ReverseFFT( REAL4Vector *output, COMPLEX8Vector *input, REA
L4FFTPlan *plan ); | |
| | | | |
| skipping to change at line 74 | | skipping to change at line 74 | |
| * REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl
); | | * REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl
); | |
| * REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl
); | | * REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl
); | |
| * void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan ); | | * void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan ); | |
| * | | * | |
| * int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input, RE
AL8FFTPlan *plan ); | | * int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input, RE
AL8FFTPlan *plan ); | |
| * int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input, RE
AL8FFTPlan *plan ); | | * int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input, RE
AL8FFTPlan *plan ); | |
| * int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input, REAL8FF
TPlan *plan ); | | * int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input, REAL8FF
TPlan *plan ); | |
| * int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data, REAL8F
FTPlan *plan ); | | * int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data, REAL8F
FTPlan *plan ); | |
| * \endcode | | * \endcode | |
| * | | * | |
|
| * \heading{Description} | | * ### Description ### | |
| * | | * | |
| * The \c REAL4 routines are described below. These use single-precision | | * The \c REAL4 routines are described below. These use single-precision | |
| * FFTs, i.e., they convert \c REAL4Vectors into \c COMPLEX8Vectors | | * FFTs, i.e., they convert \c REAL4Vectors into \c COMPLEX8Vectors | |
| * and vice-versa. The \c REAL8 versions of the routines are the same | | * and vice-versa. The \c REAL8 versions of the routines are the same | |
| * but they are double-precision versions, i.e., they convert | | * but they are double-precision versions, i.e., they convert | |
| * \c REAL8Vectors into \c COMPLEX16Vectors. | | * \c REAL8Vectors into \c COMPLEX16Vectors. | |
| * | | * | |
| * The routine XLALCreateREAL4FFTPlan() creates a REAL4FFTPlan | | * The routine XLALCreateREAL4FFTPlan() creates a REAL4FFTPlan | |
| * structure to perform FFTs of vectors of length \c size. If | | * structure to perform FFTs of vectors of length \c size. If | |
| * \c fwdflg is non-zero then the plan is created to perform forward | | * \c fwdflg is non-zero then the plan is created to perform forward | |
| | | | |
| skipping to change at line 119 | | skipping to change at line 119 | |
| * | | * | |
| * XLALREAL4VectorFFT() is a low-level routine that transforms | | * XLALREAL4VectorFFT() is a low-level routine that transforms | |
| * a real vector to a half-complex real vector (with a forward plan) or | | * a real vector to a half-complex real vector (with a forward plan) or | |
| * a half-complex real vector to a real vector (with a reverse plan). | | * a half-complex real vector to a real vector (with a reverse plan). | |
| * If you're not sure what this means, don't use this routine. | | * If you're not sure what this means, don't use this routine. | |
| * The input and output vectors (and their data) must be distinct pointers. | | * The input and output vectors (and their data) must be distinct pointers. | |
| * | | * | |
| * XLALREAL4PowerSpectrum() computes a real power spectrum of the | | * XLALREAL4PowerSpectrum() computes a real power spectrum of the | |
| * input real vector and a forward FFT plan. | | * input real vector and a forward FFT plan. | |
| * | | * | |
|
| * \heading{Return Values} | | * ### Return Values ### | |
| * | | * | |
| * Upon success, | | * Upon success, | |
| * XLALCreateREAL4FFTPlan(), | | * XLALCreateREAL4FFTPlan(), | |
| * XLALCreateForwardREAL4FFTPlan(), and | | * XLALCreateForwardREAL4FFTPlan(), and | |
| * XLALCreateReverseREAL4FFTPlan() return a pointer to a newly-allocated | | * XLALCreateReverseREAL4FFTPlan() return a pointer to a newly-allocated | |
| * FFT plan. Upon failure, they return a \c NULL pointer and set | | * FFT plan. Upon failure, they return a \c NULL pointer and set | |
| * \c xlalErrno to one of the following values: | | * \c xlalErrno to one of the following values: | |
| * #XLAL_EBADLEN if \c size is not greater than zero, | | * #XLAL_EBADLEN if \c size is not greater than zero, | |
| * #XLAL_ENOMEM if a memory allocation failed, or | | * #XLAL_ENOMEM if a memory allocation failed, or | |
| * #XLAL_EFAILED if the FFTW plan creation routine failed. | | * #XLAL_EFAILED if the FFTW plan creation routine failed. | |
| | | | |
| skipping to change at line 156 | | skipping to change at line 156 | |
| * directions or if the input and output data pointers are not distinct | | * directions or if the input and output data pointers are not distinct | |
| * for XLALREAL4VectorFFT(), | | * for XLALREAL4VectorFFT(), | |
| * #XLAL_EBADLEN if the input and output vectors and the plan have | | * #XLAL_EBADLEN if the input and output vectors and the plan have | |
| * incompatible lengths, | | * incompatible lengths, | |
| * #XLAL_ENOMEM if a memory allocation of temporary internal memory | | * #XLAL_ENOMEM if a memory allocation of temporary internal memory | |
| * fails. | | * fails. | |
| * | | * | |
| * As before, the \c REAL8 versions of these routines behave the | | * As before, the \c REAL8 versions of these routines behave the | |
| * same way but for double-precision transforms. | | * same way but for double-precision transforms. | |
| * | | * | |
|
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** Plan to perform FFT of REAL4 data */ | | /** Plan to perform FFT of REAL4 data */ | |
| typedef struct tagREAL4FFTPlan REAL4FFTPlan; | | typedef struct tagREAL4FFTPlan REAL4FFTPlan; | |
| /** Plan to perform FFT of REAL8 data */ | | /** Plan to perform FFT of REAL8 data */ | |
| typedef struct tagREAL8FFTPlan REAL8FFTPlan; | | typedef struct tagREAL8FFTPlan REAL8FFTPlan; | |
| #define tagRealFFTPlan tagREAL4FFTPlan | | #define tagRealFFTPlan tagREAL4FFTPlan | |
| #define RealFFTPlan REAL4FFTPlan | | #define RealFFTPlan REAL4FFTPlan | |
| | | | |
| /** \name Error Codes */ | | /** \name Error Codes */ | |
| | | | |
| skipping to change at line 203 | | skipping to change at line 203 | |
| #define REALFFTH_MSGESNGL "FFTW library is not single-precision" | | #define REALFFTH_MSGESNGL "FFTW library is not single-precision" | |
| #define REALFFTH_MSGEINTL "Error in Intel FFT library" | | #define REALFFTH_MSGEINTL "Error in Intel FFT library" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
| /* | | /* | |
| * | | * | |
| * XLAL REAL4 functions | | * XLAL REAL4 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** Returns a new REAL4FFTPlan | | /** | |
| * | | * Returns a new REAL4FFTPlan | |
| * A REAL4FFTPlan is required to perform a FFT that involves real data. | | * A REAL4FFTPlan is required to perform a FFT that involves real data. | |
| * A different plan is required for each size of the real data vector | | * A different plan is required for each size of the real data vector | |
| * and for each direction of transform (forward or reverse). | | * and for each direction of transform (forward or reverse). | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | | * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | |
| * where N, the size of the transform, is the length of the vector x. | | * where N, the size of the transform, is the length of the vector x. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | | * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | |
| * where N, the size of the transform, is the length of the vector y. | | * where N, the size of the transform, is the length of the vector y. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a \"reverse\" | | * equal to N times the original data (we therefore call it a \"reverse\" | |
| * transform rather than an \"inverse\" transform). | | * transform rather than an \"inverse\" transform). | |
| * | | * | |
| * @param[in] size The number of points in the real data. | | * @param[in] size The number of points in the real data. | |
| * @param[in] fwdflg Set non-zero for a forward FFT plan; | | * @param[in] fwdflg Set non-zero for a forward FFT plan; | |
|
| * otherwise create a reverse plan | | * otherwise create a reverse plan | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c REAL4FFTPlan structure is returned | | * @return A pointer to an allocated \c REAL4FFTPlan structure is returned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateREAL4Plan() function shall fail if: | | * The \c XLALCreateREAL4Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measurel
vl ); | | REAL4FFTPlan * XLALCreateREAL4FFTPlan( UINT4 size, int fwdflg, int measurel
vl ); | |
| | | | |
|
| /** Returns a new REAL4FFTPlan for a forward transform | | /** | |
| | | * Returns a new REAL4FFTPlan for a forward transform | |
| * | | * | |
| * A REAL4FFTPlan is required to perform a FFT that involves real data. | | * A REAL4FFTPlan is required to perform a FFT that involves real data. | |
| * A different plan is required for each size of the real data vector. | | * A different plan is required for each size of the real data vector. | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | | * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | |
| * where N, the size of the transform, is the length of the vector x. | | * where N, the size of the transform, is the length of the vector x. | |
| * | | * | |
| * @param[in] size The number of points in the real data. | | * @param[in] size The number of points in the real data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c REAL4FFTPlan structure is returned | | * @return A pointer to an allocated \c REAL4FFTPlan structure is returned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateForwardREAL4Plan() function shall fail if: | | * The \c XLALCreateForwardREAL4Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl ); | | REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan( UINT4 size, int measurelvl ); | |
| | | | |
|
| /** Returns a new REAL4FFTPlan for a reverse transform | | /** | |
| | | * Returns a new REAL4FFTPlan for a reverse transform | |
| * | | * | |
| * A REAL4FFTPlan is required to perform a FFT that involves real data. | | * A REAL4FFTPlan is required to perform a FFT that involves real data. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | | * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | |
| * where N, the size of the transform, is the length of the vector y. | | * where N, the size of the transform, is the length of the vector y. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a \"reverse\" | | * equal to N times the original data (we therefore call it a \"reverse\" | |
| * transform rather than an \"inverse\" transform). | | * transform rather than an \"inverse\" transform). | |
| * | | * | |
| * @param[in] size The number of points in the real data. | | * @param[in] size The number of points in the real data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c REAL4FFTPlan structure is returned | | * @return A pointer to an allocated \c REAL4FFTPlan structure is returned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateReverseREAL4Plan() function shall fail if: | | * The \c XLALCreateReverseREAL4Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl ); | | REAL4FFTPlan * XLALCreateReverseREAL4FFTPlan( UINT4 size, int measurelvl ); | |
| | | | |
|
| /** Destroys a REAL4FFTPlan | | /** | |
| | | * Destroys a REAL4FFTPlan | |
| * @param[in] plan A pointer to the REAL4FFTPlan to be destroyed. | | * @param[in] plan A pointer to the REAL4FFTPlan to be destroyed. | |
| * @return None. | | * @return None. | |
| */ | | */ | |
| void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan ); | | void XLALDestroyREAL4FFTPlan( REAL4FFTPlan *plan ); | |
| | | | |
|
| /** Performs a forward FFT of REAL4 data | | /** | |
| | | * Performs a forward FFT of REAL4 data | |
| * | | * | |
| * This routine performs the transformation: | | * This routine performs the transformation: | |
| * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | | * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | |
| * where N, the size of the transform, is the length of the vector x. | | * where N, the size of the transform, is the length of the vector x. | |
| * | | * | |
| * @note | | * @note | |
| * Due to the reality of the input data x, the following identity | | * Due to the reality of the input data x, the following identity | |
| * holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | | * holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | |
| * the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | | * the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | |
| * since the remaining \"negative\" frequency components can be obtained fr
om the | | * since the remaining \"negative\" frequency components can be obtained fr
om the | |
| * \"positive\" frequency components. | | * \"positive\" frequency components. | |
| * | | * | |
| * @param[out] output The complex data vector z of length [N/2] + 1 | | * @param[out] output The complex data vector z of length [N/2] + 1 | |
| * that results from the transform | | * that results from the transform | |
| * @param[in] input The real data vector x of length to be transformed | | * @param[in] input The real data vector x of length to be transformed | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL4ForwardFFT() function shall fail if: | | * The \c XLALREAL4ForwardFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | | * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | |
| * reverse transform. | | * reverse transform. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
| int XLALREAL4ForwardFFT( COMPLEX8Vector *output, const REAL4Vector *input, | | int XLALREAL4ForwardFFT( COMPLEX8Vector *output, const REAL4Vector *input, | |
| const REAL4FFTPlan *plan ); | | const REAL4FFTPlan *plan ); | |
| | | | |
|
| /** Performs a reverse FFT of REAL4 data | | /** | |
| | | * Performs a reverse FFT of REAL4 data | |
| * | | * | |
| * This routine performs the transformation: | | * This routine performs the transformation: | |
| * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | | * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | |
| * where N, the size of the transform, is the length of the vector y. | | * where N, the size of the transform, is the length of the vector y. | |
| * | | * | |
| * @note | | * @note | |
| * Due to the reality of the output data y, the following identity | | * Due to the reality of the output data y, the following identity | |
| * holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | | * holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | |
| * the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | | * the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | |
| * since the remaining \"negative\" frequency components can be obtained fr
om the | | * since the remaining \"negative\" frequency components can be obtained fr
om the | |
| * \"positive\" frequency components. | | * \"positive\" frequency components. | |
| * | | * | |
| * @param[out] output The real data vector y of length N | | * @param[out] output The real data vector y of length N | |
| * that results from the transform | | * that results from the transform | |
| * @param[in] input The complex data vector z of length [N/2] + 1 | | * @param[in] input The complex data vector z of length [N/2] + 1 | |
| * to be transformed | | * to be transformed | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL4ForwardFFT() function shall fail if: | | * The \c XLALREAL4ForwardFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | | * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | |
| * reverse transform. | | * reverse transform. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[ | | * - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[0 | |
| 0], | | ], | |
| * is not purely real | | * is not purely real | |
| * or if the length of the output vector N is even and the Nyquist | | * or if the length of the output vector N is even and the Nyquist | |
| * component of the input data, z[N/2], is not purely real. | | * component of the input data, z[N/2], is not purely real. | |
| * . | | * . | |
| */ | | */ | |
| int XLALREAL4ReverseFFT( REAL4Vector *output, const COMPLEX8Vector *input, | | int XLALREAL4ReverseFFT( REAL4Vector *output, const COMPLEX8Vector *input, | |
| const REAL4FFTPlan *plan ); | | const REAL4FFTPlan *plan ); | |
| | | | |
|
| /** Perform a REAL4Vector to REAL4Vector FFT | | /** | |
| | | * Perform a REAL4Vector to REAL4Vector FFT | |
| * | | * | |
| * This routine computes | | * This routine computes | |
| * \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I
m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f] | | * \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I
m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f] | |
| * where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f] | | * where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f] | |
| * and where the minus sign is used if a forward plan is provided as the ar
gument | | * and where the minus sign is used if a forward plan is provided as the ar
gument | |
| * and the plus sign is used if a reverse plan is provided as the argument; | | * and the plus sign is used if a reverse plan is provided as the argument; | |
| * here N is the length of the input vector x. | | * here N is the length of the input vector x. | |
| * | | * | |
| * @param[out] output The real output data vector y of length N | | * @param[out] output The real output data vector y of length N | |
| * @param[in] input The input real data vector x of length N | | * @param[in] input The input real data vector x of length N | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @note | | * @note | |
| * The input and output vectors must be distinct. | | * The input and output vectors must be distinct. | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL4VectorFFT() function shall fail if: | | * The \c XLALREAL4VectorFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | | * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | |
| * reverse transform. | | * reverse transform. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
|
| int XLALREAL4VectorFFT( REAL4Vector * restrict output, const REAL4Vector *
restrict input, | | int XLALREAL4VectorFFT( REAL4Vector * _LAL_RESTRICT_ output, const REAL4Vec
tor * _LAL_RESTRICT_ input, | |
| const REAL4FFTPlan *plan ); | | const REAL4FFTPlan *plan ); | |
| | | | |
|
| /** Computes the power spectrum of REAL4 data | | /** | |
| | | * Computes the power spectrum of REAL4 data | |
| * | | * | |
| * This routine computes | | * This routine computes | |
| * \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2&k=0\\2|z[k]|^2&1\leq \lfloor (N
+1)/2\rfloor\\|z[N/2]|^2&k=N/2,\;\mbox{$N$ even}\end{array}\right.\f] | | * \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2&k=0\\2|z[k]|^2&1\leq \lfloor (N
+1)/2\rfloor\\|z[N/2]|^2&k=N/2,\;\mbox{$N$ even}\end{array}\right.\f] | |
| * where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f] | | * where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f] | |
| * and N is the length of the input vector x. | | * and N is the length of the input vector x. | |
| * | | * | |
| * @param[out] spec The real power spectrum P of length [N/2] + 1 of the da
ta x | | * @param[out] spec The real power spectrum P of length [N/2] + 1 of the da
ta x | |
| * @param[in] data The input real data vector x of length N | | * @param[in] data The input real data vector x of length N | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL4PowerSpectrum() function shall fail if: | | * The \c XLALREAL4PowerSpectrum() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the input and output | | * - [\c XLAL_EINVAL] A argument is invalid or the input and output | |
| * data vectors are the same. | | * data vectors are the same. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
| int XLALREAL4PowerSpectrum( REAL4Vector *spec, const REAL4Vector *data, | | int XLALREAL4PowerSpectrum( REAL4Vector *spec, const REAL4Vector *data, | |
| const REAL4FFTPlan *plan ); | | const REAL4FFTPlan *plan ); | |
| | | | |
| /* | | /* | |
| * | | * | |
| * XLAL REAL8 functions | | * XLAL REAL8 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** Returns a new REAL8FFTPlan | | /** | |
| | | * Returns a new REAL8FFTPlan | |
| * | | * | |
| * A REAL8FFTPlan is required to perform a FFT that involves real data. | | * A REAL8FFTPlan is required to perform a FFT that involves real data. | |
| * A different plan is required for each size of the real data vector | | * A different plan is required for each size of the real data vector | |
| * and for each direction of transform (forward or reverse). | | * and for each direction of transform (forward or reverse). | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | | * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | |
| * where N, the size of the transform, is the length of the vector x. | | * where N, the size of the transform, is the length of the vector x. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | | * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | |
| * where N, the size of the transform, is the length of the vector y. | | * where N, the size of the transform, is the length of the vector y. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a \"reverse\" | | * equal to N times the original data (we therefore call it a \"reverse\" | |
| * transform rather than an \"inverse\" transform). | | * transform rather than an \"inverse\" transform). | |
| * | | * | |
| * @param[in] size The number of points in the real data. | | * @param[in] size The number of points in the real data. | |
| * @param[in] fwdflg Set non-zero for a forward FFT plan; | | * @param[in] fwdflg Set non-zero for a forward FFT plan; | |
|
| * otherwise create a reverse plan | | * otherwise create a reverse plan | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c REAL8FFTPlan structure is returned | | * @return A pointer to an allocated \c REAL8FFTPlan structure is returned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateREAL8Plan() function shall fail if: | | * The \c XLALCreateREAL8Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| REAL8FFTPlan * XLALCreateREAL8FFTPlan( UINT4 size, int fwdflg, int measurel
vl ); | | REAL8FFTPlan * XLALCreateREAL8FFTPlan( UINT4 size, int fwdflg, int measurel
vl ); | |
| | | | |
|
| /** Returns a new REAL8FFTPlan for a forward transform | | /** | |
| | | * Returns a new REAL8FFTPlan for a forward transform | |
| * | | * | |
| * A REAL8FFTPlan is required to perform a FFT that involves real data. | | * A REAL8FFTPlan is required to perform a FFT that involves real data. | |
| * A different plan is required for each size of the real data vector. | | * A different plan is required for each size of the real data vector. | |
| * A forward transform performs | | * A forward transform performs | |
| * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | | * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | |
| * where N, the size of the transform, is the length of the vector x. | | * where N, the size of the transform, is the length of the vector x. | |
| * | | * | |
| * @param[in] size The number of points in the real data. | | * @param[in] size The number of points in the real data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c REAL8FFTPlan structure is returned | | * @return A pointer to an allocated \c REAL8FFTPlan structure is returned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateForwardREAL8Plan() function shall fail if: | | * The \c XLALCreateForwardREAL8Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl ); | | REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan( UINT4 size, int measurelvl ); | |
| | | | |
|
| /** Returns a new REAL8FFTPlan for a reverse transform | | /** | |
| | | * Returns a new REAL8FFTPlan for a reverse transform | |
| * | | * | |
| * A REAL8FFTPlan is required to perform a FFT that involves real data. | | * A REAL8FFTPlan is required to perform a FFT that involves real data. | |
| * A reverse transform performs | | * A reverse transform performs | |
| * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | | * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | |
| * where N, the size of the transform, is the length of the vector y. | | * where N, the size of the transform, is the length of the vector y. | |
| * | | * | |
| * @note | | * @note | |
| * The reverse transform of the forward transform of some data is | | * The reverse transform of the forward transform of some data is | |
| * equal to N times the original data (we therefore call it a \"reverse\" | | * equal to N times the original data (we therefore call it a \"reverse\" | |
| * transform rather than an \"inverse\" transform). | | * transform rather than an \"inverse\" transform). | |
| * | | * | |
| * @param[in] size The number of points in the real data. | | * @param[in] size The number of points in the real data. | |
| * @param[in] measurelvl Measurement level for plan creation: | | * @param[in] measurelvl Measurement level for plan creation: | |
|
| * - 0: no measurement, just estimate the plan; | | * - 0: no measurement, just estimate the plan; | |
| * - 1: measure the best plan; | | * - 1: measure the best plan; | |
| * - 2: perform a lengthy measurement of the best plan | | * - 2: perform a lengthy measurement of the best plan; | |
| ; | | * - 3: perform an exhasutive measurement of the best plan. | |
| * - 3: perform an exhasutive measurement of the best | | | |
| plan. | | | |
| * @return A pointer to an allocated \c REAL8FFTPlan structure is returned | | * @return A pointer to an allocated \c REAL8FFTPlan structure is returned | |
| * upon successful completion. Otherwise, a \c NULL pointer is returned | | * upon successful completion. Otherwise, a \c NULL pointer is returned | |
| * and \c xlalErrno is set to indicate the error. | | * and \c xlalErrno is set to indicate the error. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALCreateReverseREAL8Plan() function shall fail if: | | * The \c XLALCreateReverseREAL8Plan() function shall fail if: | |
|
| * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | | * - [\c XLAL_EBADLEN] The size of the requested plan is 0. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | | * - [\c XLAL_EFAILED] The call to the underlying FFTW routine failed. | |
| * . | | * . | |
| */ | | */ | |
| REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl ); | | REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan( UINT4 size, int measurelvl ); | |
| | | | |
|
| /** Destroys a REAL8FFTPlan | | /** | |
| | | * Destroys a REAL8FFTPlan | |
| * @param[in] plan A pointer to the REAL8FFTPlan to be destroyed. | | * @param[in] plan A pointer to the REAL8FFTPlan to be destroyed. | |
| * @return None. | | * @return None. | |
| */ | | */ | |
| void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan ); | | void XLALDestroyREAL8FFTPlan( REAL8FFTPlan *plan ); | |
| | | | |
|
| /** Performs a forward FFT of REAL8 data | | /** | |
| | | * Performs a forward FFT of REAL8 data | |
| * | | * | |
| * This routine performs the transformation: | | * This routine performs the transformation: | |
| * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | | * \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j]\f] | |
| * where N, the size of the transform, is the length of the vector x. | | * where N, the size of the transform, is the length of the vector x. | |
| * | | * | |
| * @note | | * @note | |
| * Due to the reality of the input data x, the following identity | | * Due to the reality of the input data x, the following identity | |
| * holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | | * holds for the complex FFT data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | |
| * the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | | * the length of the output vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | |
| * since the remaining \"negative\" frequency components can be obtained fr
om the | | * since the remaining \"negative\" frequency components can be obtained fr
om the | |
| * \"positive\" frequency components. | | * \"positive\" frequency components. | |
| * | | * | |
| * @param[out] output The complex data vector z of length [N/2] + 1 | | * @param[out] output The complex data vector z of length [N/2] + 1 | |
| * that results from the transform | | * that results from the transform | |
| * @param[in] input The real data vector x of length to be transformed | | * @param[in] input The real data vector x of length to be transformed | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL8ForwardFFT() function shall fail if: | | * The \c XLALREAL8ForwardFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | | * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | |
| * reverse transform. | | * reverse transform. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
| int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input, | | int XLALREAL8ForwardFFT( COMPLEX16Vector *output, REAL8Vector *input, | |
| const REAL8FFTPlan *plan ); | | const REAL8FFTPlan *plan ); | |
| | | | |
|
| /** Performs a reverse FFT of REAL8 data | | /** | |
| | | * Performs a reverse FFT of REAL8 data | |
| * | | * | |
| * This routine performs the transformation: | | * This routine performs the transformation: | |
| * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | | * \f[y[j] = \sum_{k=0}^{N-1} e^{+2\pi ijk/N}\,z[k]\f] | |
| * where N, the size of the transform, is the length of the vector y. | | * where N, the size of the transform, is the length of the vector y. | |
| * | | * | |
| * @note | | * @note | |
| * Due to the reality of the output data y, the following identity | | * Due to the reality of the output data y, the following identity | |
| * holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | | * holds for the complex data: \f$z[N-k]=z^\ast[k]\f$. Therefore, | |
| * the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | | * the length of the input vector is equal to \f$\lfloor N/2\rfloor + 1\f$ | |
| * since the remaining \"negative\" frequency components can be obtained fr
om the | | * since the remaining \"negative\" frequency components can be obtained fr
om the | |
| * \"positive\" frequency components. | | * \"positive\" frequency components. | |
| * | | * | |
| * @param[out] output The real data vector y of length N | | * @param[out] output The real data vector y of length N | |
| * that results from the transform | | * that results from the transform | |
| * @param[in] input The complex data vector z of length [N/2] + 1 | | * @param[in] input The complex data vector z of length [N/2] + 1 | |
| * to be transformed | | * to be transformed | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL8ForwardFFT() function shall fail if: | | * The \c XLALREAL8ForwardFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | | * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | |
| * reverse transform. | | * reverse transform. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[ | | * - [\c XLAL_EDOM] Domain error if the DC component of the input data, z[0 | |
| 0], | | ], | |
| * is not purely real | | * is not purely real | |
| * or if the length of the output vector N is even and the Nyquist | | * or if the length of the output vector N is even and the Nyquist | |
| * component of the input data, z[N/2], is not purely real. | | * component of the input data, z[N/2], is not purely real. | |
| * . | | * . | |
| */ | | */ | |
| int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input, | | int XLALREAL8ReverseFFT( REAL8Vector *output, COMPLEX16Vector *input, | |
| const REAL8FFTPlan *plan ); | | const REAL8FFTPlan *plan ); | |
| | | | |
|
| /** Perform a REAL8Vector to REAL8Vector FFT | | /** | |
| | | * Perform a REAL8Vector to REAL8Vector FFT | |
| * | | * | |
| * This routine computes | | * This routine computes | |
| * \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I
m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f] | | * \f[y[k]=\left\{\begin{array}{ll}\Re z[k]&0\le k\le\lfloor N/2\rfloor\\\I
m z[N-k]&\lfloor N/2\rfloor<k<N\end{array}\right.\f] | |
| * where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f] | | * where \f[z[k] = \sum_{j=0}^{N-1} e^{\mp2\pi ijk/N}\,x[j],\f] | |
| * and where the minus sign is used if a forward plan is provided as the ar
gument | | * and where the minus sign is used if a forward plan is provided as the ar
gument | |
| * and the plus sign is used if a reverse plan is provided as the argument; | | * and the plus sign is used if a reverse plan is provided as the argument; | |
| * here N is the length of the input vector x. | | * here N is the length of the input vector x. | |
| * | | * | |
| * @param[out] output The real output data vector y of length N | | * @param[out] output The real output data vector y of length N | |
| * @param[in] input The input real data vector x of length N | | * @param[in] input The input real data vector x of length N | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @note | | * @note | |
| * The input and output vectors must be distinct. | | * The input and output vectors must be distinct. | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL8VectorFFT() function shall fail if: | | * The \c XLALREAL8VectorFFT() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the input and output data | | * - [\c XLAL_EINVAL] A argument is invalid or the input and output data | |
| * vectors are the same. | | * vectors are the same. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
| int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input, | | int XLALREAL8VectorFFT( REAL8Vector *output, REAL8Vector *input, | |
| const REAL8FFTPlan *plan ); | | const REAL8FFTPlan *plan ); | |
| | | | |
|
| /** Computes the power spectrum of REAL8 data | | /** | |
| | | * Computes the power spectrum of REAL8 data | |
| * | | * | |
| * This routine computes | | * This routine computes | |
| * \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2 & k=0\\2|z[k]|^2 & 1\leq \lfloo
r (N+1)/2\rfloor\\ |z[N/2]|^2 & k=N/2,\;\mbox{$N$ even}\end{array}\right.\f
] | | * \f[P[k]=\left\{\begin{array}{ll}|z[0]|^2 & k=0\\2|z[k]|^2 & 1\leq \lfloo
r (N+1)/2\rfloor\\ |z[N/2]|^2 & k=N/2,\;\mbox{$N$ even}\end{array}\right.\f
] | |
| * where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f] | | * where \f[z[k] = \sum_{j=0}^{N-1} e^{-2\pi ijk/N}\,x[j],\f] | |
| * and N is the length of the input vector x. | | * and N is the length of the input vector x. | |
| * | | * | |
| * @param[out] spec The real power spectrum P of length [N/2] + 1 of the da
ta x | | * @param[out] spec The real power spectrum P of length [N/2] + 1 of the da
ta x | |
| * @param[in] data The input real data vector x of length N | | * @param[in] data The input real data vector x of length N | |
| * @param[in] plan The FFT plan to use for the transform | | * @param[in] plan The FFT plan to use for the transform | |
| * @return 0 upon successful completion or non-zero upon failure. | | * @return 0 upon successful completion or non-zero upon failure. | |
| * @par Errors: | | * @par Errors: | |
| * The \c XLALREAL8PowerSpectrum() function shall fail if: | | * The \c XLALREAL8PowerSpectrum() function shall fail if: | |
|
| * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the argument | | * - [\c XLAL_EFAULT] A \c NULL pointer is provided as one of the arguments | |
| s. | | . | |
| * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | | * - [\c XLAL_EINVAL] A argument is invalid or the plan is for a | |
| * reverse transform. | | * reverse transform. | |
| * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | | * - [\c XLAL_EBADLEN] The input vector, output vector, and plan size are | |
| * incompatible. | | * incompatible. | |
| * - [\c XLAL_ENOMEM] Insufficient storage space is available. | | * - [\c XLAL_ENOMEM] Insufficient storage space is available. | |
| * . | | * . | |
| */ | | */ | |
| int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data, | | int XLALREAL8PowerSpectrum( REAL8Vector *spec, REAL8Vector *data, | |
| const REAL8FFTPlan *plan ); | | const REAL8FFTPlan *plan ); | |
| | | | |
| /* | | /* | |
| * | | * | |
| * LAL REAL4 functions | | * LAL REAL4 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateForwardREAL4FFTPlan() instead. | | * @deprecated Use XLALCreateForwardREAL4FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateForwardREAL4FFTPlan( | | LALCreateForwardREAL4FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4FFTPlan **plan, | | REAL4FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateForwardREAL4FFTPlan() instead. | | * @deprecated Use XLALCreateForwardREAL4FFTPlan() instead. | |
| */ | | */ | |
| #define LALCreateForwardRealFFTPlan LALCreateForwardREAL4FFTPlan | | #define LALCreateForwardRealFFTPlan LALCreateForwardREAL4FFTPlan | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateReverseREAL4FFTPlan() instead. | | * @deprecated Use XLALCreateReverseREAL4FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateReverseREAL4FFTPlan( | | LALCreateReverseREAL4FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4FFTPlan **plan, | | REAL4FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateReverseREAL4FFTPlan() instead. | | * @deprecated Use XLALCreateReverseREAL4FFTPlan() instead. | |
| */ | | */ | |
| #define LALCreateReverseRealFFTPlan LALCreateReverseREAL4FFTPlan | | #define LALCreateReverseRealFFTPlan LALCreateReverseREAL4FFTPlan | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALDestroyREAL4FFTPlan() instead. | | * @deprecated Use XLALDestroyREAL4FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALDestroyREAL4FFTPlan( | | LALDestroyREAL4FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4FFTPlan **plan | | REAL4FFTPlan **plan | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALDestroyREAL4FFTPlan() instead. | | * @deprecated Use XLALDestroyREAL4FFTPlan() instead. | |
| */ | | */ | |
| #define LALDestroyRealFFTPlan LALDestroyREAL4FFTPlan | | #define LALDestroyRealFFTPlan LALDestroyREAL4FFTPlan | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL4ForwardFFT() instead. | | * @deprecated Use XLALREAL4ForwardFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALForwardREAL4FFT( | | LALForwardREAL4FFT( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX8Vector *output, | | COMPLEX8Vector *output, | |
| REAL4Vector *input, | | REAL4Vector *input, | |
| REAL4FFTPlan *plan | | REAL4FFTPlan *plan | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL4ForwardFFT() instead. | | * @deprecated Use XLALREAL4ForwardFFT() instead. | |
| */ | | */ | |
| #define LALForwardRealFFT LALForwardREAL4FFT | | #define LALForwardRealFFT LALForwardREAL4FFT | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL4ReverseFFT() instead. | | * @deprecated Use XLALREAL4ReverseFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALReverseREAL4FFT( | | LALReverseREAL4FFT( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4Vector *output, | | REAL4Vector *output, | |
| COMPLEX8Vector *input, | | COMPLEX8Vector *input, | |
| REAL4FFTPlan *plan | | REAL4FFTPlan *plan | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL4ReverseFFT() instead. | | * @deprecated Use XLALREAL4ReverseFFT() instead. | |
| */ | | */ | |
| #define LALReverseRealFFT LALReverseREAL4FFT | | #define LALReverseRealFFT LALReverseREAL4FFT | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL4PowerSpectrum() instead. | | * @deprecated Use XLALREAL4PowerSpectrum() instead. | |
| */ | | */ | |
| void | | void | |
| LALREAL4PowerSpectrum ( | | LALREAL4PowerSpectrum ( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4Vector *spec, | | REAL4Vector *spec, | |
| REAL4Vector *data, | | REAL4Vector *data, | |
| REAL4FFTPlan *plan | | REAL4FFTPlan *plan | |
| ); | | ); | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL4PowerSpectrum() instead. | | * @deprecated Use XLALREAL4PowerSpectrum() instead. | |
| */ | | */ | |
| #define LALRealPowerSpectrum LALREAL4PowerSpectrum | | #define LALRealPowerSpectrum LALREAL4PowerSpectrum | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL4VectorFFT() instead. | | * @deprecated Use XLALREAL4VectorFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALREAL4VectorFFT( | | LALREAL4VectorFFT( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL4Vector *output, | | REAL4Vector *output, | |
| REAL4Vector *input, | | REAL4Vector *input, | |
| REAL4FFTPlan *plan | | REAL4FFTPlan *plan | |
| ); | | ); | |
| | | | |
| /* | | /* | |
| * | | * | |
| * LAL REAL8 functions | | * LAL REAL8 functions | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateForwardREAL8FFTPlan() instead. | | * @deprecated Use XLALCreateForwardREAL8FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateForwardREAL8FFTPlan( | | LALCreateForwardREAL8FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL8FFTPlan **plan, | | REAL8FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALCreateReverseREAL8FFTPlan() instead. | | * @deprecated Use XLALCreateReverseREAL8FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALCreateReverseREAL8FFTPlan( | | LALCreateReverseREAL8FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL8FFTPlan **plan, | | REAL8FFTPlan **plan, | |
| UINT4 size, | | UINT4 size, | |
| INT4 measure | | INT4 measure | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALDestroyREAL8FFTPlan() instead. | | * @deprecated Use XLALDestroyREAL8FFTPlan() instead. | |
| */ | | */ | |
| void | | void | |
| LALDestroyREAL8FFTPlan( | | LALDestroyREAL8FFTPlan( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL8FFTPlan **plan | | REAL8FFTPlan **plan | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL8ForwardFFT() instead. | | * @deprecated Use XLALREAL8ForwardFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALForwardREAL8FFT( | | LALForwardREAL8FFT( | |
| LALStatus *status, | | LALStatus *status, | |
| COMPLEX16Vector *output, | | COMPLEX16Vector *output, | |
| REAL8Vector *input, | | REAL8Vector *input, | |
| REAL8FFTPlan *plan | | REAL8FFTPlan *plan | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL8ReverseFFT() instead. | | * @deprecated Use XLALREAL8ReverseFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALReverseREAL8FFT( | | LALReverseREAL8FFT( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL8Vector *output, | | REAL8Vector *output, | |
| COMPLEX16Vector *input, | | COMPLEX16Vector *input, | |
| REAL8FFTPlan *plan | | REAL8FFTPlan *plan | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL8PowerSpectrum() instead. | | * @deprecated Use XLALREAL8PowerSpectrum() instead. | |
| */ | | */ | |
| void | | void | |
| LALREAL8PowerSpectrum ( | | LALREAL8PowerSpectrum ( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL8Vector *spec, | | REAL8Vector *spec, | |
| REAL8Vector *data, | | REAL8Vector *data, | |
| REAL8FFTPlan *plan | | REAL8FFTPlan *plan | |
| ); | | ); | |
| | | | |
|
| /** \b DEPRECATED | | /** | |
| | | * \b DEPRECATED | |
| * @deprecated Use XLALREAL8VectorFFT() instead. | | * @deprecated Use XLALREAL8VectorFFT() instead. | |
| */ | | */ | |
| void | | void | |
| LALREAL8VectorFFT( | | LALREAL8VectorFFT( | |
| LALStatus *status, | | LALStatus *status, | |
| REAL8Vector *output, | | REAL8Vector *output, | |
| REAL8Vector *input, | | REAL8Vector *input, | |
| REAL8FFTPlan *plan | | REAL8FFTPlan *plan | |
| ); | | ); | |
| | | | |
| | | | |
End of changes. 66 change blocks. |
| 182 lines changed or deleted | | 205 lines changed or added | |
|
| SeqFactories.h | | SeqFactories.h | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| #define _SEQFACTORIES_H | | #define _SEQFACTORIES_H | |
| | | | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| #include <lal/AVFactories.h> | | #include <lal/AVFactories.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup SeqFactories_h | | * \addtogroup SeqFactories_h | |
| | | * | |
| \brief Provides prototype and status code information for use of CreateVect | | * \brief Provides prototype and status code information for use of CreateV | |
| orSequence and DestroyVectorSequence. | | ectorSequence and DestroyVectorSequence. | |
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/SeqFactories.h> | | * \code | |
| \endcode | | * #include <lal/SeqFactories.h> | |
| | | * \endcode | |
| \section sec_SF_XLALfcts XLAL Functions | | * | |
| | | * \section sec_SF_XLALfcts XLAL Functions | |
| \code | | * | |
| REAL4VectorSequence * XLALCreateVectorSequence(UINT4 length, UINT4 veclen); | | * \code | |
| void XLALCreateVectorSequence(REAL4VectorSequence *vecseq); | | * REAL4VectorSequence * XLALCreateVectorSequence(UINT4 length, UINT4 vecle | |
| | | n); | |
| <vecseqtype> * XLALCreate<vecseqtype>(UINT4 length, UINT4 veclen); | | * void XLALCreateVectorSequence(REAL4VectorSequence *vecseq); | |
| void XLALCreate<vecseqtype>(<vecseqtype> *vecseq); | | * | |
| \endcode | | * <vecseqtype> * XLALCreate<vecseqtype>(UINT4 length, UINT4 veclen); | |
| | | * void XLALCreate<vecseqtype>(<vecseqtype> *vecseq); | |
| Here <tt>\<vecseqtype\></tt> is one of | | * \endcode | |
| \c COMPLEX16VectorSequence, | | * | |
| \c COMPLEX8VectorSequence, | | * Here <tt>\<vecseqtype\></tt> is one of | |
| \c REAL8VectorSequence, | | * \c COMPLEX16VectorSequence, | |
| \c REAL4VectorSequence, | | * \c COMPLEX8VectorSequence, | |
| \c INT8VectorSequence, | | * \c REAL8VectorSequence, | |
| \c INT4VectorSequence, | | * \c REAL4VectorSequence, | |
| \c INT2VectorSequence, | | * \c INT8VectorSequence, | |
| \c UINT8VectorSequence, | | * \c INT4VectorSequence, | |
| \c UINT4VectorSequence, | | * \c INT2VectorSequence, | |
| \c UINT2VectorSequence, or | | * \c UINT8VectorSequence, | |
| \c CHARVectorSequence. | | * \c UINT4VectorSequence, | |
| | | * \c UINT2VectorSequence, or | |
| \subsection ss_SF_desc Description | | * \c CHARVectorSequence. | |
| | | * | |
| The <tt>XLALCreate\<type\>VectorSequence</tt> functions create vector seque | | * \subsection ss_SF_desc Description | |
| nces | | * | |
| of type <tt>\<type\></tt>, length and vector length \c veclen. | | * The <tt>XLALCreate\<type\>VectorSequence</tt> functions create vector se | |
| The function \c XLALCreateVectorSequence is the same as | | quences | |
| \c XLALCreateREAL4VectorSequence. | | * of type <tt>\<type\></tt>, length and vector length \c veclen. | |
| | | * The function \c XLALCreateVectorSequence is the same as | |
| The <tt>XLALDestroy\<type\>VectorSequence</tt> functions deallocate the mem | | * \c XLALCreateREAL4VectorSequence. | |
| ory | | * | |
| allocation pointed to by \c vecseq including its contents. The function | | * The <tt>XLALDestroy\<type\>VectorSequence</tt> functions deallocate the | |
| \c XLALDestroyVectorSequence is the same as | | memory | |
| \c XLALDestroyREAL4VectorSequence. | | * allocation pointed to by \c vecseq including its contents. The function | |
| | | * \c XLALDestroyVectorSequence is the same as | |
| \subsection ss_SF_ret Return Values | | * \c XLALDestroyREAL4VectorSequence. | |
| | | * | |
| The create functions return a pointer to the created vector sequence if | | * \subsection ss_SF_ret Return Values | |
| successful; upon failure they will return \c NULL and set \c xlalErrno | | * | |
| to one of the following values: \c #XLAL_ENOMEM if memory allocation | | * The create functions return a pointer to the created vector sequence if | |
| failed, or \c #XLAL_EBADLEN if the requested \c length or \c veclen | | * successful; upon failure they will return \c NULL and set \c xlalErrno | |
| is zero. | | * to one of the following values: \c #XLAL_ENOMEM if memory allocation | |
| | | * failed, or \c #XLAL_EBADLEN if the requested \c length or \c veclen | |
| The destroy functions do not have a return value. They can fail if they ar | | * is zero. | |
| e | | * | |
| passed a \c NULL pointer, in which case \c xlalErrno is set to | | * The destroy functions do not have a return value. They can fail if they | |
| \c #XLAL_EFAULT, or if the vector sequency passed to the destroy routine | | are | |
| has zero length, vector length, or \c NULL data pointer then | | * passed a \c NULL pointer, in which case \c xlalErrno is set to | |
| \c xlalErrno is set to \c #XLAL_EINVAL. | | * \c #XLAL_EFAULT, or if the vector sequency passed to the destroy routine | |
| | | * has zero length, vector length, or \c NULL data pointer then | |
| */ | | * \c xlalErrno is set to \c #XLAL_EINVAL. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /**\name Error Codes */ | | /**\name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define SEQFACTORIESH_ESLENGTH 1 /**< Illegal sequence length. */ | | #define SEQFACTORIESH_ESLENGTH 1 /**< Illegal sequence length. */ | |
| #define SEQFACTORIESH_EVLENGTH 2 /**< Illegal vector length. */ | | #define SEQFACTORIESH_EVLENGTH 2 /**< Illegal vector length. */ | |
| #define SEQFACTORIESH_EALENGTH 4 /**< Illegal array dimension. */ | | #define SEQFACTORIESH_EALENGTH 4 /**< Illegal array dimension. */ | |
| #define SEQFACTORIESH_EVPTR 8 /**< Null sequence handle. */ | | #define SEQFACTORIESH_EVPTR 8 /**< Null sequence handle. */ | |
| #define SEQFACTORIESH_EUPTR 16 /**< Non-null sequence pointer. */ | | #define SEQFACTORIESH_EUPTR 16 /**< Non-null sequence pointer. */ | |
| #define SEQFACTORIESH_EDPTR 32 /**< Null sequence data. */ | | #define SEQFACTORIESH_EDPTR 32 /**< Null sequence data. */ | |
| | | | |
| skipping to change at line 96 | | skipping to change at line 97 | |
| #define SEQFACTORIESH_MSGESLENGTH "Illegal sequence length." | | #define SEQFACTORIESH_MSGESLENGTH "Illegal sequence length." | |
| #define SEQFACTORIESH_MSGEVLENGTH "Illegal vector length." | | #define SEQFACTORIESH_MSGEVLENGTH "Illegal vector length." | |
| #define SEQFACTORIESH_MSGEALENGTH "Illegal array dimension." | | #define SEQFACTORIESH_MSGEALENGTH "Illegal array dimension." | |
| #define SEQFACTORIESH_MSGEVPTR "Null sequence handle." | | #define SEQFACTORIESH_MSGEVPTR "Null sequence handle." | |
| #define SEQFACTORIESH_MSGEUPTR "Non-null sequence pointer." | | #define SEQFACTORIESH_MSGEUPTR "Non-null sequence pointer." | |
| #define SEQFACTORIESH_MSGEDPTR "Null sequence data." | | #define SEQFACTORIESH_MSGEDPTR "Null sequence data." | |
| #define SEQFACTORIESH_MSGEINPTR "Null input pointer." | | #define SEQFACTORIESH_MSGEINPTR "Null input pointer." | |
| #define SEQFACTORIESH_MSGEMALLOC "Malloc failure." | | #define SEQFACTORIESH_MSGEMALLOC "Malloc failure." | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** \brief This structure stores the input required for creating a vector | | /** | |
| | | * \brief This structure stores the input required for creating a vector | |
| * sequence. This input includes the length of the sequence (i.e., the num
ber of | | * sequence. This input includes the length of the sequence (i.e., the num
ber of | |
| * vectors) and the length of each vector. | | * vectors) and the length of each vector. | |
| */ | | */ | |
| typedef struct tagCreateVectorSequenceIn { | | typedef struct tagCreateVectorSequenceIn { | |
| UINT4 length; /**< The sequence length */ | | UINT4 length; /**< The sequence length */ | |
| UINT4 vectorLength; /**< The length of each vector in the sequence */ | | UINT4 vectorLength; /**< The length of each vector in the sequence */ | |
| } CreateVectorSequenceIn; | | } CreateVectorSequenceIn; | |
| | | | |
|
| /** \brief This structure stores the input required for creating an array | | /** | |
| | | * \brief This structure stores the input required for creating an array | |
| * sequence. This input includes the length of the sequence (i.e., the num
ber of | | * sequence. This input includes the length of the sequence (i.e., the num
ber of | |
| * array) and the dimensions of each array index. | | * array) and the dimensions of each array index. | |
| */ | | */ | |
| typedef struct tagCreateArraySequenceIn { | | typedef struct tagCreateArraySequenceIn { | |
| UINT4 length; /**< The sequence length */ | | UINT4 length; /**< The sequence length */ | |
| UINT4Vector *dimLength; /**< The dimensions of each array index (the
same for every array in the sequence) */ | | UINT4Vector *dimLength; /**< The dimensions of each array index (the
same for every array in the sequence) */ | |
| } CreateArraySequenceIn; | | } CreateArraySequenceIn; | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| /* ---------- end:SeqFactories_h ---------- */ | | /* ---------- end:SeqFactories_h ---------- */ | |
| | | | |
|
| /** \defgroup ArraySequenceFactories_c Module ArraySequenceFactories.c | | /** | |
| \ingroup SeqFactories_h | | * \defgroup ArraySequenceFactories_c Module ArraySequenceFactories.c | |
| | | * \ingroup SeqFactories_h | |
| \brief Create/destroy \<datatype\>ArraySequence objects. | | * | |
| | | * \brief Create/destroy \<datatype\>ArraySequence objects. | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| The \c CreateArraySequence family of functions create a \<datatype\>ArraySe | | * | |
| quence of the appropriate dimensions. | | * The \c CreateArraySequence family of functions create a \<datatype\>Arra | |
| | | ySequence of the appropriate dimensions. | |
| The \c DestroyArraySequence family of functions return the storage allocate | | * | |
| d by the \c CreateArraySequence functions to the system. | | * The \c DestroyArraySequence family of functions return the storage alloc | |
| */ | | ated by the \c CreateArraySequence functions to the system. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name REAL4 prototypes (default name) */ | | /** \name REAL4 prototypes (default name) */ | |
| /*@{*/ | | /*@{*/ | |
| void LALCreateArraySequence(LALStatus *, REAL4ArraySequence **, | | void LALCreateArraySequence(LALStatus *, REAL4ArraySequence **, | |
| CreateArraySequenceIn *); | | CreateArraySequenceIn *); | |
| void LALDestroyArraySequence(LALStatus *, REAL4ArraySequence **); | | void LALDestroyArraySequence(LALStatus *, REAL4ArraySequence **); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \name INT2 prototypes */ | | /** \name INT2 prototypes */ | |
| | | | |
| skipping to change at line 240 | | skipping to change at line 244 | |
| COMPLEX16ArraySequence **arraySequence, | | COMPLEX16ArraySequence **arraySequence, | |
| CreateArraySequenceIn *aSeqParams); | | CreateArraySequenceIn *aSeqParams); | |
| | | | |
| void LALZDestroyArraySequence ( LALStatus *status, | | void LALZDestroyArraySequence ( LALStatus *status, | |
| COMPLEX16ArraySequence **arraySeqence); | | COMPLEX16ArraySequence **arraySeqence); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| /* ---------- end: ArraySequenceFactories_c ---------- */ | | /* ---------- end: ArraySequenceFactories_c ---------- */ | |
| | | | |
|
| /** \defgroup VectorSequenceFactories_c Module VectorSequenceFactories.c | | /** | |
| \ingroup SeqFactories_h | | * \defgroup VectorSequenceFactories_c Module VectorSequenceFactories.c | |
| \brief Create/destroy \<datatype\>VectorSequence objects. | | * \ingroup SeqFactories_h | |
| | | * \brief Create/destroy \<datatype\>VectorSequence objects. | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| The \c CreateVectorSequence family of functions create a \<datatype\>Vector | | * | |
| Sequence of the appropriate dimensions. | | * The \c CreateVectorSequence family of functions create a \<datatype\>Vec | |
| | | torSequence of the appropriate dimensions. | |
| The \c DestroyVectorSequence family of functions return the storage allocat | | * | |
| ed by the \c CreateVectorSequence functions to the system. | | * The \c DestroyVectorSequence family of functions return the storage allo | |
| */ | | cated by the \c CreateVectorSequence functions to the system. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name REAL4 prototypes (default name) */ | | /** \name REAL4 prototypes (default name) */ | |
| /*@{*/ | | /*@{*/ | |
| REAL4VectorSequence * XLALCreateVectorSequence ( UINT4 length, UINT4 veclen
); | | REAL4VectorSequence * XLALCreateVectorSequence ( UINT4 length, UINT4 veclen
); | |
|
| | | #ifndef SWIG /* exclude from SWIG interface */ | |
| void XLALDestroyVectorSequence ( REAL4VectorSequence * vecseq ); | | void XLALDestroyVectorSequence ( REAL4VectorSequence * vecseq ); | |
|
| | | #endif /* SWIG */ | |
| | | | |
| void LALCreateVectorSequence(LALStatus *, REAL4VectorSequence **, | | void LALCreateVectorSequence(LALStatus *, REAL4VectorSequence **, | |
| CreateVectorSequenceIn *); | | CreateVectorSequenceIn *); | |
| void LALDestroyVectorSequence(LALStatus *, REAL4VectorSequence**); | | void LALDestroyVectorSequence(LALStatus *, REAL4VectorSequence**); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** \name CHAR prototypes */ | | /** \name CHAR prototypes */ | |
| /*@{*/ | | /*@{*/ | |
| CHARVectorSequence * XLALCreateCHARVectorSequence ( UINT4 length, UINT4 vec
len ); | | CHARVectorSequence * XLALCreateCHARVectorSequence ( UINT4 length, UINT4 vec
len ); | |
| void XLALDestroyCHARVectorSequence ( CHARVectorSequence * vecseq ); | | void XLALDestroyCHARVectorSequence ( CHARVectorSequence * vecseq ); | |
| | | | |
End of changes. 7 change blocks. |
| 90 lines changed or deleted | | 98 lines changed or added | |
|
| Sequence.h | | Sequence.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| #include <stddef.h> | | #include <stddef.h> | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup SequenceManipulation | | * \addtogroup SequenceManipulation | |
| \author Kipp Cannon <kipp@gravity.phys.uwm.edu> | | * \author Kipp Cannon <kipp@gravity.phys.uwm.edu> | |
| | | * | |
| \brief This is a suite of functions for creating, destroying, and manipulat | | * \brief This is a suite of functions for creating, destroying, and manipu | |
| ing LAL | | lating LAL | |
| sequences. For example XLALCreateREAL4Sequence() is available for | | * sequences. For example XLALCreateREAL4Sequence() is available for | |
| creating sequences of \c REAL4 data. | | * creating sequences of \c REAL4 data. | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| /** \name Creation Functions | | /** | |
| \heading{Synopsis} | | * \name Creation Functions | |
| | | * | |
| \code | | * ### Synopsis ### | |
| #include <lal/Sequence.h> | | * | |
| | | * \code | |
| XLALCreate<sequencetype>() | | * #include <lal/Sequence.h> | |
| LALCreate<sequencetype>() | | * | |
| \endcode | | * XLALCreate<sequencetype>() | |
| | | * LALCreate<sequencetype>() | |
| \heading{Description} | | * \endcode | |
| | | * | |
| These functions create LAL sequences. The parameter \c length | | * ### Description ### | |
| specifies the length of the desired sequence. The return value is a | | * | |
| pointer to the newly created sequence or \c NULL on failure. | | * These functions create LAL sequences. The parameter \c length | |
| */ | | * specifies the length of the desired sequence. The return value is a | |
| | | * pointer to the newly created sequence or \c NULL on failure. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8Sequence *XLALCreateCOMPLEX8Sequence ( size_t length ); | | COMPLEX8Sequence *XLALCreateCOMPLEX8Sequence ( size_t length ); | |
| COMPLEX16Sequence *XLALCreateCOMPLEX16Sequence ( size_t length ); | | COMPLEX16Sequence *XLALCreateCOMPLEX16Sequence ( size_t length ); | |
| REAL4Sequence *XLALCreateREAL4Sequence ( size_t length ); | | REAL4Sequence *XLALCreateREAL4Sequence ( size_t length ); | |
| REAL8Sequence *XLALCreateREAL8Sequence ( size_t length ); | | REAL8Sequence *XLALCreateREAL8Sequence ( size_t length ); | |
| INT2Sequence *XLALCreateINT2Sequence ( size_t length ); | | INT2Sequence *XLALCreateINT2Sequence ( size_t length ); | |
| INT4Sequence *XLALCreateINT4Sequence ( size_t length ); | | INT4Sequence *XLALCreateINT4Sequence ( size_t length ); | |
| INT8Sequence *XLALCreateINT8Sequence ( size_t length ); | | INT8Sequence *XLALCreateINT8Sequence ( size_t length ); | |
| UINT2Sequence *XLALCreateUINT2Sequence ( size_t length ); | | UINT2Sequence *XLALCreateUINT2Sequence ( size_t length ); | |
| UINT4Sequence *XLALCreateUINT4Sequence ( size_t length ); | | UINT4Sequence *XLALCreateUINT4Sequence ( size_t length ); | |
| UINT8Sequence *XLALCreateUINT8Sequence ( size_t length ); | | UINT8Sequence *XLALCreateUINT8Sequence ( size_t length ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Destruction Functions | | /** | |
| | | * \name Destruction Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/Sequence.h> | | * \code | |
| | | * #include <lal/Sequence.h> | |
| XLALDestroy<sequencetype>() | | * | |
| \endcode | | * XLALDestroy<sequencetype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions free all memory associated with a LAL sequence. It is safe | | * | |
| to pass \c NULL to these functions. | | * These functions free all memory associated with a LAL sequence. It is s | |
| | | afe | |
| */ | | * to pass \c NULL to these functions. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| void XLALDestroyCOMPLEX8Sequence ( COMPLEX8Sequence *sequence ); | | void XLALDestroyCOMPLEX8Sequence ( COMPLEX8Sequence *sequence ); | |
| void XLALDestroyCOMPLEX16Sequence ( COMPLEX16Sequence *sequence ); | | void XLALDestroyCOMPLEX16Sequence ( COMPLEX16Sequence *sequence ); | |
| void XLALDestroyREAL4Sequence ( REAL4Sequence *sequence ); | | void XLALDestroyREAL4Sequence ( REAL4Sequence *sequence ); | |
| void XLALDestroyREAL8Sequence ( REAL8Sequence *sequence ); | | void XLALDestroyREAL8Sequence ( REAL8Sequence *sequence ); | |
| void XLALDestroyINT2Sequence ( INT2Sequence *sequence ); | | void XLALDestroyINT2Sequence ( INT2Sequence *sequence ); | |
| void XLALDestroyINT4Sequence ( INT4Sequence *sequence ); | | void XLALDestroyINT4Sequence ( INT4Sequence *sequence ); | |
| void XLALDestroyINT8Sequence ( INT8Sequence *sequence ); | | void XLALDestroyINT8Sequence ( INT8Sequence *sequence ); | |
| void XLALDestroyUINT2Sequence ( UINT2Sequence *sequence ); | | void XLALDestroyUINT2Sequence ( UINT2Sequence *sequence ); | |
| void XLALDestroyUINT4Sequence ( UINT4Sequence *sequence ); | | void XLALDestroyUINT4Sequence ( UINT4Sequence *sequence ); | |
| void XLALDestroyUINT8Sequence ( UINT8Sequence *sequence ); | | void XLALDestroyUINT8Sequence ( UINT8Sequence *sequence ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Cutting Functions | | /** | |
| | | * \name Cutting Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/Sequence.h> | | * \code | |
| | | * #include <lal/Sequence.h> | |
| XLALCut<sequencetype>() | | * | |
| XLALCopy<sequencetype>() | | * XLALCut<sequencetype>() | |
| \endcode | | * XLALCopy<sequencetype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions create a new sequence by extracting a section of an | | * | |
| existing sequence. | | * These functions create a new sequence by extracting a section of an | |
| | | * existing sequence. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8Sequence *XLALCutCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, siz
e_t first, size_t length ); | | COMPLEX8Sequence *XLALCutCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, siz
e_t first, size_t length ); | |
| COMPLEX16Sequence *XLALCutCOMPLEX16Sequence ( COMPLEX16Sequence *sequence,
size_t first, size_t length ); | | COMPLEX16Sequence *XLALCutCOMPLEX16Sequence ( COMPLEX16Sequence *sequence,
size_t first, size_t length ); | |
| REAL4Sequence *XLALCutREAL4Sequence ( REAL4Sequence *sequence, size_t first
, size_t length ); | | REAL4Sequence *XLALCutREAL4Sequence ( REAL4Sequence *sequence, size_t first
, size_t length ); | |
| REAL8Sequence *XLALCutREAL8Sequence ( REAL8Sequence *sequence, size_t first
, size_t length ); | | REAL8Sequence *XLALCutREAL8Sequence ( REAL8Sequence *sequence, size_t first
, size_t length ); | |
| INT2Sequence *XLALCutINT2Sequence ( INT2Sequence *sequence, size_t first, s
ize_t length ); | | INT2Sequence *XLALCutINT2Sequence ( INT2Sequence *sequence, size_t first, s
ize_t length ); | |
| INT4Sequence *XLALCutINT4Sequence ( INT4Sequence *sequence, size_t first, s
ize_t length ); | | INT4Sequence *XLALCutINT4Sequence ( INT4Sequence *sequence, size_t first, s
ize_t length ); | |
| INT8Sequence *XLALCutINT8Sequence ( INT8Sequence *sequence, size_t first, s
ize_t length ); | | INT8Sequence *XLALCutINT8Sequence ( INT8Sequence *sequence, size_t first, s
ize_t length ); | |
| UINT2Sequence *XLALCutUINT2Sequence ( UINT2Sequence *sequence, size_t first
, size_t length ); | | UINT2Sequence *XLALCutUINT2Sequence ( UINT2Sequence *sequence, size_t first
, size_t length ); | |
| UINT4Sequence *XLALCutUINT4Sequence ( UINT4Sequence *sequence, size_t first
, size_t length ); | | UINT4Sequence *XLALCutUINT4Sequence ( UINT4Sequence *sequence, size_t first
, size_t length ); | |
| | | | |
| skipping to change at line 141 | | skipping to change at line 145 | |
| REAL4Sequence *XLALCopyREAL4Sequence ( REAL4Sequence *sequence ); | | REAL4Sequence *XLALCopyREAL4Sequence ( REAL4Sequence *sequence ); | |
| REAL8Sequence *XLALCopyREAL8Sequence ( REAL8Sequence *sequence ); | | REAL8Sequence *XLALCopyREAL8Sequence ( REAL8Sequence *sequence ); | |
| INT2Sequence *XLALCopyINT2Sequence ( INT2Sequence *sequence ); | | INT2Sequence *XLALCopyINT2Sequence ( INT2Sequence *sequence ); | |
| INT4Sequence *XLALCopyINT4Sequence ( INT4Sequence *sequence ); | | INT4Sequence *XLALCopyINT4Sequence ( INT4Sequence *sequence ); | |
| INT8Sequence *XLALCopyINT8Sequence ( INT8Sequence *sequence ); | | INT8Sequence *XLALCopyINT8Sequence ( INT8Sequence *sequence ); | |
| UINT2Sequence *XLALCopyUINT2Sequence ( UINT2Sequence *sequence ); | | UINT2Sequence *XLALCopyUINT2Sequence ( UINT2Sequence *sequence ); | |
| UINT4Sequence *XLALCopyUINT4Sequence ( UINT4Sequence *sequence ); | | UINT4Sequence *XLALCopyUINT4Sequence ( UINT4Sequence *sequence ); | |
| UINT8Sequence *XLALCopyUINT8Sequence ( UINT8Sequence *sequence ); | | UINT8Sequence *XLALCopyUINT8Sequence ( UINT8Sequence *sequence ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Shifting Functions | | /** | |
| | | * \name Shifting Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/Sequence.h> | | * \code | |
| | | * #include <lal/Sequence.h> | |
| XLALShift<sequencetype>() | | * | |
| \endcode | | * XLALShift<sequencetype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions shift the samples in a sequence, with zeros being placed in | | * | |
| the space that is freed. | | * These functions shift the samples in a sequence, with zeros being placed | |
| */ | | in | |
| | | * the space that is freed. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| void XLALShiftCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, int count ); | | void XLALShiftCOMPLEX8Sequence ( COMPLEX8Sequence *sequence, int count ); | |
| void XLALShiftCOMPLEX16Sequence ( COMPLEX16Sequence *sequence, int count ); | | void XLALShiftCOMPLEX16Sequence ( COMPLEX16Sequence *sequence, int count ); | |
| void XLALShiftREAL4Sequence ( REAL4Sequence *sequence, int count ); | | void XLALShiftREAL4Sequence ( REAL4Sequence *sequence, int count ); | |
| void XLALShiftREAL8Sequence ( REAL8Sequence *sequence, int count ); | | void XLALShiftREAL8Sequence ( REAL8Sequence *sequence, int count ); | |
| void XLALShiftINT2Sequence ( INT2Sequence *sequence, int count ); | | void XLALShiftINT2Sequence ( INT2Sequence *sequence, int count ); | |
| void XLALShiftINT4Sequence ( INT4Sequence *sequence, int count ); | | void XLALShiftINT4Sequence ( INT4Sequence *sequence, int count ); | |
| void XLALShiftINT8Sequence ( INT8Sequence *sequence, int count ); | | void XLALShiftINT8Sequence ( INT8Sequence *sequence, int count ); | |
| void XLALShiftUINT2Sequence ( UINT2Sequence *sequence, int count ); | | void XLALShiftUINT2Sequence ( UINT2Sequence *sequence, int count ); | |
| void XLALShiftUINT4Sequence ( UINT4Sequence *sequence, int count ); | | void XLALShiftUINT4Sequence ( UINT4Sequence *sequence, int count ); | |
| void XLALShiftUINT8Sequence ( UINT8Sequence *sequence, int count ); | | void XLALShiftUINT8Sequence ( UINT8Sequence *sequence, int count ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Resizing Functions | | /** | |
| | | * \name Resizing Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/Sequence.h> | | * \code | |
| | | * #include <lal/Sequence.h> | |
| XLALResize<sequencetype>() | | * | |
| XLALShrink<sequencetype>() | | * XLALResize<sequencetype>() | |
| \endcode | | * XLALShrink<sequencetype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| The resize functions alter the size of an existing sequence. The sequence | | * | |
| is adjusted to have the specified length, and that part of the original | | * The resize functions alter the size of an existing sequence. The sequen | |
| sequence starting at sample first is used to fill the new sequence. If | | ce | |
| first is negative, then the start of the new sequence is padded by that | | * is adjusted to have the specified length, and that part of the original | |
| many samples. If part of the new sequence does not correspond to some part | | * sequence starting at sample first is used to fill the new sequence. If | |
| of the original sequence, then those samples are set to 0. | | * first is negative, then the start of the new sequence is padded by that | |
| | | * many samples. If part of the new sequence does not correspond to some p | |
| The shrink functions, originally, could only handle the special case in | | art | |
| which the new sequence is wholly contained in the original sequence. Now | | * of the original sequence, then those samples are set to 0. | |
| the shrink functions are wrappers for the resize functions and are only | | * | |
| retained for backwards compatibility. | | * The shrink functions, originally, could only handle the special case in | |
| | | * which the new sequence is wholly contained in the original sequence. No | |
| */ | | w | |
| | | * the shrink functions are wrappers for the resize functions and are only | |
| | | * retained for backwards compatibility. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8Sequence *XLALResizeCOMPLEX8Sequence ( COMPLEX8Sequence *sequence,
int first, size_t length ); | | COMPLEX8Sequence *XLALResizeCOMPLEX8Sequence ( COMPLEX8Sequence *sequence,
int first, size_t length ); | |
| COMPLEX16Sequence *XLALResizeCOMPLEX16Sequence ( COMPLEX16Sequence *sequenc
e, int first, size_t length ); | | COMPLEX16Sequence *XLALResizeCOMPLEX16Sequence ( COMPLEX16Sequence *sequenc
e, int first, size_t length ); | |
| REAL4Sequence *XLALResizeREAL4Sequence ( REAL4Sequence *sequence, int first
, size_t length ); | | REAL4Sequence *XLALResizeREAL4Sequence ( REAL4Sequence *sequence, int first
, size_t length ); | |
| REAL8Sequence *XLALResizeREAL8Sequence ( REAL8Sequence *sequence, int first
, size_t length ); | | REAL8Sequence *XLALResizeREAL8Sequence ( REAL8Sequence *sequence, int first
, size_t length ); | |
| INT2Sequence *XLALResizeINT2Sequence ( INT2Sequence *sequence, int first, s
ize_t length ); | | INT2Sequence *XLALResizeINT2Sequence ( INT2Sequence *sequence, int first, s
ize_t length ); | |
| INT4Sequence *XLALResizeINT4Sequence ( INT4Sequence *sequence, int first, s
ize_t length ); | | INT4Sequence *XLALResizeINT4Sequence ( INT4Sequence *sequence, int first, s
ize_t length ); | |
| INT8Sequence *XLALResizeINT8Sequence ( INT8Sequence *sequence, int first, s
ize_t length ); | | INT8Sequence *XLALResizeINT8Sequence ( INT8Sequence *sequence, int first, s
ize_t length ); | |
| UINT2Sequence *XLALResizeUINT2Sequence ( UINT2Sequence *sequence, int first
, size_t length ); | | UINT2Sequence *XLALResizeUINT2Sequence ( UINT2Sequence *sequence, int first
, size_t length ); | |
| UINT4Sequence *XLALResizeUINT4Sequence ( UINT4Sequence *sequence, int first
, size_t length ); | | UINT4Sequence *XLALResizeUINT4Sequence ( UINT4Sequence *sequence, int first
, size_t length ); | |
| | | | |
| skipping to change at line 219 | | skipping to change at line 225 | |
| REAL4Sequence *XLALShrinkREAL4Sequence ( REAL4Sequence *sequence, size_t fi
rst, size_t length ); | | REAL4Sequence *XLALShrinkREAL4Sequence ( REAL4Sequence *sequence, size_t fi
rst, size_t length ); | |
| REAL8Sequence *XLALShrinkREAL8Sequence ( REAL8Sequence *sequence, size_t fi
rst, size_t length ); | | REAL8Sequence *XLALShrinkREAL8Sequence ( REAL8Sequence *sequence, size_t fi
rst, size_t length ); | |
| INT2Sequence *XLALShrinkINT2Sequence ( INT2Sequence *sequence, size_t first
, size_t length ); | | INT2Sequence *XLALShrinkINT2Sequence ( INT2Sequence *sequence, size_t first
, size_t length ); | |
| INT4Sequence *XLALShrinkINT4Sequence ( INT4Sequence *sequence, size_t first
, size_t length ); | | INT4Sequence *XLALShrinkINT4Sequence ( INT4Sequence *sequence, size_t first
, size_t length ); | |
| INT8Sequence *XLALShrinkINT8Sequence ( INT8Sequence *sequence, size_t first
, size_t length ); | | INT8Sequence *XLALShrinkINT8Sequence ( INT8Sequence *sequence, size_t first
, size_t length ); | |
| UINT2Sequence *XLALShrinkUINT2Sequence ( UINT2Sequence *sequence, size_t fi
rst, size_t length ); | | UINT2Sequence *XLALShrinkUINT2Sequence ( UINT2Sequence *sequence, size_t fi
rst, size_t length ); | |
| UINT4Sequence *XLALShrinkUINT4Sequence ( UINT4Sequence *sequence, size_t fi
rst, size_t length ); | | UINT4Sequence *XLALShrinkUINT4Sequence ( UINT4Sequence *sequence, size_t fi
rst, size_t length ); | |
| UINT8Sequence *XLALShrinkUINT8Sequence ( UINT8Sequence *sequence, size_t fi
rst, size_t length ); | | UINT8Sequence *XLALShrinkUINT8Sequence ( UINT8Sequence *sequence, size_t fi
rst, size_t length ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Summing Functions | | /** | |
| | | * \name Summing Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/Sequence.h> | | * \code | |
| | | * #include <lal/Sequence.h> | |
| XLAL<datatype>Sum() | | * | |
| XLAL<datatype>SumSquares() | | * XLAL<datatype>Sum() | |
| XLAL<sequencetype>Sum>() | | * XLAL<datatype>SumSquares() | |
| XLAL<sequencetype>SumSquares() | | * XLAL<sequencetype>Sum>() | |
| \endcode | | * XLAL<sequencetype>SumSquares() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| The \c XLAL\<datatype\>Sum() and | | * | |
| \c XLAL\<datatype\>SumSquares() functions sum the | | * The \c XLAL\<datatype\>Sum() and | |
| elements and squares of the elements, respectively, in an array. | | * \c XLAL\<datatype\>SumSquares() functions sum the | |
| | | * elements and squares of the elements, respectively, in an array. | |
| The \c XLAL\<sequencetype\>Sum() and | | * | |
| \c XLAL\<sequencetype\>SumSquares() functions sum the | | * The \c XLAL\<sequencetype\>Sum() and | |
| elements and the squares of the elements, respectively in a sequence. | | * \c XLAL\<sequencetype\>SumSquares() functions sum the | |
| Bounds checking is performed. | | * elements and the squares of the elements, respectively in a sequence. | |
| | | * Bounds checking is performed. | |
| In all cases, the return value is the sum, and these functions cannot fail. | | * | |
| In the case of the sequence-related functions, if the sum extends beyond | | * In all cases, the return value is the sum, and these functions cannot fa | |
| the bounds of the sequence, then the missing values are assumed to be 0. | | il. | |
| | | * In the case of the sequence-related functions, if the sum extends beyond | |
| \heading{Bugs} | | * the bounds of the sequence, then the missing values are assumed to be 0. | |
| | | * | |
| Because the LAL library must conform to the C89 specification, aggregate | | * ### Bugs ### | |
| data types cannot be returned from functions so the COMPLEX8 and COMPLEX16 | | * | |
| versions of the sum functions (not sum-of-squares functions) are commented | | * Because the LAL library must conform to the C89 specification, aggregate | |
| out at this time. | | * data types cannot be returned from functions so the COMPLEX8 and COMPLEX | |
| */ | | 16 | |
| | | * versions of the sum functions (not sum-of-squares functions) are comment | |
| | | ed | |
| | | * out at this time. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8 XLALCOMPLEX8Sum ( const COMPLEX8 *data, size_t first, size_t count
); | | COMPLEX8 XLALCOMPLEX8Sum ( const COMPLEX8 *data, size_t first, size_t count
); | |
| REAL4 XLALCOMPLEX8SumSquares ( const COMPLEX8 *data, size_t first, size_t c
ount ); | | REAL4 XLALCOMPLEX8SumSquares ( const COMPLEX8 *data, size_t first, size_t c
ount ); | |
| COMPLEX8 XLALCOMPLEX8SequenceSum ( const COMPLEX8Sequence *sequence, size_t
first, size_t count ); | | COMPLEX8 XLALCOMPLEX8SequenceSum ( const COMPLEX8Sequence *sequence, size_t
first, size_t count ); | |
| REAL4 XLALCOMPLEX8SequenceSumSquares ( const COMPLEX8Sequence *sequence, si
ze_t first, size_t count ); | | REAL4 XLALCOMPLEX8SequenceSumSquares ( const COMPLEX8Sequence *sequence, si
ze_t first, size_t count ); | |
| COMPLEX16 XLALCOMPLEX16Sum ( const COMPLEX16 *data, size_t first, size_t co
unt ); | | COMPLEX16 XLALCOMPLEX16Sum ( const COMPLEX16 *data, size_t first, size_t co
unt ); | |
| REAL8 XLALCOMPLEX16SumSquares ( const COMPLEX16 *data, size_t first, size_t
count ); | | REAL8 XLALCOMPLEX16SumSquares ( const COMPLEX16 *data, size_t first, size_t
count ); | |
| COMPLEX16 XLALCOMPLEX16SequenceSum ( const COMPLEX16Sequence *sequence, siz
e_t first, size_t count ); | | COMPLEX16 XLALCOMPLEX16SequenceSum ( const COMPLEX16Sequence *sequence, siz
e_t first, size_t count ); | |
| REAL8 XLALCOMPLEX16SequenceSumSquares ( const COMPLEX16Sequence *sequence,
size_t first, size_t count ); | | REAL8 XLALCOMPLEX16SequenceSumSquares ( const COMPLEX16Sequence *sequence,
size_t first, size_t count ); | |
| REAL4 XLALREAL4Sum ( const REAL4 *data, size_t first, size_t count ); | | REAL4 XLALREAL4Sum ( const REAL4 *data, size_t first, size_t count ); | |
| | | | |
| skipping to change at line 297 | | skipping to change at line 304 | |
| UINT4 XLALUINT4Sum ( const UINT4 *data, size_t first, size_t count ); | | UINT4 XLALUINT4Sum ( const UINT4 *data, size_t first, size_t count ); | |
| UINT4 XLALUINT4SumSquares ( const UINT4 *data, size_t first, size_t count )
; | | UINT4 XLALUINT4SumSquares ( const UINT4 *data, size_t first, size_t count )
; | |
| UINT4 XLALUINT4SequenceSum ( const UINT4Sequence *sequence, size_t first, s
ize_t count ); | | UINT4 XLALUINT4SequenceSum ( const UINT4Sequence *sequence, size_t first, s
ize_t count ); | |
| UINT4 XLALUINT4SequenceSumSquares ( const UINT4Sequence *sequence, size_t f
irst, size_t count ); | | UINT4 XLALUINT4SequenceSumSquares ( const UINT4Sequence *sequence, size_t f
irst, size_t count ); | |
| UINT8 XLALUINT8Sum ( const UINT8 *data, size_t first, size_t count ); | | UINT8 XLALUINT8Sum ( const UINT8 *data, size_t first, size_t count ); | |
| UINT8 XLALUINT8SumSquares ( const UINT8 *data, size_t first, size_t count )
; | | UINT8 XLALUINT8SumSquares ( const UINT8 *data, size_t first, size_t count )
; | |
| UINT8 XLALUINT8SequenceSum ( const UINT8Sequence *sequence, size_t first, s
ize_t count ); | | UINT8 XLALUINT8SequenceSum ( const UINT8Sequence *sequence, size_t first, s
ize_t count ); | |
| UINT8 XLALUINT8SequenceSumSquares ( const UINT8Sequence *sequence, size_t f
irst, size_t count ); | | UINT8 XLALUINT8SequenceSumSquares ( const UINT8Sequence *sequence, size_t f
irst, size_t count ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Conjugate Functions | | /** | |
| | | * \name Conjugate Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/Sequence.h> | | * \code | |
| | | * #include <lal/Sequence.h> | |
| XLAL<datatype>Conjugate() | | * | |
| \endcode | | * XLAL<datatype>Conjugate() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions replace a sequence with its complex conjugate. | | * | |
| | | * These functions replace a sequence with its complex conjugate. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8Sequence *XLALConjugateCOMPLEX8Sequence ( COMPLEX8Sequence *series
); | | COMPLEX8Sequence *XLALConjugateCOMPLEX8Sequence ( COMPLEX8Sequence *series
); | |
| COMPLEX16Sequence *XLALConjugateCOMPLEX16Sequence ( COMPLEX16Sequence *seri
es ); | | COMPLEX16Sequence *XLALConjugateCOMPLEX16Sequence ( COMPLEX16Sequence *seri
es ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| #if 0 | | #if 0 | |
| { /* so that editors will match succeeding brace */ | | { /* so that editors will match succeeding brace */ | |
| #elif defined(__cplusplus) | | #elif defined(__cplusplus) | |
| | | | |
End of changes. 8 change blocks. |
| 148 lines changed or deleted | | 164 lines changed or added | |
|
| SimulateCoherentGW.h | | SimulateCoherentGW.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| #include <lal/DetectorSite.h> | | #include <lal/DetectorSite.h> | |
| #include <lal/SkyCoordinates.h> | | #include <lal/SkyCoordinates.h> | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup SimulateCoherentGW_h | | * \addtogroup SimulateCoherentGW_h | |
| \author Creighton, T. D. | | * \author Creighton, T. D. | |
| \deprecated This module is deprecated, please see LALSimulation for a re | | * \deprecated This module is deprecated, please see LALSimulation for a re | |
| placement. | | placement. | |
| */ | | * | |
| /* | | * \brief Provides routines to simulate generic gravitational waveforms | |
| \brief Provides routines to simulate generic gravitational waveforms | | * originating from a particular source. | |
| originating from a particular source. | | * | |
| | | * ### Synopsis ### | |
| \heading{Synopsis} | | * | |
| \code | | * \code | |
| #include <lal/SimulateCoherentGW.h> | | * #include <lal/SimulateCoherentGW.h> | |
| \endcode | | * \endcode | |
| | | * | |
| This header covers generic routines and structures to represent and | | * This header covers generic routines and structures to represent and | |
| simulate the effects of a plane gravitational wave propagating from a | | * simulate the effects of a plane gravitational wave propagating from a | |
| distinct point on the sky. | | * distinct point on the sky. | |
| | | * | |
| Any plane gravitational wave is specified by a direction | | * Any plane gravitational wave is specified by a direction | |
| \f$\mathbf{\hat{n}}\f$ to its apparent source (i.e.\ opposite to its dir | | * \f$\mathbf{\hat{n}}\f$ to its apparent source (i.e.\ opposite to its dir | |
| ection | | ection | |
| of propagation), and by the inistantaneous values \f$h_+(t)\f$, | | * of propagation), and by the inistantaneous values \f$h_+(t)\f$, | |
| \f$h_\times(t)\f$ of its plus and cross polarizations as functions of | | * \f$h_\times(t)\f$ of its plus and cross polarizations as functions of | |
| (retarded) time \f$t=t_0+\mathbf{\hat{n}}\cdot(\mathbf{x}-\mathbf{x}_0)\ | | * (retarded) time \f$t=t_0+\mathbf{\hat{n}}\cdot(\mathbf{x}-\mathbf{x}_0)\ | |
| f$, where | | f$, where | |
| \f$t_0\f$ is the time measured at some local reference point \f$\mathbf{ | | * \f$t_0\f$ is the time measured at some local reference point \f$\mathbf{ | |
| x}_0\f$, | | x}_0\f$, | |
| and \f$t\f$ is the time measured by a synchronized clock at \f$\mathbf{x | | * and \f$t\f$ is the time measured by a synchronized clock at \f$\mathbf{x | |
| }\f$. We | | }\f$. We | |
| adopt the standard meaning of the instantaneous strain amplitudes | | * adopt the standard meaning of the instantaneous strain amplitudes | |
| \f$h_{+,\times}\f$: in some reference transverse \f$x\f$-\f$y\f$ coordin | | * \f$h_{+,\times}\f$: in some reference transverse \f$x\f$-\f$y\f$ coordin | |
| ate system | | ate system | |
| oriented such that \f$\mathbf{\hat{x}}\times\mathbf{\hat{y}}=-\mathbf{\h | | * oriented such that \f$\mathbf{\hat{x}}\times\mathbf{\hat{y}}=-\mathbf{\h | |
| at{n}}\f$ | | at{n}}\f$ | |
| points in the direction of propagation, two free observers originally | | * points in the direction of propagation, two free observers originally | |
| separated by a displacement \f$(x,y)\f$ will experience an additional | | * separated by a displacement \f$(x,y)\f$ will experience an additional | |
| tidal displacement \f$\delta x=(xh_+ + yh_\times)/2\f$, \f$\delta | | * tidal displacement \f$\delta x=(xh_+ + yh_\times)/2\f$, \f$\delta | |
| y=(xh_\times - yh_+)/2\f$. | | * y=(xh_\times - yh_+)/2\f$. | |
| | | * | |
| \heading{Quasiperiodic waves:} Most astrophysical sources of | | * \par Quasiperiodic waves: | |
| gravitational radiation are described as \e quasiperiodic (or, | | * Most astrophysical sources of | |
| less accurately, as "adiabatic"), in that they can be said to have | | * gravitational radiation are described as \e quasiperiodic (or, | |
| an instantaneous frequency, amplitude, and polarization, all of which | | * less accurately, as "adiabatic"), in that they can be said to have | |
| vary on timescales much longer than a wave period. Mathematically we | | * an instantaneous frequency, amplitude, and polarization, all of which | |
| write this as: | | * vary on timescales much longer than a wave period. Mathematically we | |
| \f[ | | * write this as: | |
| h_{+,\times}(t) = A_{+,\times}(t)\cos\phi(t) | | * \f[ | |
| + B_{+,\times}(t)\sin\phi(t) \; , | | * h_{+,\times}(t) = A_{+,\times}(t)\cos\phi(t) | |
| \f] | | * + B_{+,\times}(t)\sin\phi(t) \; , | |
| | | * \f] | |
| \wrapfig{r,0.47\textwidth,fig_phase_diagram} | | * | |
| \image html inject_phase_diagram.png "Fig. [fig_phase_diagram]: Polariza | | * \figure{inject_phase_diagram,eps,0.42,Polarization phase diagram for a q | |
| tion phase diagram for a quasiperiodic gravitational wave. The phase point | | uasiperiodic gravitational wave. The phase point p(t) traces out the indica | |
| p(t) traces out the indicated ellipse in the h_+,h_x plane; the parameters | | ted ellipse in the h_+\,h_x plane; the parameters A1\, A2 and Phi remain ro | |
| A1, A2 and Phi remain roughly constant over many cycles in phi." | | ughly constant over many cycles in phi.} | |
| \image latex inject_phase_diagram.eps "Polarization phase diagram for a | | * | |
| quasiperiodic gravitational wave. The phase point p(t) traces out the indic | | * where \f$\phi(t)=2\pi\int f(t)\,dt\f$, and the <em>evolution timescale</ | |
| ated ellipse in the h_+,h_x plane; the parameters A1, A2 and Phi remain rou | | em> | |
| ghly constant over many cycles in phi." width=0.42\textwidth | | * \f$\tau=\min\{A/\dot{A},B/\dot{B},f/\dot{f}\}\f$ is much greater than | |
| | | * \f$h/\dot{h}\sim1/f\f$. Obviously it is mathematically impossible for t | |
| where \f$\phi(t)=2\pi\int f(t)\,dt\f$, and the <em>evolution timescale</ | | he | |
| em> | | * physical functions \f$h_{+,\times}(t)\f$ to specify uniquely more than t | |
| \f$\tau=\min\{A/\dot{A},B/\dot{B},f/\dot{f}\}\f$ is much greater than | | wo | |
| \f$h/\dot{h}\sim1/f\f$. Obviously it is mathematically impossible for t | | * other functions of time; we rely on the notion of quasiperiodicity to | |
| he | | * define "natural" choices of instantaneous frequency and amplitude. | |
| physical functions \f$h_{+,\times}(t)\f$ to specify uniquely more than t | | * The ambiguity in this choice is on the order of the amount that these | |
| wo | | * quantities change over a cycle. | |
| other functions of time; we rely on the notion of quasiperiodicity to | | * | |
| define "natural" choices of instantaneous frequency and amplitude. | | * While the above formula appears to have five degrees of freedom (two | |
| The ambiguity in this choice is on the order of the amount that these | | * quadrature amplitudes \f$A\f$ and \f$B\f$ for each polarization, plus a | |
| quantities change over a cycle. | | common | |
| | | * phase function \f$\phi\f$), there is a degeneracy between the two | |
| While the above formula appears to have five degrees of freedom (two | | * quadrature amplitudes and a shift in phase. One could simply treat | |
| quadrature amplitudes \f$A\f$ and \f$B\f$ for each polarization, plus a | | * each polarization independently and represent the system with two | |
| common | | * amplitude functions \f$A_{+,\times}\f$ and two phase functions | |
| phase function \f$\phi\f$), there is a degeneracy between the two | | * \f$\phi_{+,\times}\f$, but we would like to preserve the notion that the | |
| quadrature amplitudes and a shift in phase. One could simply treat | | * phases of the two waveforms derive from a single underlying | |
| each polarization independently and represent the system with two | | * instantaneous frequency. We therefore write the waveforms in terms of | |
| amplitude functions \f$A_{+,\times}\f$ and two phase functions | | * two polarization amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, a single phas | |
| \f$\phi_{+,\times}\f$, but we would like to preserve the notion that the | | e | |
| phases of the two waveforms derive from a single underlying | | * function \f$\phi(t)\f$, and a polarization shift \f$\Phi(t)\f$: | |
| instantaneous frequency. We therefore write the waveforms in terms of | | * \f{eqnarray}{ | |
| two polarization amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, a single phas | | * \label{eq_quasiperiodic_hpluscross} | |
| e | | * h_+(t) & = & A_1(t)\cos\Phi(t)\cos\phi(t) | |
| function \f$\phi(t)\f$, and a polarization shift \f$\Phi(t)\f$: | | * - A_2(t)\sin\Phi(t)\sin\phi(t) \; , \\ | |
| \anchor eq_quasiperiodic_hpluscross \f{eqnarray}{ | | * h_\times(t) & = & A_1(t)\sin\Phi(t)\cos\phi(t) | |
| \label{eq_quasiperiodic_hpluscross} | | * + A_2(t)\cos\Phi(t)\sin\phi(t) \; . | |
| h_+(t) & = & A_1(t)\cos\Phi(t)\cos\phi(t) | | * \f} | |
| - A_2(t)\sin\Phi(t)\sin\phi(t) \; , \\ | | * The physical meaning of these functions is shown in \figref{inject_phase | |
| h_\times(t) & = & A_1(t)\sin\Phi(t)\cos\phi(t) | | _diagram}. | |
| + A_2(t)\cos\Phi(t)\sin\phi(t) \; . | | * | |
| \f} | | * There is a close relationship between the polarization shift \f$\Phi\f$ | |
| The physical meaning of these functions is shown in Fig.\figref{fig_phas | | * and the orientation of the \f$x\f$-\f$y\f$ coordinates used to define ou | |
| e_diagram}. | | r | |
| | | * polarization basis: if we rotate the \f$x\f$ and \f$y\f$ axes by an angl | |
| There is a close relationship between the polarization shift \f$\Phi\f$ | | e | |
| and the orientation of the \f$x\f$-\f$y\f$ coordinates used to define ou | | * \f$\Delta\psi\f$, we change \f$\Phi\f$ by an amount \f$-2\Delta\psi\f$. | |
| r | | (The | |
| polarization basis: if we rotate the \f$x\f$ and \f$y\f$ axes by an angl | | * factor of 2 comes from the fact that the + and \f$\times\f$ modes are | |
| e | | * quadrupolar: a + mode rotated \f$45^\circ\f$ is a \f$\times\f$ mode, and | |
| \f$\Delta\psi\f$, we change \f$\Phi\f$ by an amount \f$-2\Delta\psi\f$. | | a | |
| (The | | * mode rotated \f$90^\circ\f$ is the opposite of itself.) We use the | |
| factor of 2 comes from the fact that the + and \f$\times\f$ modes are | | * <em>polarization angle</em> \f$\psi\f$ to define the orientation of the | |
| quadrupolar: a + mode rotated \f$45^\circ\f$ is a \f$\times\f$ mode, and | | * \f$x\f$-axis of the polarization basis relative to an Earth-fixed | |
| a | | * reference frame (see the coordinate conventions below). If \f$\Phi\f$ i | |
| mode rotated \f$90^\circ\f$ is the opposite of itself.) We use the | | s | |
| <em>polarization angle</em> \f$\psi\f$ to define the orientation of the | | * constant, one can redefine \f$\psi\f$ such that \f$\Phi=0\f$; however, w | |
| \f$x\f$-axis of the polarization basis relative to an Earth-fixed | | hen | |
| reference frame (see the coordinate conventions below). If \f$\Phi\f$ i | | * \f$\Phi\f$ changes with time, we would nonetheless like our polarization | |
| s | | * basis to remain fixed. We therefore retain the constant \f$\psi\f$ and | |
| constant, one can redefine \f$\psi\f$ such that \f$\Phi=0\f$; however, w | | * the function \f$\Phi(t)\f$ as distinct quantities. | |
| hen | | * | |
| \f$\Phi\f$ changes with time, we would nonetheless like our polarization | | * The advantage of this quasiperiodic representation of a gravitational | |
| basis to remain fixed. We therefore retain the constant \f$\psi\f$ and | | * wave is that a physical sampling of the parameters \f$A_1\f$, \f$A_2\f$, | |
| the function \f$\Phi(t)\f$ as distinct quantities. | | * \f$\phi\f$, and \f$\Phi\f$ need only be done on timescales \f$\Delta | |
| | | * t\lesssim\tau\f$, whereas the actual wave functions \f$h_{+,\times}\f$ n | |
| The advantage of this quasiperiodic representation of a gravitational | | eed | |
| wave is that a physical sampling of the parameters \f$A_1\f$, \f$A_2\f$, | | * to be sampled on timescales \f$\Delta t\lesssim1/f\f$. | |
| \f$\phi\f$, and \f$\Phi\f$ need only be done on timescales \f$\Delta | | * | |
| t\lesssim\tau\f$, whereas the actual wave functions \f$h_{+,\times}\f$ n | | * The following coordinate conventions are assumed: | |
| eed | | * <ol> | |
| to be sampled on timescales \f$\Delta t\lesssim1/f\f$. | | * <li> Fig. 7 of \cite Will_C_1996 defines standard coordinate | |
| | | * conventions for nonprecessing binaries, and by extension, for any | |
| The following coordinate conventions are assumed: | | * fixed-axis rotating source: If \f$\mathbf{\hat{z}}\f$ points in the dire | |
| <ol> | | ction | |
| <li> Fig. 7 of [\ref Will_C_1996] defines standard coordinate | | * of wave propagation (away from the source), and \f$\mathbf{\hat{l}}\f$ p | |
| conventions for nonprecessing binaries, and by extension, for any | | oints | |
| fixed-axis rotating source: If \f$\mathbf{\hat{z}}\f$ points in the dire | | * in the (constant) direction of the source's angular momentum vector, | |
| ction | | * then the \f$x\f$-\f$y\f$ coordinates used to define the + and \f$\times\ | |
| of wave propagation (away from the source), and \f$\mathbf{\hat{l}}\f$ p | | f$ | |
| oints | | * polarizations are given by \f$\mathbf{\hat{x}}=|\csc | |
| in the (constant) direction of the source's angular momentum vector, | | * i|\mathbf{\hat{z}}\times\mathbf{\hat{l}}\f$ and | |
| then the \f$x\f$-\f$y\f$ coordinates used to define the + and \f$\times\ | | * \f$\mathbf{\hat{y}}=\mathbf{\hat{z}}\times\mathbf{\hat{x}}\f$, where | |
| f$ | | * \f$i=\arccos(\mathbf{\hat{z}}\cdot\mathbf{\hat{l}})\f$ is the inclinatio | |
| polarizations are given by \f$\mathbf{\hat{x}}=|\csc | | n angle | |
| i|\mathbf{\hat{z}}\times\mathbf{\hat{l}}\f$ and | | * between \f$\mathbf{\hat{l}}\f$ and \f$\mathbf{\hat{z}}\f$. Such a syste | |
| \f$\mathbf{\hat{y}}=\mathbf{\hat{z}}\times\mathbf{\hat{x}}\f$, where | | m will | |
| \f$i=\arccos(\mathbf{\hat{z}}\cdot\mathbf{\hat{l}})\f$ is the inclinatio | | * generically have \f$A_1(t)=A(t)(1+\cos^2i)\f$, \f$A_2(t)=2A(t)\cos i\f$, | |
| n angle | | * \f$\Phi(t)=0\f$, and \f$f(t)>0\f$ (i.e.\ \f$\phi(t)\f$ increasing with t | |
| between \f$\mathbf{\hat{l}}\f$ and \f$\mathbf{\hat{z}}\f$. Such a syste | | ime). For | |
| m will | | * precessing systems, prescriptions for \f$\mathbf{\hat{x}}\f$ and | |
| generically have \f$A_1(t)=A(t)(1+\cos^2i)\f$, \f$A_2(t)=2A(t)\cos i\f$, | | * \f$\mathbf{\hat{y}}\f$ become ambiguous, but they \e must be fixed; the | |
| \f$\Phi(t)=0\f$, and \f$f(t)>0\f$ (i.e.\ \f$\phi(t)\f$ increasing with t | | * relations for \f$A_1\f$, \f$A_2\f$, and \f$\Phi\f$ will no longer be mai | |
| ime). For | | ntained.</li> | |
| precessing systems, prescriptions for \f$\mathbf{\hat{x}}\f$ and | | * | |
| \f$\mathbf{\hat{y}}\f$ become ambiguous, but they \e must be fixed; the | | * <li> Appendix B of \cite ABCF2001 defines a convention for | |
| relations for \f$A_1\f$, \f$A_2\f$, and \f$\Phi\f$ will no longer be mai | | * the overal polarization angle \f$\psi\f$: Let \f$\mathbf{\hat{N}}\f$ be | |
| ntained.</li> | | the | |
| | | * direction of the Earth's north celestial pole, and define the | |
| <li> Appendix B of [\ref Anderson_W2000] defines a convention for | | * direction of the <em>ascending node</em> | |
| the overal polarization angle \f$\psi\f$: Let \f$\mathbf{\hat{N}}\f$ be | | * \f$\mathbf{\hat{\Omega}}=|\csc\alpha|\mathbf{\hat{N}}\times\mathbf{\hat{ | |
| the | | z}}\f$, where | |
| direction of the Earth's north celestial pole, and define the | | * \f$\alpha\f$ is the right ascension of the source. Then \f$\psi\f$ is t | |
| direction of the <em>ascending node</em> | | he | |
| \f$\mathbf{\hat{\Omega}}=|\csc\alpha|\mathbf{\hat{N}}\times\mathbf{\hat{ | | * angle, right-handed about \f$\mathbf{\hat{z}}\f$, from \f$\mathbf{\hat{\ | |
| z}}\f$, where | | Omega}}\f$ to | |
| \f$\alpha\f$ is the right ascension of the source. Then \f$\psi\f$ is t | | * \f$\mathbf{\hat{x}}\f$.</li> | |
| he | | * | |
| angle, right-handed about \f$\mathbf{\hat{z}}\f$, from \f$\mathbf{\hat{\ | | * <li> The direction of propagation of the wave is defined by the right | |
| Omega}}\f$ to | | * ascension \f$\alpha\f$ and declination \f$\delta\f$ of the \e source, as | |
| \f$\mathbf{\hat{x}}\f$.</li> | | * seen from the point of measurement. See \ref SkyCoordinates_h for a | |
| | | * definition of these quantities. We expect that these will be | |
| <li> The direction of propagation of the wave is defined by the right | | * effectively constant for almost any gravitational wave source of | |
| ascension \f$\alpha\f$ and declination \f$\delta\f$ of the \e source, as | | * interest.</li> | |
| seen from the point of measurement. See \ref SkyCoordinates_h for a | | * </ol> | |
| definition of these quantities. We expect that these will be | | * | |
| effectively constant for almost any gravitational wave source of | | * \par The polarization response: | |
| interest.</li> | | * The relative strain induced in | |
| </ol> | | * the test masses of a detector by a passing gravitational wave depends | |
| | | * not only on the amplitudes \f$h_{+,\times}\f$ of the gravitational wave, | |
| \heading{The polarization response:} The relative strain induced in | | * but also on the design of the detector and its orientation with | |
| the test masses of a detector by a passing gravitational wave depends | | * relative to the \f$x\f$-\f$y\f$ coordinate system used to define the + a | |
| not only on the amplitudes \f$h_{+,\times}\f$ of the gravitational wave, | | nd | |
| but also on the design of the detector and its orientation with | | * \f$\times\f$ polarizations. For a given detector, the response to each | |
| relative to the \f$x\f$-\f$y\f$ coordinate system used to define the + a | | * polarization thus depends on the right ascension \f$\alpha\f$, declinati | |
| nd | | on | |
| \f$\times\f$ polarizations. For a given detector, the response to each | | * \f$\delta\f$, and polarization angle \f$\psi\f$ of the source (which def | |
| polarization thus depends on the right ascension \f$\alpha\f$, declinati | | ine | |
| on | | * the orientation of the + and \f$\times\f$ polarization axes relative to | |
| \f$\delta\f$, and polarization angle \f$\psi\f$ of the source (which def | | * the Earth), and on the time \f$t\f$ (which determines the orientation of | |
| ine | | * the detector as the Earth rotates). The strain \f$h(t)\f$ induced in th | |
| the orientation of the + and \f$\times\f$ polarization axes relative to | | e | |
| the Earth), and on the time \f$t\f$ (which determines the orientation of | | * detector is thus given by two polarization response functions | |
| the detector as the Earth rotates). The strain \f$h(t)\f$ induced in th | | * \f$F_{+,\times}(\alpha,\delta,\psi;t)\f$ by: | |
| e | | * \f[ | |
| detector is thus given by two polarization response functions | | * h(t) = h_+(t)F_+(\alpha,\delta,\psi;t) + | |
| \f$F_{+,\times}(\alpha,\delta,\psi;t)\f$ by: | | * h_\times(t)F_\times(\alpha,\delta,\psi;t) \; . | |
| \f[ | | * \f] | |
| h(t) = h_+(t)F_+(\alpha,\delta,\psi;t) + | | * We will not discuss the computation of these functions \f$F_{+,\times}\f | |
| h_\times(t)F_\times(\alpha,\delta,\psi;t) \; . | | $, | |
| \f] | | * as these are covered under the header \ref DetResponse_h. | |
| We will not discuss the computation of these functions \f$F_{+,\times}\f | | * | |
| $, | | * \par The transfer function: | |
| as these are covered under the header \ref DetResponse_h. | | * All gravitational wave detectors | |
| | | * incorporate a set of analog and digital filters that convert a | |
| \heading{The transfer function:} All gravitational wave detectors | | * gravitational excitation on the test masses into a measurable output | |
| incorporate a set of analog and digital filters that convert a | | * time series. The effects of these functions are aggregated into a | |
| gravitational excitation on the test masses into a measurable output | | * complex-valued <em>transfer function</em> \f${\cal T}(f)\f$, which gives | |
| time series. The effects of these functions are aggregated into a | | the | |
| complex-valued <em>transfer function</em> \f${\cal T}(f)\f$, which gives | | * instrumental response (in units of "counts" from an | |
| the | | * analog\f$\rightarrow\f$digital converter) to gravitational waves of unit | |
| instrumental response (in units of "counts" from an | | * amplitued at the frequency \f$f\f$. Specifically, if the strain exerted | |
| analog\f$\rightarrow\f$digital converter) to gravitational waves of unit | | * on the antenna is given by \f$h(t)=\mathrm{Re}[{\cal H}e^{2\pi ift}]\f$ | |
| amplitued at the frequency \f$f\f$. Specifically, if the strain exerted | | * (where the complex amplitude \f$\cal H\f$ includes the phase of the wave | |
| on the antenna is given by \f$h(t)=\mathrm{Re}[{\cal H}e^{2\pi ift}]\f$ | | ), | |
| (where the complex amplitude \f$\cal H\f$ includes the phase of the wave | | * then the ADC output of the instrument is given by: | |
| ), | | * \f[ | |
| then the ADC output of the instrument is given by: | | * o(t) = \mathrm{Re}\left[ {\cal T}(f) {\cal H}e^{2\pi ift} \right] \; . | |
| \f[ | | * \f] | |
| o(t) = \mathrm{Re}\left[ {\cal T}(f) {\cal H}e^{2\pi ift} \right] \; . | | * The transfer function has a strong frequency dependence in order to | |
| \f] | | * "whiten" the highly-coloured instrumental noise, and thus preserve | |
| The transfer function has a strong frequency dependence in order to | | * instrumental sensitivity across a broad band of frequencies. | |
| "whiten" the highly-coloured instrumental noise, and thus preserve | | * | |
| instrumental sensitivity across a broad band of frequencies. | | * We note that although the transfer function measures the response of | |
| | | * the instrument to a gravitational wave, the term <em>response | |
| We note that although the transfer function measures the response of | | * function</em> refers to inverse transformation of taking an instrumental | |
| the instrument to a gravitational wave, the term <em>response | | * response and computing a gravitational waveform; that is, \f${\cal | |
| function</em> refers to inverse transformation of taking an instrumental | | * R}(f)=1/{\cal T}(f)\f$. This confusing bit of nomenclature arises from | |
| response and computing a gravitational waveform; that is, \f${\cal | | * the fact that most data analysis deals with extracting gravitational | |
| R}(f)=1/{\cal T}(f)\f$. This confusing bit of nomenclature arises from | | * waveforms from the instrumental output, rather than injecting | |
| the fact that most data analysis deals with extracting gravitational | | * waveforms into the output. | |
| waveforms from the instrumental output, rather than injecting | | * | |
| waveforms into the output. | | * For quasiperiodic waveforms with a well-defined instantaneous | |
| | | * frequency \f$f(t)\f$ and phase \f$\phi(t)\f$, we can compute the respons | |
| For quasiperiodic waveforms with a well-defined instantaneous | | e of | |
| frequency \f$f(t)\f$ and phase \f$\phi(t)\f$, we can compute the respons | | * the instrument entirely in the time domain in the adiabatic limit: if | |
| e of | | * our instrumental excitation is a linear superposition of waveforms | |
| the instrument entirely in the time domain in the adiabatic limit: if | | * \f$h(t)=\mathrm{Re}[{\cal H}(t)e^{i\phi(t)}]\f$, then the output is a | |
| our instrumental excitation is a linear superposition of waveforms | | * superposition of waves of the form | |
| \f$h(t)=\mathrm{Re}[{\cal H}(t)e^{i\phi(t)}]\f$, then the output is a | | * \f[ | |
| superposition of waves of the form | | * o(t) \approx \mathrm{Re}\left[ {\cal T}\{f(t)\} | |
| \f[ | | * {\cal H}(t)e^{i\phi(t)} \right] \; . | |
| o(t) \approx \mathrm{Re}\left[ {\cal T}\{f(t)\} | | * \f] | |
| {\cal H}(t)e^{i\phi(t)} \right] \; . | | * This expression is approximate to the extent that \f${\cal T}(f)\f$ vari | |
| \f] | | es | |
| This expression is approximate to the extent that \f${\cal T}(f)\f$ vari | | * over the range \f$f\pm1/\tau\f$, where \f$\tau\f$ is the evolution times | |
| es | | cale | |
| over the range \f$f\pm1/\tau\f$, where \f$\tau\f$ is the evolution times | | * of \f${\cal H}(t)\f$ and \f$f(t)\f$. Since the transfer function and | |
| cale | | * polarization response (above) are linear operators, we can apply them | |
| of \f${\cal H}(t)\f$ and \f$f(t)\f$. Since the transfer function and | | * in either order. | |
| polarization response (above) are linear operators, we can apply them | | * | |
| in either order. | | * \par A note on terminology: | |
| | | * We use the word "coherent" in the | |
| \heading{A note on terminology:} We use the word "coherent" in the | | * name of this header in the loosest possible sense, refering to any | |
| name of this header in the loosest possible sense, refering to any | | * wave with a well-defined direction of propagation, whose wave | |
| wave with a well-defined direction of propagation, whose wave | | * amplitudes \f$h_{+,\times}\f$ are deterministic functions of retarded | |
| amplitudes \f$h_{+,\times}\f$ are deterministic functions of retarded | | * time. Given a knowledge of these parameters, such a waveform is | |
| time. Given a knowledge of these parameters, such a waveform is | | * amenable to "coherent" detection in a network of detectors, through | |
| amenable to "coherent" detection in a network of detectors, through | | * time-shifted matched filtering. | |
| time-shifted matched filtering. | | * | |
| | | * However, coherence is often used to refer to a more restricted class | |
| However, coherence is often used to refer to a more restricted class | | * of waveforms that are "effectively monochromatic" over some | |
| of waveforms that are "effectively monochromatic" over some | | * coherence timescale \f$t_\mathrm{coh}\f$; i.e.\ in any timespan | |
| coherence timescale \f$t_\mathrm{coh}\f$; i.e.\ in any timespan | | * \f$t_\mathrm{coh}\f$ there is a fixed-frequency sinusoid that is never | |
| \f$t_\mathrm{coh}\f$ there is a fixed-frequency sinusoid that is never | | * more than \f$90^\circ\f$ out of phase with the waveform. This is more | |
| more than \f$90^\circ\f$ out of phase with the waveform. This is more | | * retrictive even than our concept of quasiperiodic waves; for | |
| retrictive even than our concept of quasiperiodic waves; for | | * smoothly-varying waveforms one has \f$t_\mathrm{coh}\sim\dot{f}^{-1/2}\f | |
| smoothly-varying waveforms one has \f$t_\mathrm{coh}\sim\dot{f}^{-1/2}\f | | $, | |
| $, | | * which is much shorter than the evolution timescale \f$\tau\sim | |
| which is much shorter than the evolution timescale \f$\tau\sim | | * f/\dot{f}\f$ (provided \f$\tau\gg1/f\f$, as we have assumed). | |
| f/\dot{f}\f$ (provided \f$\tau\gg1/f\f$, as we have assumed). | | * | |
| | | */ | |
| */ | | | |
| | | | |
| /* This structure stores a representation of a plane | | /* This structure stores a representation of a plane | |
| * gravitational wave propagating from a particular point on the sky. | | * gravitational wave propagating from a particular point on the sky. | |
| * Several alternate representations are permitted to allow a more | | * Several alternate representations are permitted to allow a more | |
| * natural characterization of quasiperiodic waveforms. | | * natural characterization of quasiperiodic waveforms. | |
| * | | * | |
| * \note It is permissible to set only some of the | | * \note It is permissible to set only some of the | |
| * \c REAL4TimeSeries or \c REAL4TimeVectorSeries fields above, | | * \c REAL4TimeSeries or \c REAL4TimeVectorSeries fields above, | |
| * but the waveform is treated as being zero except during those times | | * but the waveform is treated as being zero except during those times | |
| * when either \c h, or both \c a and \c phi, are defined. | | * when either \c h, or both \c a and \c phi, are defined. | |
| * Where \c shift is not specified, it is assumed that \f$\Phi\f$ is | | * Where \c shift is not specified, it is assumed that \f$\Phi\f$ is | |
| * zero; where \c f is not specified but \c phi is, \f$f(t)\f$ can be | | * zero; where \c f is not specified but \c phi is, \f$f(t)\f$ can be | |
| * computed as \f$\dot{\phi}(t)/2\pi\f$. Where \c f and \c phi | | * computed as \f$\dot{\phi}(t)/2\pi\f$. Where \c f and \c phi | |
| * overlap, or where \c h and any other time series overlap, they | | * overlap, or where \c h and any other time series overlap, they | |
| * must be defined consistently. | | * must be defined consistently. | |
| * | | * | |
| */ | | */ | |
| typedef struct tagCoherentGW { | | typedef struct tagCoherentGW { | |
| SkyPosition position; /*< The location of the source in the sky; this
should be in equatorial celestial coordinates, but routines may be able to
do the conversion */ | | SkyPosition position; /*< The location of the source in the sky; this
should be in equatorial celestial coordinates, but routines may be able to
do the conversion */ | |
|
| REAL4 psi; /*< The polarization angle \f$\psi\f$, in radia
ns, as defined in Appendix B of [\ref Anderson_W2000] */ | | REAL4 psi; /*< The polarization angle \f$\psi\f$, in radia
ns, as defined in Appendix B of \cite ABCF2001 */ | |
| REAL4TimeVectorSeries *h; /*< A time-sampled two-dimensional vector stori
ng the waveforms \f$h_+(t)\f$ and \f$h_\times(t)\f$, in dimensionless strai
n */ | | REAL4TimeVectorSeries *h; /*< A time-sampled two-dimensional vector stori
ng the waveforms \f$h_+(t)\f$ and \f$h_\times(t)\f$, in dimensionless strai
n */ | |
| REAL4TimeVectorSeries *a; /*< A time-sampled two-dimensional vector stori
ng the amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, in dimensionless strain */ | | REAL4TimeVectorSeries *a; /*< A time-sampled two-dimensional vector stori
ng the amplitudes \f$A_1(t)\f$ and \f$A_2(t)\f$, in dimensionless strain */ | |
| REAL4TimeSeries *f; /*< A time-sampled sequence storing the instant
aneous frequency \f$f(t)\f$, in Hz. */ | | REAL4TimeSeries *f; /*< A time-sampled sequence storing the instant
aneous frequency \f$f(t)\f$, in Hz. */ | |
| REAL8TimeSeries *phi; /*< A time-sampled sequence storing the phase f
unction \f$\phi(t)\f$, in radians */ | | REAL8TimeSeries *phi; /*< A time-sampled sequence storing the phase f
unction \f$\phi(t)\f$, in radians */ | |
| REAL4TimeSeries *shift; /*< A time-sampled sequence storing the polariz
ation shift \f$\Phi(t)\f$, in radians */ | | REAL4TimeSeries *shift; /*< A time-sampled sequence storing the polariz
ation shift \f$\Phi(t)\f$, in radians */ | |
| UINT4 dtDelayBy2; /*< A user specified half-interval time step fo
r the Doppler delay look-up table (will default to 400s if set to 0) */ | | UINT4 dtDelayBy2; /*< A user specified half-interval time step fo
r the Doppler delay look-up table (will default to 400s if set to 0) */ | |
| UINT4 dtPolBy2; /*< A user defined half-interval time step for
the polarisation response look-up table (will default to 300s if set to 0)
*/ | | UINT4 dtPolBy2; /*< A user defined half-interval time step for
the polarisation response look-up table (will default to 300s if set to 0)
*/ | |
| } CoherentGW; | | } CoherentGW; | |
| | | | |
| /* This structure contains information required to determine the response | | /* This structure contains information required to determine the response | |
| | | | |
End of changes. 2 change blocks. |
| 264 lines changed or deleted | | 263 lines changed or added | |
|
| StreamInput.h | | StreamInput.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| #define _STREAMINPUT_H | | #define _STREAMINPUT_H | |
| | | | |
| #include <lal/LALStdlib.h> | | #include <lal/LALStdlib.h> | |
| #include <lal/Grid.h> | | #include <lal/Grid.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
|
| \addtogroup StreamInput_h | | * \addtogroup StreamInput_h | |
| \author Creighton, T. D. | | * \author Creighton, T. D. | |
| | | * | |
| \brief Provides routines to read data from an open stream and store it i | | * \brief Provides routines to read data from an open stream and store it i | |
| n LAL data structures. | | n LAL data structures. | |
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| \code | | * | |
| #include "StreamInput.h" | | * \code | |
| \endcode | | * #include "StreamInput.h" | |
| | | * \endcode | |
| This header provides prototypes for routines that construct | | * | |
| LAL data structures using the data from a file (or other I/O) stream. | | * This header provides prototypes for routines that construct | |
| The routines do not provide a system-level interface to create files | | * LAL data structures using the data from a file (or other I/O) stream. | |
| and open or close file streams; they simply assume that they have been | | * The routines do not provide a system-level interface to create files | |
| passed an open, readable stream. Nonetheless, because they involve | | * and open or close file streams; they simply assume that they have been | |
| I/O stream manipulation, these routines are placed in the | | * passed an open, readable stream. Nonetheless, because they involve | |
| \c lalsupport library rather than in \c lal proper. | | * I/O stream manipulation, these routines are placed in the | |
| | | * \c lalsupport library rather than in \c lal proper. | |
| The routines in \ref StreamVectorInput_c and | | * | |
| \ref StreamVectorSequenceInput_c are compartmentalized in such a way | | * The routines in \ref StreamVectorInput_c and | |
| that they can easily be converted if the LAL specification later | | * \ref StreamVectorSequenceInput_c are compartmentalized in such a way | |
| changes the way in which I/O streams are handled. In partucular, the | | * that they can easily be converted if the LAL specification later | |
| only file I/O commands used are <tt>fgets()</tt> and <tt>feof()</tt>. | | * changes the way in which I/O streams are handled. In partucular, the | |
| Thus the upgrade would involve only the following global changes: | | * only file I/O commands used are <tt>fgets()</tt> and <tt>feof()</tt>. | |
| <ol> | | * Thus the upgrade would involve only the following global changes: | |
| <li> Replace all occurrences of <tt>FILE *</tt> with the name of the | | * <ol> | |
| LAL I/O stream pointer type.</li> | | * <li> Replace all occurrences of <tt>FILE *</tt> with the name of the | |
| <li> Replace all occurrences of <tt>fgets()</tt> and <tt>feof()</tt> with | | * LAL I/O stream pointer type.</li> | |
| equivalent LAL functions.</li> | | * <li> Replace all occurrences of <tt>fgets()</tt> and <tt>feof()</tt> wit | |
| </ol> | | h | |
| In particular, there is no need to translate routines such as | | * equivalent LAL functions.</li> | |
| <tt>fscanf()</tt>; one should simply read data into a LAL | | * </ol> | |
| \c CHARVector and then use <tt>sscanf()</tt> to format the input. | | * In particular, there is no need to translate routines such as | |
| This is the approach used in the numerical input routines in | | * <tt>fscanf()</tt>; one should simply read data into a LAL | |
| \ref StreamVectorInput_c and \ref StreamVectorSequenceInput_c. | | * \c CHARVector and then use <tt>sscanf()</tt> to format the input. | |
| | | * This is the approach used in the numerical input routines in | |
| The routines in \ref StreamSequenceInput_c are less robust but much | | * \ref StreamVectorInput_c and \ref StreamVectorSequenceInput_c. | |
| more efficient: they use <tt>fscanf()</tt> to parse the input stream | | * | |
| directly. They are intended primarily for test programs that may need | | * The routines in \ref StreamSequenceInput_c are less robust but much | |
| to read large datafiles of undetermined length. The routines in | | * more efficient: they use <tt>fscanf()</tt> to parse the input stream | |
| \ref StreamSeriesInput_c and \ref StreamGridInput_c also parse the | | * directly. They are intended primarily for test programs that may need | |
| input stream directly using <tt>fscanf()</tt>, to avoid potentially | | * to read large datafiles of undetermined length. The routines in | |
| crippling computational overhead. | | * \ref StreamSeriesInput_c and \ref StreamGridInput_c also parse the | |
| | | * input stream directly using <tt>fscanf()</tt>, to avoid potentially | |
| */ /*@{*/ | | * crippling computational overhead. | |
| | | * | |
| | | */ | |
| | | /*@{*/ | |
| | | | |
| /** \name Error Codes */ /*@{*/ | | /** \name Error Codes */ /*@{*/ | |
| #define STREAMINPUTH_ENUL 1 /**< Unexpected null pointer in arguments *
/ | | #define STREAMINPUTH_ENUL 1 /**< Unexpected null pointer in arguments *
/ | |
| #define STREAMINPUTH_EOUT 2 /**< Output handle points to a non-null poi
nter */ | | #define STREAMINPUTH_EOUT 2 /**< Output handle points to a non-null poi
nter */ | |
| #define STREAMINPUTH_EMEM 3 /**< Memory allocation error */ | | #define STREAMINPUTH_EMEM 3 /**< Memory allocation error */ | |
| #define STREAMINPUTH_ELEN 4 /**< No numbers were read */ | | #define STREAMINPUTH_ELEN 4 /**< No numbers were read */ | |
| #define STREAMINPUTH_ESLEN 5 /**< Not enough numbers read to fill sequen
ce */ | | #define STREAMINPUTH_ESLEN 5 /**< Not enough numbers read to fill sequen
ce */ | |
| #define STREAMINPUTH_EVLEN 6 /**< Could not determine complex vectorLeng
th */ | | #define STREAMINPUTH_EVLEN 6 /**< Could not determine complex vectorLeng
th */ | |
| #define STREAMINPUTH_EDLEN 7 /**< Dimension lengths inconsistent or not
given */ | | #define STREAMINPUTH_EDLEN 7 /**< Dimension lengths inconsistent or not
given */ | |
| #define STREAMINPUTH_EDIM 8 /**< Inconsistent or non-positive arrayDim
value */ | | #define STREAMINPUTH_EDIM 8 /**< Inconsistent or non-positive arrayDim
value */ | |
| | | | |
| skipping to change at line 105 | | skipping to change at line 107 | |
| #define STREAMINPUTH_MSGESLEN "Not enough numbers read to fill sequence" | | #define STREAMINPUTH_MSGESLEN "Not enough numbers read to fill sequence" | |
| #define STREAMINPUTH_MSGEVLEN "Could not determine complex vectorLength" | | #define STREAMINPUTH_MSGEVLEN "Could not determine complex vectorLength" | |
| #define STREAMINPUTH_MSGEDLEN "Dimension lengths inconsistent or not given" | | #define STREAMINPUTH_MSGEDLEN "Dimension lengths inconsistent or not given" | |
| #define STREAMINPUTH_MSGEDIM "Inconsistent or non-positive arrayDim value" | | #define STREAMINPUTH_MSGEDIM "Inconsistent or non-positive arrayDim value" | |
| #define STREAMINPUTH_MSGEFMT "Badly formatted number" | | #define STREAMINPUTH_MSGEFMT "Badly formatted number" | |
| #define STREAMINPUTH_MSGEBUF "BUFFSIZE not a multiple of largest complex t
ype size" | | #define STREAMINPUTH_MSGEBUF "BUFFSIZE not a multiple of largest complex t
ype size" | |
| | | | |
| /* Function prototypes. */ | | /* Function prototypes. */ | |
| | | | |
| /** | | /** | |
|
| \defgroup StreamVectorInput_c Module StreamVectorInput.c | | * \defgroup StreamVectorInput_c Module StreamVectorInput.c | |
| \ingroup StreamInput_h | | * \ingroup StreamInput_h | |
| \author Creighton, T. D. | | * \author Creighton, T. D. | |
| | | * | |
| \brief Reads data from a single line in an input stream. | | * \brief Reads data from a single line in an input stream. | |
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| These routines read ASCII data from the I/O stream <tt>*stream</tt> | | * These routines read ASCII data from the I/O stream <tt>*stream</tt> | |
| until a newline or the end-of-input is reached. (The line can be of | | * until a newline or the end-of-input is reached. (The line can be of | |
| arbitrary length; the data is temporarily stored in a linked list of | | * arbitrary length; the data is temporarily stored in a linked list of | |
| buffers.) Once read, a LAL vector structure <tt>**vector</tt> is | | * buffers.) Once read, a LAL vector structure <tt>**vector</tt> is | |
| created and the data stored in it. The routine passes back a pointer | | * created and the data stored in it. The routine passes back a pointer | |
| to the new structure. For the numerical routines, the \c strict | | * to the new structure. For the numerical routines, the \c strict | |
| parameter determines whether the routine will do strict error checking | | * parameter determines whether the routine will do strict error checking | |
| based on the contents of the input stream (see below). | | * based on the contents of the input stream (see below). | |
| | | * | |
| The basic routine in this module is <tt>LALCHARReadVector()</tt>, which | | * The basic routine in this module is <tt>LALCHARReadVector()</tt>, which | |
| simply stores bytes read from <tt>*stream</tt> until the next newline | | * simply stores bytes read from <tt>*stream</tt> until the next newline | |
| character <tt>'\n'</tt>, null character <tt>'\0'</tt>, or the end of the | | * character <tt>'\n'</tt>, null character <tt>'\0'</tt>, or the end of the | |
| input as determined by the <tt>feof()</tt> function. The vector | | * input as determined by the <tt>feof()</tt> function. The vector | |
| includes the newline (if present), and also an explicit <tt>'\0'</tt> at | | * includes the newline (if present), and also an explicit <tt>'\0'</tt> at | |
| the end, if one was not already present. This routine should | | * the end, if one was not already present. This routine should | |
| \e not be used to read a binary data stream, which are not | | * \e not be used to read a binary data stream, which are not | |
| logically divided into ``lines''. Unless it aborts due to invalid | | * logically divided into ``lines''. Unless it aborts due to invalid | |
| arguments or failed memory allocation, <tt>LALCHARReadVector()</tt> will | | * arguments or failed memory allocation, <tt>LALCHARReadVector()</tt> will | |
| always return successfully regardless of the contents of the input | | * always return successfully regardless of the contents of the input | |
| stream; <tt>*vector</tt> will created containing at least a single | | * stream; <tt>*vector</tt> will created containing at least a single | |
| <tt>'\0'</tt> terminator, if nothing else. | | * <tt>'\0'</tt> terminator, if nothing else. | |
| | | * | |
| The other routines in this module use <tt>LALCHARReadVector()</tt> to | | * The other routines in this module use <tt>LALCHARReadVector()</tt> to | |
| read a line, and then parse it into numerical datatypes using the | | * read a line, and then parse it into numerical datatypes using the | |
| corresponding routine in the \ref StringConvert.c. | | * corresponding routine in the \ref StringConvert.c. | |
| Conversion stops when the routine encounters a character that cannot | | * Conversion stops when the routine encounters a character that cannot | |
| be parsed as part of a number. If \c strict is 0, the routine | | * be parsed as part of a number. If \c strict is 0, the routine | |
| will fail only due to invalid arguments or memory allocation failure, | | * will fail only due to invalid arguments or memory allocation failure, | |
| not from a poorly-formatted input stream; if no numbers are read, | | * not from a poorly-formatted input stream; if no numbers are read, | |
| <tt>*vector</tt> will remain \c NULL, but no error will be reported. | | * <tt>*vector</tt> will remain \c NULL, but no error will be reported. | |
| (In this mode, the calling routine should always test the output | | * (In this mode, the calling routine should always test the output | |
| before trying to dereference it, in order to avoid segmentation | | * before trying to dereference it, in order to avoid segmentation | |
| violations.) If \c strict is nonzero, the routine will report an | | * violations.) If \c strict is nonzero, the routine will report an | |
| error if the input stream was poorly formatted, either an \c ELEN | | * error if the input stream was poorly formatted, either an \c ELEN | |
| error if no numbers were read, or \c EFMT if a character was | | * error if no numbers were read, or \c EFMT if a character was | |
| encountered that was neither part of a parseable number nor | | * encountered that was neither part of a parseable number nor | |
| whitespace. | | * whitespace. | |
| | | * | |
| Note that \c strict=0 allows an input stream to contain blank | | * Note that \c strict=0 allows an input stream to contain blank | |
| lines or comments. A comment begins with any character that cannot | | * lines or comments. A comment begins with any character that cannot | |
| occur in a valid number, which will cause the numerical parser to skip | | * occur in a valid number, which will cause the numerical parser to skip | |
| the rest of the line. The usual comment delimiters are <tt>'#'</tt> and | | * the rest of the line. The usual comment delimiters are <tt>'#'</tt> and | |
| <tt>'%'</tt>, but any character except <tt>'+'</tt> <tt>'-'</tt>, | | * <tt>'%'</tt>, but any character except <tt>'+'</tt> <tt>'-'</tt>, | |
| <tt>'e'</tt>, <tt>'E'</tt>, <tt>'.'</tt>, digits, and whitespace will work. | | * <tt>'e'</tt>, <tt>'E'</tt>, <tt>'.'</tt>, digits, and whitespace will wo | |
| | | rk. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| void LALCHARReadVector( LALStatus *status, CHARVector **vector, FILE *stre
am ); | | void LALCHARReadVector( LALStatus *status, CHARVector **vector, FILE *stre
am ); | |
| void LALI2ReadVector( LALStatus *status, INT2Vector **vector, FILE *stream
, BOOLEAN strict ); | | void LALI2ReadVector( LALStatus *status, INT2Vector **vector, FILE *stream
, BOOLEAN strict ); | |
| void LALI4ReadVector( LALStatus *status, INT4Vector **vector, FILE *stream
, BOOLEAN strict ); | | void LALI4ReadVector( LALStatus *status, INT4Vector **vector, FILE *stream
, BOOLEAN strict ); | |
| void LALI8ReadVector( LALStatus *status, INT8Vector **vector, FILE *stream
, BOOLEAN strict ); | | void LALI8ReadVector( LALStatus *status, INT8Vector **vector, FILE *stream
, BOOLEAN strict ); | |
| void LALU2ReadVector( LALStatus *status, UINT2Vector **vector, FILE *strea
m, BOOLEAN strict ); | | void LALU2ReadVector( LALStatus *status, UINT2Vector **vector, FILE *strea
m, BOOLEAN strict ); | |
| void LALU4ReadVector( LALStatus *status, UINT4Vector **vector, FILE *strea
m, BOOLEAN strict ); | | void LALU4ReadVector( LALStatus *status, UINT4Vector **vector, FILE *strea
m, BOOLEAN strict ); | |
| void LALU8ReadVector( LALStatus *status, UINT8Vector **vector, FILE *strea
m, BOOLEAN strict ); | | void LALU8ReadVector( LALStatus *status, UINT8Vector **vector, FILE *strea
m, BOOLEAN strict ); | |
| void LALSReadVector( LALStatus *status, REAL4Vector **vector, FILE *stream
, BOOLEAN strict ); | | void LALSReadVector( LALStatus *status, REAL4Vector **vector, FILE *stream
, BOOLEAN strict ); | |
| void LALDReadVector( LALStatus *status, REAL8Vector **vector, FILE *stream
, BOOLEAN strict ); | | void LALDReadVector( LALStatus *status, REAL8Vector **vector, FILE *stream
, BOOLEAN strict ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** | | /** | |
|
| \defgroup StreamVectorSequenceInput_c Module StreamVectorSequenceInput.c | | * \defgroup StreamVectorSequenceInput_c Module StreamVectorSequenceInput.c | |
| \ingroup StreamInput_h | | * \ingroup StreamInput_h | |
| \author Creighton, T. D. | | * \author Creighton, T. D. | |
| | | * | |
| \brief Reads the entire contents of an input stream into a vector sequen | | * \brief Reads the entire contents of an input stream into a vector sequen | |
| ce. | | ce. | |
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| These routines read data from the I/O stream <tt>*stream</tt> until the | | * These routines read data from the I/O stream <tt>*stream</tt> until the | |
| end-of-input is reached. Each line is stored as a data vector, and | | * end-of-input is reached. Each line is stored as a data vector, and | |
| the vectors are combined into a LAL vector sequence structure | | * the vectors are combined into a LAL vector sequence structure | |
| <tt>**sequence</tt>. Each line vector is padded with zeros to match the | | * <tt>**sequence</tt>. Each line vector is padded with zeros to match the | |
| length of the longest line. The routine passes back a pointer to the | | * length of the longest line. The routine passes back a pointer to the | |
| new structure. | | * new structure. | |
| | | * | |
| The routine <tt>LALCHARReadVectorSequence()</tt> essentially stores an | | * The routine <tt>LALCHARReadVectorSequence()</tt> essentially stores an | |
| image of the I/O stream as a sequence of lines padded with <tt>'\0'</tt> | | * image of the I/O stream as a sequence of lines padded with <tt>'\0'</tt> | |
| characters. However, it will skip over any empty lines, which occur, | | * characters. However, it will skip over any empty lines, which occur, | |
| for instance, when the end-of-input or a null character <tt>'\0'</tt> | | * for instance, when the end-of-input or a null character <tt>'\0'</tt> | |
| occurs immediately following a newline character <tt>'\n'</tt>. The | | * occurs immediately following a newline character <tt>'\n'</tt>. The | |
| numeric routines will additionally skip blank lines, comment lines, or | | * numeric routines will additionally skip blank lines, comment lines, or | |
| other input lines that have no parseable numbers in them. (As with | | * other input lines that have no parseable numbers in them. (As with | |
| the routines in \ref StreamVectorInput.c, comment in sindicated by a | | * the routines in \ref StreamVectorInput.c, comment in sindicated by a | |
| <tt>#</tt> sign at the beginning of a line or a <tt>%</tt> sign anywhere | | * <tt>#</tt> sign at the beginning of a line or a <tt>%</tt> sign anywhere | |
| in the line, signifying that the remainder of the line is to be | | * in the line, signifying that the remainder of the line is to be | |
| ignored.) However, if an input line contains \e any parseable | | * ignored.) However, if an input line contains \e any parseable | |
| data, then the corresponding vector in the vector sequence will be | | * data, then the corresponding vector in the vector sequence will be | |
| allocated (and padded with zeros, if it is shorter than the longest | | * allocated (and padded with zeros, if it is shorter than the longest | |
| line). | | * line). | |
| | | * | |
| \heading{Algorithm} | | * ### Algorithm ### | |
| | | * | |
| These functions first create a linked list of vectors, using the | | * These functions first create a linked list of vectors, using the | |
| routines in \ref StreamVectorInput.c to read them in. Once the list | | * routines in \ref StreamVectorInput.c to read them in. Once the list | |
| is complete, the longest vector length is determined, and the vector | | * is complete, the longest vector length is determined, and the vector | |
| sequence is created and filled. | | * sequence is created and filled. | |
| | | * | |
| The numeric routines skip over blank, comment, or otherwise | | * The numeric routines skip over blank, comment, or otherwise | |
| unparseable lines by catching and handling the \c LEN error code | | * unparseable lines by catching and handling the \c LEN error code | |
| generated by the vector input routine. However, it is worth pointing | | * generated by the vector input routine. However, it is worth pointing | |
| out that the vector input routine will have generated an error message | | * out that the vector input routine will have generated an error message | |
| if the error reporting bit in \c lalDebugLevel was set. The | | * if the error reporting bit in \c lalDebugLevel was set. The | |
| vector sequence input routines will therefore generate a followup | | * vector sequence input routines will therefore generate a followup | |
| messages indicating that the preceding error was successfully dealt | | * messages indicating that the preceding error was successfully dealt | |
| with. So you may see pairs of \c ABORT: and \c CONTINUE: | | * with. So you may see pairs of \c ABORT: and \c CONTINUE: | |
| error messages when reading files containing blank or comment lines. | | * error messages when reading files containing blank or comment lines. | |
| | | * | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| void LALCHARReadVectorSequence( LALStatus *status, CHARVectorSequence **se
quence, FILE *stream ); | | void LALCHARReadVectorSequence( LALStatus *status, CHARVectorSequence **se
quence, FILE *stream ); | |
| void LALI2ReadVectorSequence( LALStatus *status, INT2VectorSequence **sequ
ence, FILE *stream ); | | void LALI2ReadVectorSequence( LALStatus *status, INT2VectorSequence **sequ
ence, FILE *stream ); | |
| void LALI4ReadVectorSequence( LALStatus *status, INT4VectorSequence **sequ
ence, FILE *stream ); | | void LALI4ReadVectorSequence( LALStatus *status, INT4VectorSequence **sequ
ence, FILE *stream ); | |
| void LALI8ReadVectorSequence( LALStatus *status, INT8VectorSequence **sequ
ence, FILE *stream ); | | void LALI8ReadVectorSequence( LALStatus *status, INT8VectorSequence **sequ
ence, FILE *stream ); | |
| void LALU2ReadVectorSequence( LALStatus *status, UINT2VectorSequence **seq
uence, FILE *stream ); | | void LALU2ReadVectorSequence( LALStatus *status, UINT2VectorSequence **seq
uence, FILE *stream ); | |
| void LALU4ReadVectorSequence( LALStatus *status, UINT4VectorSequence **seq
uence, FILE *stream ); | | void LALU4ReadVectorSequence( LALStatus *status, UINT4VectorSequence **seq
uence, FILE *stream ); | |
| void LALU8ReadVectorSequence( LALStatus *status, UINT8VectorSequence **seq
uence, FILE *stream ); | | void LALU8ReadVectorSequence( LALStatus *status, UINT8VectorSequence **seq
uence, FILE *stream ); | |
| void LALSReadVectorSequence( LALStatus *status, REAL4VectorSequence **sequ
ence, FILE *stream ); | | void LALSReadVectorSequence( LALStatus *status, REAL4VectorSequence **sequ
ence, FILE *stream ); | |
| void LALDReadVectorSequence( LALStatus *status, REAL8VectorSequence **sequ
ence, FILE *stream ); | | void LALDReadVectorSequence( LALStatus *status, REAL8VectorSequence **sequ
ence, FILE *stream ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
| /** | | /** | |
|
| \defgroup StreamSequenceInput_c Module StreamSequenceInput.c | | * \defgroup StreamSequenceInput_c Module StreamSequenceInput.c | |
| \ingroup StreamInput_h | | * \ingroup StreamInput_h | |
| \author Creighton, T. D. | | * \author Creighton, T. D. | |
| | | * | |
| \brief Converts an input stream into a data sequence. | | * \brief Converts an input stream into a data sequence. | |
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| These routines read data from the I/O stream <tt>*stream</tt> until the | | * These routines read data from the I/O stream <tt>*stream</tt> until the | |
| end-of-input is reached. (The input can be of arbitrary length; the | | * end-of-input is reached. (The input can be of arbitrary length; the | |
| data is temporarily stored in a linked list of buffers.) Once read, a | | * data is temporarily stored in a linked list of buffers.) Once read, a | |
| LAL sequence structure <tt>**sequence</tt> is created and the data | | * LAL sequence structure <tt>**sequence</tt> is created and the data | |
| stored in it. The routine passes back a pointer to the new structure. | | * stored in it. The routine passes back a pointer to the new structure. | |
| | | * | |
| The routine <tt>LALCHARReadSequence()</tt> simply stores the entire | | * The routine <tt>LALCHARReadSequence()</tt> simply stores the entire | |
| remaining contents of the I/O stream in a \c CHARSequence, | | * remaining contents of the I/O stream in a \c CHARSequence, | |
| including whitespace, newline <tt>'\n'</tt>, null <tt>'\0'</tt>, or other | | * including whitespace, newline <tt>'\n'</tt>, null <tt>'\0'</tt>, or othe | |
| special characters. (It can in principle be used to read and store | | r | |
| binary data as a sequence of bytes. Note that the end-of-transmission | | * special characters. (It can in principle be used to read and store | |
| byte <tt>'\004'</tt> does \e not necessarily mark the end-of-input, | | * binary data as a sequence of bytes. Note that the end-of-transmission | |
| which is instead determined using the <tt>feof()</tt> function.) | | * byte <tt>'\004'</tt> does \e not necessarily mark the end-of-input, | |
| | | * which is instead determined using the <tt>feof()</tt> function.) | |
| The other routines in this module interpret the input as a sequence of | | * | |
| whitespace-separated numbers, which are parsed directly from the I/O | | * The other routines in this module interpret the input as a sequence of | |
| stream using <tt>fscanf()</tt>. The sequence is terminated at the | | * whitespace-separated numbers, which are parsed directly from the I/O | |
| end-of-input or at any point where <tt>fscanf()</tt> is unable to parse | | * stream using <tt>fscanf()</tt>. The sequence is terminated at the | |
| the input. | | * end-of-input or at any point where <tt>fscanf()</tt> is unable to parse | |
| | | * the input. | |
| For the complex input routines <tt>LALCReadSequence()</tt> and | | * | |
| <tt>LALZReadSequence()</tt>, each pair of numbers read are interpreted | | * For the complex input routines <tt>LALCReadSequence()</tt> and | |
| as the real and imaginary parts of a complex number. The usual input | | * <tt>LALZReadSequence()</tt>, each pair of numbers read are interpreted | |
| format is for each line to contain a pair of numbers, but | | * as the real and imaginary parts of a complex number. The usual input | |
| <tt>fscanf()</tt> does not distinguish between newline and other | | * format is for each line to contain a pair of numbers, but | |
| whitespace characters, so neither do these routines. | | * <tt>fscanf()</tt> does not distinguish between newline and other | |
| | | * whitespace characters, so neither do these routines. | |
| Unlike the numerical routines in other \ref StreamInput.h modules, | | * | |
| these routines have no mechanism to deal with comments; every | | * Unlike the numerical routines in other \ref StreamInput.h modules, | |
| whitespace-delimited substring will be treated as a number. | | * these routines have no mechanism to deal with comments; every | |
| | | * whitespace-delimited substring will be treated as a number. | |
| \heading{Algorithm} | | * | |
| | | * ### Algorithm ### | |
| These routines read data into a linked list of buffers, to allow | | * | |
| memory allocation to occur in batches for improved efficiency. The | | * These routines read data into a linked list of buffers, to allow | |
| numerical routines also use <tt>fscanf()</tt> directly on the I/O stream | | * memory allocation to occur in batches for improved efficiency. The | |
| to avoid the inefficiency of storing and parsing intermediate | | * numerical routines also use <tt>fscanf()</tt> directly on the I/O stream | |
| character strings, as is done by the corresponding vector sequence | | * to avoid the inefficiency of storing and parsing intermediate | |
| input routines. This reduces robustness and versatility (as | | * character strings, as is done by the corresponding vector sequence | |
| indicated, for instance, by the inability of dealing with comments), | | * input routines. This reduces robustness and versatility (as | |
| and increases the number of potential points-of-failure (by requiring | | * indicated, for instance, by the inability of dealing with comments), | |
| a consistent implementation across platforms of <tt>getc()</tt> and | | * and increases the number of potential points-of-failure (by requiring | |
| <tt>fscanf()</tt>, rather than the single function <tt>fgets()</tt> used | | * a consistent implementation across platforms of <tt>getc()</tt> and | |
| by other stream input routines). However, these sacrifices are | | * <tt>fscanf()</tt>, rather than the single function <tt>fgets()</tt> used | |
| necessary to allow LAL applications to ingest large quantities of | | * by other stream input routines). However, these sacrifices are | |
| numerical data efficiently. | | * necessary to allow LAL applications to ingest large quantities of | |
| | | * numerical data efficiently. | |
| */ | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| int XLALCHARReadSequence( CHARSequence **sequence, FILE *stream ); | | int XLALCHARReadSequence( CHARSequence **sequence, FILE *stream ); | |
| void LALCHARReadSequence( LALStatus *status, CHARSequence **sequence, FILE
*stream ); | | void LALCHARReadSequence( LALStatus *status, CHARSequence **sequence, FILE
*stream ); | |
| void LALI2ReadSequence( LALStatus *status, INT2Sequence **sequence, FILE *s
tream ); | | void LALI2ReadSequence( LALStatus *status, INT2Sequence **sequence, FILE *s
tream ); | |
| void LALI4ReadSequence( LALStatus *status, INT4Sequence **sequence, FILE *s
tream ); | | void LALI4ReadSequence( LALStatus *status, INT4Sequence **sequence, FILE *s
tream ); | |
| void LALI8ReadSequence( LALStatus *status, INT8Sequence **sequence, FILE *s
tream ); | | void LALI8ReadSequence( LALStatus *status, INT8Sequence **sequence, FILE *s
tream ); | |
| void LALU2ReadSequence( LALStatus *status, UINT2Sequence **sequence, FILE *
stream ); | | void LALU2ReadSequence( LALStatus *status, UINT2Sequence **sequence, FILE *
stream ); | |
| void LALU4ReadSequence( LALStatus *status, UINT4Sequence **sequence, FILE *
stream ); | | void LALU4ReadSequence( LALStatus *status, UINT4Sequence **sequence, FILE *
stream ); | |
| void LALU8ReadSequence( LALStatus *status, UINT8Sequence **sequence, FILE *
stream ); | | void LALU8ReadSequence( LALStatus *status, UINT8Sequence **sequence, FILE *
stream ); | |
| void LALSReadSequence( LALStatus *status, REAL4Sequence **sequence, FILE *s
tream ); | | void LALSReadSequence( LALStatus *status, REAL4Sequence **sequence, FILE *s
tream ); | |
| | | | |
End of changes. 4 change blocks. |
| 205 lines changed or deleted | | 210 lines changed or added | |
|
| TimeFreqFFT.h | | TimeFreqFFT.h | |
| | | | |
| skipping to change at line 39 | | skipping to change at line 39 | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * \addtogroup TimeFreqFFT_h | | * \addtogroup TimeFreqFFT_h | |
| * | | * | |
| * \brief Performs real-to-complex, complex-to-real FFTs and average power
spectrum estimation. | | * \brief Performs real-to-complex, complex-to-real FFTs and average power
spectrum estimation. | |
| * | | * | |
|
| * \heading{Synopsis} | | * ### Synopsis ### | |
| | | * | |
| * \code | | * \code | |
| * #include <lal/TimeFreqFFT.h> | | * #include <lal/TimeFreqFFT.h> | |
| * \endcode | | * \endcode | |
| * | | * | |
| * Perform time-to-frequency and frequency-to-time fast Fourier | | * Perform time-to-frequency and frequency-to-time fast Fourier | |
| * transforms. Also provides a function to compute mean and median power | | * transforms. Also provides a function to compute mean and median power | |
| * spectra with user specified windowning. | | * spectra with user specified windowning. | |
| * | | * | |
| * The definition of the Fourier transform is \f$ e^{2 \pi i f t} \f$ | | * The definition of the Fourier transform is \f$ e^{2 \pi i f t} \f$ | |
| * and the inline equation version of that is | | * and the inline equation version of that is | |
| * \f[ | | * \f[ | |
|
| * \tilde{h}_k = \sum | | * \tilde{h}_k = \sum | |
| * \f] | | * \f] | |
| * | | * | |
|
| * | | * ### Description ### | |
| * \heading{Description} | | | |
| * | | * | |
| * The routines LALTimeFreqRealFFT() and LALTimeFreqComplexFFT() | | * The routines LALTimeFreqRealFFT() and LALTimeFreqComplexFFT() | |
| * transform time series \f$h_j\f$, \f$0\le j<n\f$, into a frequency series | | * transform time series \f$h_j\f$, \f$0\le j<n\f$, into a frequency series | |
| * \f$\tilde{h}_k\f$. For LALTimeFreqRealFFT(), | | * \f$\tilde{h}_k\f$. For LALTimeFreqRealFFT(), | |
| * \f[ | | * \f[ | |
|
| * \tilde{h}_k = \Delta t \times H_k \; | | * \tilde{h}_k = \Delta t \times H_k \; | |
| * \mbox{for } 0\le k\le\lfloor n/2\rfloor | | * \mbox{for } 0\le k\le\lfloor n/2\rfloor | |
| * \f] | | * \f] | |
| * The packing covers the range from dc (inclusive) to Nyquist (inclusive i
f | | * The packing covers the range from dc (inclusive) to Nyquist (inclusive i
f | |
| * \f$n\f$ is even). | | * \f$n\f$ is even). | |
| * For LALTimeFreqComplexFFT(), | | * For LALTimeFreqComplexFFT(), | |
| * \f[ | | * \f[ | |
|
| * \tilde{h}_k = \Delta t \left\{ | | * \tilde{h}_k = \Delta t \left\{ | |
| * \begin{array}{ll} | | * \begin{array}{ll} | |
| * H_{k+\lfloor(n+1)/2\rfloor} & | | * H_{k+\lfloor(n+1)/2\rfloor} & | |
| * \mbox{for } 0\le k<\lfloor n/2\rfloor, \\ | | * \mbox{for } 0\le k<\lfloor n/2\rfloor, \\ | |
| * H_{k-\lfloor n/2\rfloor} & | | * H_{k-\lfloor n/2\rfloor} & | |
| * \mbox{for } \lfloor n/2\rfloor\le k<n. \\ | | * \mbox{for } \lfloor n/2\rfloor\le k<n. \\ | |
| * \end{array} | | * \end{array} | |
| * \right. | | * \right. | |
| * \f] | | * \f] | |
| * The packing covers the range from negative Nyquist (inclusive if \f$n\f$
is | | * The packing covers the range from negative Nyquist (inclusive if \f$n\f$
is | |
| * even) up to (but not including) positive Nyquist. | | * even) up to (but not including) positive Nyquist. | |
| * Here \f$H_k\f$ is the DFT of \f$h_j\f$: | | * Here \f$H_k\f$ is the DFT of \f$h_j\f$: | |
| * \f[ | | * \f[ | |
|
| * H_k = \sum_{j=0}^{n-1} h_j e^{-2\pi ijk/n}. | | * H_k = \sum_{j=0}^{n-1} h_j e^{-2\pi ijk/n}. | |
| * \f] | | * \f] | |
| * The units of \f$\tilde{h}_k\f$ are equal to the units of \f$h_j\f$ times
seconds. | | * The units of \f$\tilde{h}_k\f$ are equal to the units of \f$h_j\f$ times
seconds. | |
| * | | * | |
| * The routines LALFreqTimeRealFFT() and LALFreqTimeComplexFFT() | | * The routines LALFreqTimeRealFFT() and LALFreqTimeComplexFFT() | |
| * perform the inverse transforms from \f$\tilde{h}_k\f$ back to \f$h_j\f$.
This is | | * perform the inverse transforms from \f$\tilde{h}_k\f$ back to \f$h_j\f$.
This is | |
| * done by shuffling the data, performing the reverse DFT, and multiplying
by | | * done by shuffling the data, performing the reverse DFT, and multiplying
by | |
| * \f$\Delta f\f$. | | * \f$\Delta f\f$. | |
| * | | * | |
| * The routine LALREAL4AverageSpectrum() uses Welch's method to compute | | * The routine LALREAL4AverageSpectrum() uses Welch's method to compute | |
| * the average power spectrum of the time series stored in the input struct
ure | | * the average power spectrum of the time series stored in the input struct
ure | |
| | | | |
| skipping to change at line 121 | | skipping to change at line 121 | |
| * The PSD of each segment is obtained. The Welch PSD estimate is the avera
ge | | * The PSD of each segment is obtained. The Welch PSD estimate is the avera
ge | |
| * of these \f$i\f$ sub-estimates. The average is computed using the mean
or | | * of these \f$i\f$ sub-estimates. The average is computed using the mean
or | |
| * median method, as specified in the parameter structure. | | * median method, as specified in the parameter structure. | |
| * | | * | |
| * Note: the return PSD estimate is a one-sided power spectral density | | * Note: the return PSD estimate is a one-sided power spectral density | |
| * normalized as defined in the conventions document. When the averaging | | * normalized as defined in the conventions document. When the averaging | |
| * method is choosen to be mean and the window type Hann, the result is the | | * method is choosen to be mean and the window type Hann, the result is the | |
| * same as returned by the LDAS datacondAPI <tt>psd()</tt> action for a rea
l | | * same as returned by the LDAS datacondAPI <tt>psd()</tt> action for a rea
l | |
| * sequence without detrending. | | * sequence without detrending. | |
| * | | * | |
|
| * \heading{Operating Instructions} | | * ### Operating Instructions ### | |
| * | | * | |
| * \code | | * \code | |
| * const UINT4 n = 65536; | | * const UINT4 n = 65536; | |
| * const REAL4 dt = 1.0 / 16384.0; | | * const REAL4 dt = 1.0 / 16384.0; | |
| * static LALStatus status; compute average power spectrum | | * static LALStatus status; compute average power spectrum | |
| * static REAL4TimeSeries x; | | * static REAL4TimeSeries x; | |
| * static COMPLEX8FrequencySeries X; | | * static COMPLEX8FrequencySeries X; | |
| * static COMPLEX8TimeSeries z; | | * static COMPLEX8TimeSeries z; | |
| * static COMPLEX8FrequencySeries Z; | | * static COMPLEX8FrequencySeries Z; | |
| * RealFFTPlan *fwdRealPlan = NULL; | | * RealFFTPlan *fwdRealPlan = NULL; | |
| | | | |
| skipping to change at line 172 | | skipping to change at line 172 | |
| * LALDestroyRealFFTPlan( &status, &fwdRealPlan ); | | * LALDestroyRealFFTPlan( &status, &fwdRealPlan ); | |
| * LALDestroyRealFFTPlan( &status, &revRealPlan ); | | * LALDestroyRealFFTPlan( &status, &revRealPlan ); | |
| * LALDestroyComplexFFTPlan( &status, &fwdComplexPlan ); | | * LALDestroyComplexFFTPlan( &status, &fwdComplexPlan ); | |
| * LALDestroyComplexFFTPlan( &status, &revComplexPlan ); | | * LALDestroyComplexFFTPlan( &status, &revComplexPlan ); | |
| * LALCDestroyVector( &status, &Z.data ); | | * LALCDestroyVector( &status, &Z.data ); | |
| * LALCDestroyVector( &status, &z.data ); | | * LALCDestroyVector( &status, &z.data ); | |
| * LALCDestroyVector( &status, &X.data ); | | * LALCDestroyVector( &status, &X.data ); | |
| * LALSDestroyVector( &status, &x.data ); | | * LALSDestroyVector( &status, &x.data ); | |
| * \endcode | | * \endcode | |
| * | | * | |
|
| * \heading{Notes} | | * ### Notes ### | |
| * | | * | |
| * <ol> | | * <ol> | |
| * <li> The routines do not presently work properly with heterodyned data, | | * <li> The routines do not presently work properly with heterodyned data, | |
| * i.e., the original time series data should have \c f0 equal to zero. | | * i.e., the original time series data should have \c f0 equal to zero. | |
| * </li></ol> | | * </li></ol> | |
| * | | * | |
|
| * | | */ | |
| * | | | |
| */ | | | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /**\name Error Codes */ | | /**\name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define TIMEFREQFFTH_ENULL 1 /**< Null pointer */ | | #define TIMEFREQFFTH_ENULL 1 /**< Null pointer */ | |
| #define TIMEFREQFFTH_ESIZE 2 /**< Invalid size */ | | #define TIMEFREQFFTH_ESIZE 2 /**< Invalid size */ | |
| #define TIMEFREQFFTH_ERATE 4 /**< Invalid rate */ | | #define TIMEFREQFFTH_ERATE 4 /**< Invalid rate */ | |
| #define TIMEFREQFFTH_ESIGN 4 /**< Incorrect plan sign */ | | #define TIMEFREQFFTH_ESIGN 4 /**< Incorrect plan sign */ | |
| #define TIMEFREQFFTH_EALLOC 16 /**< Pointer has already been allocated, sho
uld be null */ | | #define TIMEFREQFFTH_EALLOC 16 /**< Pointer has already been allocated, sho
uld be null */ | |
| #define TIMEFREQFFTH_EPOSARG 32 /**< Argument must be positive */ | | #define TIMEFREQFFTH_EPOSARG 32 /**< Argument must be positive */ | |
| | | | |
| skipping to change at line 217 | | skipping to change at line 215 | |
| #define TIMEFREQFFTH_MSGEPOSARG "Argument must be positive" | | #define TIMEFREQFFTH_MSGEPOSARG "Argument must be positive" | |
| #define TIMEFREQFFTH_MSGEMALLOC "Malloc failure" | | #define TIMEFREQFFTH_MSGEMALLOC "Malloc failure" | |
| #define TIMEFREQFFTH_MSGEINCOMP "Incompatible arguments" | | #define TIMEFREQFFTH_MSGEINCOMP "Incompatible arguments" | |
| #define TIMEFREQFFTH_MSGENNUL "Non-null pointer" | | #define TIMEFREQFFTH_MSGENNUL "Non-null pointer" | |
| #define TIMEFREQFFTH_MSGEZSEG "Segment length is zero" | | #define TIMEFREQFFTH_MSGEZSEG "Segment length is zero" | |
| #define TIMEFREQFFTH_MSGEZOVR "Overlap length is zero" | | #define TIMEFREQFFTH_MSGEZOVR "Overlap length is zero" | |
| #define TIMEFREQFFTH_MSGEMISM "Mismatch beteen segment, overlap and data le
ngth" | | #define TIMEFREQFFTH_MSGEMISM "Mismatch beteen segment, overlap and data le
ngth" | |
| #define TIMEFREQFFTH_MSGEUAVG "Unknown average power spectum method" | | #define TIMEFREQFFTH_MSGEUAVG "Unknown average power spectum method" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** This type determines the method the type of average that will be used t | | /** | |
| o | | * This type determines the method the type of average that will be used to | |
| * compute the power sperum estimate by the LALREAL4AverageSpectrum() | | * compute the power sperum estimate by the LALREAL4AverageSpectrum() | |
| * function. The function computes a series of (possibly overlapping) power | | * function. The function computes a series of (possibly overlapping) power | |
| * spectra and computes the average using one of the following methods. | | * spectra and computes the average using one of the following methods. | |
| */ | | */ | |
| typedef enum | | typedef enum | |
| { | | { | |
| useUnity, /**< A constant PSD of value unity will be returned independ
ent of the input data given; this is used for testing purposes */ | | useUnity, /**< A constant PSD of value unity will be returned independ
ent of the input data given; this is used for testing purposes */ | |
| useMean, /**< The arithmetic mean of the individual power spectra com
puted will be used to compute the output power spectrum */ | | useMean, /**< The arithmetic mean of the individual power spectra com
puted will be used to compute the output power spectrum */ | |
| useMedian, /**< The median value of the individual power spectra comput
ed will be used to compute the output power spectrum */ | | useMedian, /**< The median value of the individual power spectra comput
ed will be used to compute the output power spectrum */ | |
| NumberAvgSpecMethods /**< gives the number of defined methods */ | | NumberAvgSpecMethods /**< gives the number of defined methods */ | |
| } | | } | |
| AvgSpecMethod; | | AvgSpecMethod; | |
| | | | |
|
| /** This structure controls the behaviour of the LALREAL4AverageSpectrum() | | /** | |
| function. | | * This structure controls the behaviour of the LALREAL4AverageSpectrum() f | |
| | | unction. | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagAverageSpectrumParams | | tagAverageSpectrumParams | |
| { | | { | |
| REAL4Window *window; /**< The windowing function to use w
hen computing the individual power spectra from the input time series. | | REAL4Window *window; /**< The windowing function to use w
hen computing the individual power spectra from the input time series. | |
| * The input time series is broken into sma
ller time series to compute power spectra | | * The input time series is broken into sma
ller time series to compute power spectra | |
| * for the estimate. The length of these ti
me series is determined by the \c length parameter of the window vector. | | * for the estimate. The length of these ti
me series is determined by the \c length parameter of the window vector. | |
| */ | | */ | |
| UINT4 overlap; /**< The overlap between sucessive time se
ries used to compute the power spectra. */ | | UINT4 overlap; /**< The overlap between sucessive time se
ries used to compute the power spectra. */ | |
| AvgSpecMethod method; /**< The method of computing the ave
rage as describe under ::AvgSpecMethod */ | | AvgSpecMethod method; /**< The method of computing the ave
rage as describe under ::AvgSpecMethod */ | |
| | | | |
End of changes. 11 change blocks. |
| 24 lines changed or deleted | | 23 lines changed or added | |
|
| TimeSeries.h | | TimeSeries.h | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 32 | |
| | | | |
| #include <stddef.h> | | #include <stddef.h> | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| extern "C" { | | extern "C" { | |
| #elif 0 | | #elif 0 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
|
| /** \addtogroup TimeSeriesManipulation | | /** | |
| \author Kipp Cannon <kipp@gravity.phys.uwm.edu> | | * \addtogroup TimeSeriesManipulation | |
| | | * \author Kipp Cannon <kipp@gravity.phys.uwm.edu> | |
| \brief This is a suite of functions for creating, destroying, and manipulat | | * | |
| ing LAL | | * \brief This is a suite of functions for creating, destroying, and manipu | |
| time series. One pair of functions (the XLAL version and its LAL | | lating LAL | |
| counterpart) is available for each method and series type. For example | | * time series. One pair of functions (the XLAL version and its LAL | |
| <tt>XLALCreateREAL4TimeSeries()</tt> is available for creating time series | | * counterpart) is available for each method and series type. For example | |
| of \c REAL4 data, and the LAL-stype wrapper | | * <tt>XLALCreateREAL4TimeSeries()</tt> is available for creating time seri | |
| <tt>LALCreateREAL4TimeSeries()</tt> is provided which is equivalent to the | | es | |
| XLAL version in all respects except that it adheres to the LAL calling | | * of \c REAL4 data, and the LAL-stype wrapper | |
| conventions (eg.\ it takes a \c LALStatus pointer as its first | | * <tt>LALCreateREAL4TimeSeries()</tt> is provided which is equivalent to t | |
| argument, its return type is \c void, etc.). | | he | |
| | | * XLAL version in all respects except that it adheres to the LAL calling | |
| */ | | * conventions (eg.\ it takes a \c LALStatus pointer as its first | |
| /*@{*/ | | * argument, its return type is \c void, etc.). | |
| | | * | |
| /** \name Creation Functions | | */ | |
| | | /*@{*/ | |
| \heading{Synopsis} | | | |
| | | /** | |
| \code | | * \name Creation Functions | |
| #include <lal/TimeSeries.h> | | * | |
| | | * ### Synopsis ### | |
| XLALCreate<timeseriestype>() | | * | |
| LALCreate<timeseriestype>() | | * \code | |
| \endcode | | * #include <lal/TimeSeries.h> | |
| | | * | |
| \heading{Description} | | * XLALCreate<timeseriestype>() | |
| | | * LALCreate<timeseriestype>() | |
| These functions create LAL frequency series. An XLAL function returns a | | * \endcode | |
| pointer to the newly created series or \c NULL on failure. The LAL | | * | |
| counterpart accepts the address of a pointer which it fills with the | | * ### Description ### | |
| address of the newly created series or \c NULL on failure. | | * | |
| Additionally, the LAL wrapper provides standard LAL-style error checking | | * These functions create LAL frequency series. An XLAL function returns a | |
| via a \c LALStatus pointer. | | * pointer to the newly created series or \c NULL on failure. The LAL | |
| */ | | * counterpart accepts the address of a pointer which it fills with the | |
| | | * address of the newly created series or \c NULL on failure. | |
| | | * Additionally, the LAL wrapper provides standard LAL-style error checking | |
| | | * via a \c LALStatus pointer. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8TimeSeries *XLALCreateCOMPLEX8TimeSeries ( const CHAR *name, const
LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, siz
e_t length ); | | COMPLEX8TimeSeries *XLALCreateCOMPLEX8TimeSeries ( const CHAR *name, const
LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, siz
e_t length ); | |
| COMPLEX16TimeSeries *XLALCreateCOMPLEX16TimeSeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, s
ize_t length ); | | COMPLEX16TimeSeries *XLALCreateCOMPLEX16TimeSeries ( const CHAR *name, cons
t LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, s
ize_t length ); | |
| REAL4TimeSeries *XLALCreateREAL4TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | | REAL4TimeSeries *XLALCreateREAL4TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | |
| REAL8TimeSeries *XLALCreateREAL8TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | | REAL8TimeSeries *XLALCreateREAL8TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | |
| INT2TimeSeries *XLALCreateINT2TimeSeries ( const CHAR *name, const LIGOTime
GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng
th ); | | INT2TimeSeries *XLALCreateINT2TimeSeries ( const CHAR *name, const LIGOTime
GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng
th ); | |
| INT4TimeSeries *XLALCreateINT4TimeSeries ( const CHAR *name, const LIGOTime
GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng
th ); | | INT4TimeSeries *XLALCreateINT4TimeSeries ( const CHAR *name, const LIGOTime
GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng
th ); | |
| INT8TimeSeries *XLALCreateINT8TimeSeries ( const CHAR *name, const LIGOTime
GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng
th ); | | INT8TimeSeries *XLALCreateINT8TimeSeries ( const CHAR *name, const LIGOTime
GPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t leng
th ); | |
| UINT2TimeSeries *XLALCreateUINT2TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | | UINT2TimeSeries *XLALCreateUINT2TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | |
| UINT4TimeSeries *XLALCreateUINT4TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | | UINT4TimeSeries *XLALCreateUINT4TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | |
| UINT8TimeSeries *XLALCreateUINT8TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | | UINT8TimeSeries *XLALCreateUINT8TimeSeries ( const CHAR *name, const LIGOTi
meGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t le
ngth ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Destruction Functions | | /** | |
| | | * \name Destruction Functions | |
| \heading{Synopsis} | | * | |
| \code | | * ### Synopsis ### | |
| #include <lal/TimeSeries.h> | | * | |
| | | * \code | |
| XLALDestroy<timeseriestype>() | | * #include <lal/TimeSeries.h> | |
| LALDestroy<timeseriestype>() | | * | |
| \endcode | | * XLALDestroy<timeseriestype>() | |
| | | * LALDestroy<timeseriestype>() | |
| \heading{Description} | | * \endcode | |
| | | * | |
| These functions free all memory associated with a LAL time series. It is | | * ### Description ### | |
| safe to pass \c NULL to these functions. | | * | |
| | | * These functions free all memory associated with a LAL time series. It i | |
| */ | | s | |
| | | * safe to pass \c NULL to these functions. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| void XLALDestroyCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *series ); | | void XLALDestroyCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *series ); | |
| void XLALDestroyCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *series ); | | void XLALDestroyCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *series ); | |
| void XLALDestroyREAL4TimeSeries ( REAL4TimeSeries *series ); | | void XLALDestroyREAL4TimeSeries ( REAL4TimeSeries *series ); | |
| void XLALDestroyREAL8TimeSeries ( REAL8TimeSeries *series ); | | void XLALDestroyREAL8TimeSeries ( REAL8TimeSeries *series ); | |
| void XLALDestroyINT2TimeSeries ( INT2TimeSeries *series ); | | void XLALDestroyINT2TimeSeries ( INT2TimeSeries *series ); | |
| void XLALDestroyINT4TimeSeries ( INT4TimeSeries *series ); | | void XLALDestroyINT4TimeSeries ( INT4TimeSeries *series ); | |
| void XLALDestroyINT8TimeSeries ( INT8TimeSeries *series ); | | void XLALDestroyINT8TimeSeries ( INT8TimeSeries *series ); | |
| void XLALDestroyUINT2TimeSeries ( UINT2TimeSeries *series ); | | void XLALDestroyUINT2TimeSeries ( UINT2TimeSeries *series ); | |
| void XLALDestroyUINT4TimeSeries ( UINT4TimeSeries *series ); | | void XLALDestroyUINT4TimeSeries ( UINT4TimeSeries *series ); | |
| void XLALDestroyUINT8TimeSeries ( UINT8TimeSeries *series ); | | void XLALDestroyUINT8TimeSeries ( UINT8TimeSeries *series ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Cutting Functions | | /** | |
| | | * \name Cutting Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/TimeSeries.h> | | * \code | |
| | | * #include <lal/TimeSeries.h> | |
| XLALCut<timeseriestype>() | | * | |
| LALCut<timeseriestype>() | | * XLALCut<timeseriestype>() | |
| \endcode | | * LALCut<timeseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions create a new time series by extracting a section of an | | * | |
| existing time series. | | * These functions create a new time series by extracting a section of an | |
| */ | | * existing time series. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8TimeSeries *XLALCutCOMPLEX8TimeSeries ( const COMPLEX8TimeSeries *s
eries, size_t first, size_t length ); | | COMPLEX8TimeSeries *XLALCutCOMPLEX8TimeSeries ( const COMPLEX8TimeSeries *s
eries, size_t first, size_t length ); | |
| COMPLEX16TimeSeries *XLALCutCOMPLEX16TimeSeries ( const COMPLEX16TimeSeries
*series, size_t first, size_t length ); | | COMPLEX16TimeSeries *XLALCutCOMPLEX16TimeSeries ( const COMPLEX16TimeSeries
*series, size_t first, size_t length ); | |
| REAL4TimeSeries *XLALCutREAL4TimeSeries ( const REAL4TimeSeries *series, si
ze_t first, size_t length ); | | REAL4TimeSeries *XLALCutREAL4TimeSeries ( const REAL4TimeSeries *series, si
ze_t first, size_t length ); | |
| REAL8TimeSeries *XLALCutREAL8TimeSeries ( const REAL8TimeSeries *series, si
ze_t first, size_t length ); | | REAL8TimeSeries *XLALCutREAL8TimeSeries ( const REAL8TimeSeries *series, si
ze_t first, size_t length ); | |
| INT2TimeSeries *XLALCutINT2TimeSeries ( const INT2TimeSeries *series, size_
t first, size_t length ); | | INT2TimeSeries *XLALCutINT2TimeSeries ( const INT2TimeSeries *series, size_
t first, size_t length ); | |
| INT4TimeSeries *XLALCutINT4TimeSeries ( const INT4TimeSeries *series, size_
t first, size_t length ); | | INT4TimeSeries *XLALCutINT4TimeSeries ( const INT4TimeSeries *series, size_
t first, size_t length ); | |
| INT8TimeSeries *XLALCutINT8TimeSeries ( const INT8TimeSeries *series, size_
t first, size_t length ); | | INT8TimeSeries *XLALCutINT8TimeSeries ( const INT8TimeSeries *series, size_
t first, size_t length ); | |
| UINT2TimeSeries *XLALCutUINT2TimeSeries ( const UINT2TimeSeries *series, si
ze_t first, size_t length ); | | UINT2TimeSeries *XLALCutUINT2TimeSeries ( const UINT2TimeSeries *series, si
ze_t first, size_t length ); | |
| UINT4TimeSeries *XLALCutUINT4TimeSeries ( const UINT4TimeSeries *series, si
ze_t first, size_t length ); | | UINT4TimeSeries *XLALCutUINT4TimeSeries ( const UINT4TimeSeries *series, si
ze_t first, size_t length ); | |
| UINT8TimeSeries *XLALCutUINT8TimeSeries ( const UINT8TimeSeries *series, si
ze_t first, size_t length ); | | UINT8TimeSeries *XLALCutUINT8TimeSeries ( const UINT8TimeSeries *series, si
ze_t first, size_t length ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Resizing Functions | | /** | |
| | | * \name Resizing Functions | |
| \heading{Synopsis} | | * | |
| | | * ### Synopsis ### | |
| \code | | * | |
| #include <lal/TimeSeries.h> | | * \code | |
| | | * #include <lal/TimeSeries.h> | |
| XLALResize<timeseriestype>() | | * | |
| LALResize<timeseriestype>() | | * XLALResize<timeseriestype>() | |
| XLALShrink<timeseriestype>() | | * LALResize<timeseriestype>() | |
| LALShrink<timeseriestype>() | | * XLALShrink<timeseriestype>() | |
| \endcode | | * LALShrink<timeseriestype>() | |
| | | * \endcode | |
| \heading{Description} | | * | |
| | | * ### Description ### | |
| These functions resize an existing time series. The new time series will | | * | |
| have the given length, and its contents will consist of that part of the | | * These functions resize an existing time series. The new time series wil | |
| original time series that started at sample first. If first is negative, | | l | |
| then the new time series is padded at the start by that many samples. The | | * have the given length, and its contents will consist of that part of the | |
| time series' epoch is adjusted appropriately. | | * original time series that started at sample first. If first is negative | |
| */ | | , | |
| | | * then the new time series is padded at the start by that many samples. T | |
| | | he | |
| | | * time series' epoch is adjusted appropriately. | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8TimeSeries *XLALResizeCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *seri
es, int first, size_t length ); | | COMPLEX8TimeSeries *XLALResizeCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *seri
es, int first, size_t length ); | |
| COMPLEX16TimeSeries *XLALResizeCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *s
eries, int first, size_t length ); | | COMPLEX16TimeSeries *XLALResizeCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *s
eries, int first, size_t length ); | |
| REAL4TimeSeries *XLALResizeREAL4TimeSeries ( REAL4TimeSeries *series, int f
irst, size_t length ); | | REAL4TimeSeries *XLALResizeREAL4TimeSeries ( REAL4TimeSeries *series, int f
irst, size_t length ); | |
| REAL8TimeSeries *XLALResizeREAL8TimeSeries ( REAL8TimeSeries *series, int f
irst, size_t length ); | | REAL8TimeSeries *XLALResizeREAL8TimeSeries ( REAL8TimeSeries *series, int f
irst, size_t length ); | |
| INT2TimeSeries *XLALResizeINT2TimeSeries ( INT2TimeSeries *series, int firs
t, size_t length ); | | INT2TimeSeries *XLALResizeINT2TimeSeries ( INT2TimeSeries *series, int firs
t, size_t length ); | |
| INT4TimeSeries *XLALResizeINT4TimeSeries ( INT4TimeSeries *series, int firs
t, size_t length ); | | INT4TimeSeries *XLALResizeINT4TimeSeries ( INT4TimeSeries *series, int firs
t, size_t length ); | |
| INT8TimeSeries *XLALResizeINT8TimeSeries ( INT8TimeSeries *series, int firs
t, size_t length ); | | INT8TimeSeries *XLALResizeINT8TimeSeries ( INT8TimeSeries *series, int firs
t, size_t length ); | |
| UINT2TimeSeries *XLALResizeUINT2TimeSeries ( UINT2TimeSeries *series, int f
irst, size_t length ); | | UINT2TimeSeries *XLALResizeUINT2TimeSeries ( UINT2TimeSeries *series, int f
irst, size_t length ); | |
| UINT4TimeSeries *XLALResizeUINT4TimeSeries ( UINT4TimeSeries *series, int f
irst, size_t length ); | | UINT4TimeSeries *XLALResizeUINT4TimeSeries ( UINT4TimeSeries *series, int f
irst, size_t length ); | |
| | | | |
| skipping to change at line 184 | | skipping to change at line 190 | |
| REAL4TimeSeries *XLALShrinkREAL4TimeSeries ( REAL4TimeSeries *series, size_
t first, size_t length ); | | REAL4TimeSeries *XLALShrinkREAL4TimeSeries ( REAL4TimeSeries *series, size_
t first, size_t length ); | |
| REAL8TimeSeries *XLALShrinkREAL8TimeSeries ( REAL8TimeSeries *series, size_
t first, size_t length ); | | REAL8TimeSeries *XLALShrinkREAL8TimeSeries ( REAL8TimeSeries *series, size_
t first, size_t length ); | |
| INT2TimeSeries *XLALShrinkINT2TimeSeries ( INT2TimeSeries *series, size_t f
irst, size_t length ); | | INT2TimeSeries *XLALShrinkINT2TimeSeries ( INT2TimeSeries *series, size_t f
irst, size_t length ); | |
| INT4TimeSeries *XLALShrinkINT4TimeSeries ( INT4TimeSeries *series, size_t f
irst, size_t length ); | | INT4TimeSeries *XLALShrinkINT4TimeSeries ( INT4TimeSeries *series, size_t f
irst, size_t length ); | |
| INT8TimeSeries *XLALShrinkINT8TimeSeries ( INT8TimeSeries *series, size_t f
irst, size_t length ); | | INT8TimeSeries *XLALShrinkINT8TimeSeries ( INT8TimeSeries *series, size_t f
irst, size_t length ); | |
| UINT2TimeSeries *XLALShrinkUINT2TimeSeries ( UINT2TimeSeries *series, size_
t first, size_t length ); | | UINT2TimeSeries *XLALShrinkUINT2TimeSeries ( UINT2TimeSeries *series, size_
t first, size_t length ); | |
| UINT4TimeSeries *XLALShrinkUINT4TimeSeries ( UINT4TimeSeries *series, size_
t first, size_t length ); | | UINT4TimeSeries *XLALShrinkUINT4TimeSeries ( UINT4TimeSeries *series, size_
t first, size_t length ); | |
| UINT8TimeSeries *XLALShrinkUINT8TimeSeries ( UINT8TimeSeries *series, size_
t first, size_t length ); | | UINT8TimeSeries *XLALShrinkUINT8TimeSeries ( UINT8TimeSeries *series, size_
t first, size_t length ); | |
| /*@}*/ | | /*@}*/ | |
| | | | |
|
| /** \name Addition Functions | | /** | |
| | | * \name Addition Functions | |
| \heading{Synopsis} | | * | |
| \code | | * ### Synopsis ### | |
| #include <lal/TimeSeries.h> | | * | |
| | | * \code | |
| XLALAdd<timeseriestype>() | | * #include <lal/TimeSeries.h> | |
| \endcode | | * | |
| | | * XLALAdd<timeseriestype>() | |
| \heading{Description} | | * \endcode | |
| | | * | |
| These functions add the second argument to the first argument, returning a | | * ### Description ### | |
| pointer to the first argument on success or NULL on failure. The two | | * | |
| series must have the same heterodyne frequency and time resolution, and | | * These functions add the second argument to the first argument, returning | |
| have units that differ only by a dimensionless factor. | | a | |
| | | * pointer to the first argument on success or NULL on failure. The two | |
| */ | | * series must have the same heterodyne frequency and time resolution, and | |
| | | * have units that differ only by a dimensionless factor. | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| COMPLEX8TimeSeries *XLALAddCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *arg1, c
onst COMPLEX8TimeSeries *arg2 ); | | COMPLEX8TimeSeries *XLALAddCOMPLEX8TimeSeries ( COMPLEX8TimeSeries *arg1, c
onst COMPLEX8TimeSeries *arg2 ); | |
| COMPLEX16TimeSeries *XLALAddCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *arg1
, const COMPLEX16TimeSeries *arg2 ); | | COMPLEX16TimeSeries *XLALAddCOMPLEX16TimeSeries ( COMPLEX16TimeSeries *arg1
, const COMPLEX16TimeSeries *arg2 ); | |
| REAL4TimeSeries *XLALAddREAL4TimeSeries ( REAL4TimeSeries *arg1, const REAL
4TimeSeries *arg2 ); | | REAL4TimeSeries *XLALAddREAL4TimeSeries ( REAL4TimeSeries *arg1, const REAL
4TimeSeries *arg2 ); | |
| REAL8TimeSeries *XLALAddREAL8TimeSeries ( REAL8TimeSeries *arg1, const REAL
8TimeSeries *arg2 ); | | REAL8TimeSeries *XLALAddREAL8TimeSeries ( REAL8TimeSeries *arg1, const REAL
8TimeSeries *arg2 ); | |
| INT2TimeSeries *XLALAddINT2TimeSeries ( INT2TimeSeries *arg1, const INT2Tim
eSeries *arg2 ); | | INT2TimeSeries *XLALAddINT2TimeSeries ( INT2TimeSeries *arg1, const INT2Tim
eSeries *arg2 ); | |
| INT4TimeSeries *XLALAddINT4TimeSeries ( INT4TimeSeries *arg1, const INT4Tim
eSeries *arg2 ); | | INT4TimeSeries *XLALAddINT4TimeSeries ( INT4TimeSeries *arg1, const INT4Tim
eSeries *arg2 ); | |
| INT8TimeSeries *XLALAddINT8TimeSeries ( INT8TimeSeries *arg1, const INT8Tim
eSeries *arg2 ); | | INT8TimeSeries *XLALAddINT8TimeSeries ( INT8TimeSeries *arg1, const INT8Tim
eSeries *arg2 ); | |
| UINT2TimeSeries *XLALAddUINT2TimeSeries ( UINT2TimeSeries *arg1, const UINT
2TimeSeries *arg2 ); | | UINT2TimeSeries *XLALAddUINT2TimeSeries ( UINT2TimeSeries *arg1, const UINT
2TimeSeries *arg2 ); | |
| UINT4TimeSeries *XLALAddUINT4TimeSeries ( UINT4TimeSeries *arg1, const UINT
4TimeSeries *arg2 ); | | UINT4TimeSeries *XLALAddUINT4TimeSeries ( UINT4TimeSeries *arg1, const UINT
4TimeSeries *arg2 ); | |
| | | | |
End of changes. 5 change blocks. |
| 107 lines changed or deleted | | 122 lines changed or added | |
|
| Units.h | | Units.h | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| | | | |
| #ifndef _UNITS_H | | #ifndef _UNITS_H | |
| #define _UNITS_H | | #define _UNITS_H | |
| | | | |
| #include <lal/LALStdlib.h> | | #include <lal/LALStdlib.h> | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
|
| /** \addtogroup Units_h | | /** | |
| \author J. T. Whelan <john.whelan@ligo.org> | | * \addtogroup Units_h | |
| | | * \author J. T. Whelan <john.whelan@ligo.org> | |
| \brief Provides prototypes for manipulation of units and declares | | * | |
| \c extern constants for the basic and derived SI units. | | * \brief Provides prototypes for manipulation of units and declares | |
| | | * \c extern constants for the basic and derived SI units. | |
| \heading{Synopsis} | | * | |
| \code | | * ### Synopsis ### | |
| #include <lal/Units.h> | | * | |
| \endcode | | * \code | |
| | | * #include <lal/Units.h> | |
| This header provides prototypes for functions to manipulate | | * \endcode | |
| the \c LALUnit structure. It also defines \c extern | | * | |
| constants for a set of predefined units, which are designed to make | | * This header provides prototypes for functions to manipulate | |
| the structure easier to use. For instance, to determine whether a | | * the \c LALUnit structure. It also defines \c extern | |
| quantity has units of strain per root hertz, one constructs the unit | | * constants for a set of predefined units, which are designed to make | |
| "strain per root hertz" from the predefined \c lalStrainUnit and | | * the structure easier to use. For instance, to determine whether a | |
| \c lalHertzUnit constant structures using the | | * quantity has units of strain per root hertz, one constructs the unit | |
| LALUnitRaise() and LALUnitMultiply() functions, then | | * "strain per root hertz" from the predefined \c lalStrainUnit a | |
| compares that to the unit structure in question using the | | nd | |
| LALUnitCompare() function. | | * \c lalHertzUnit constant structures using the | |
| | | * LALUnitRaise() and LALUnitMultiply() functions, then | |
| The LALUnit datatype itself is included in the header | | * compares that to the unit structure in question using the | |
| \ref LALDatatypes.h, and defines a unit in terms of an integer | | * LALUnitCompare() function. | |
| power of ten multiplier along with rational powers of the basic SI | | * | |
| units (meters, kilograms, seconds, Amperes, and Kelvins) and two | | * The LALUnit datatype itself is included in the header | |
| custom units (strain and ADC counts). | | * \ref LALDatatypes.h, and defines a unit in terms of an integer | |
| | | * power of ten multiplier along with rational powers of the basic SI | |
| \heading{XLAL interface to Units.h functions} | | * units (meters, kilograms, seconds, Amperes, and Kelvins) and two | |
| | | * custom units (strain and ADC counts). | |
| XLALUnitAsString() converts a ::LALUnit structure into a character | | * | |
| string of maximum length \c length (including NUL termination) | | * ### XLAL interface to Units.h functions ### | |
| representation of the units. The inverse function, XLALParseUnitString() | | * | |
| parses a character string to produce a \c LALUnit structure; if | | * XLALUnitAsString() converts a ::LALUnit structure into a character | |
| \c output is \c NULL, memory for the output is allocated. If the input | | * string of maximum length \c length (including NUL termination) | |
| \c string is \c NULL or is empty then the output units are | | * representation of the units. The inverse function, XLALParseUnitString( | |
| dimensionless: lalDimensionlessUnit. | | ) | |
| | | * parses a character string to produce a \c LALUnit structure; if | |
| XLALUnitNormalize() puts a ::LALUnit structure into normal form | | * \c output is \c NULL, memory for the output is allocated. If the input | |
| by simplifying all unit exponent fractions to their simplest form. | | * \c string is \c NULL or is empty then the output units are | |
| | | * dimensionless: lalDimensionlessUnit. | |
| XLALUnitCompare() compares two ::LALUnit structures: they are the | | * | |
| same if their normal forms are identical. | | * XLALUnitNormalize() puts a ::LALUnit structure into normal form | |
| | | * by simplifying all unit exponent fractions to their simplest form. | |
| XLALUnitMultiply() multiplies two ::LALUnit structures. The result | | * | |
| is put into normal form. | | * XLALUnitCompare() compares two ::LALUnit structures: they are the | |
| | | * same if their normal forms are identical. | |
| XLALUnitRaiseRAT4() raises a ::LALUnit structure to a rational | | * | |
| power given by the ::RAT4 structure \c power. | | * XLALUnitMultiply() multiplies two ::LALUnit structures. The result | |
| XLALUnitRaiseINT2() raises a ::LALUnit structure to an integer | | * is put into normal form. | |
| power \c power. | | * | |
| XLALUnitSquare() produces the square of a ::LALUnit structure. | | * XLALUnitRaiseRAT4() raises a ::LALUnit structure to a rational | |
| XLALUnitSqrt() produces the square-root of a ::LALUnit structure. | | * power given by the ::RAT4 structure \c power. | |
| | | * XLALUnitRaiseINT2() raises a ::LALUnit structure to an integer | |
| \heading{Return Values} | | * power \c power. | |
| | | * XLALUnitSquare() produces the square of a ::LALUnit structure. | |
| XLALUnitAsString() returns the pointer to the input \c string, which | | * XLALUnitSqrt() produces the square-root of a ::LALUnit structure. | |
| is populated with the unit string if successful. If there is a failure, | | * | |
| XLALUnitAsString() returns a \c NULL pointer and \c ::xlalErrno | | * ### Return Values ### | |
| is set to one of the following values: \c #XLAL_EFAULT if one of the | | * | |
| input pointers is \c NULL or \c #XLAL_EBADLEN if the length of the | | * XLALUnitAsString() returns the pointer to the input \c string, which | |
| string is insufficent for the unit string. | | * is populated with the unit string if successful. If there is a failure, | |
| | | * XLALUnitAsString() returns a \c NULL pointer and \c ::xlalErrno | |
| XLALParseUnitString() returns the pointer \c output upon return | | * is set to one of the following values: \c #XLAL_EFAULT if one of the | |
| or a pointer to newly allocated memory if \c output was \c NULL; | | * input pointers is \c NULL or \c #XLAL_EBADLEN if the length of the | |
| on failure, \c XLALParseUnitString returns \c NULL and sets | | * string is insufficent for the unit string. | |
| \c ::xlalErrno to one of the following values: \c #XLAL_ENOMEM | | * | |
| if the routine was unable to allocate memory for the output or | | * XLALParseUnitString() returns the pointer \c output upon return | |
| \c #XLAL_EFAILED if the routine was unable to parse the unit string. | | * or a pointer to newly allocated memory if \c output was \c NULL; | |
| | | * on failure, \c XLALParseUnitString returns \c NULL and sets | |
| XLALUnitNormalize() returns 0 upon success or \c #XLAL_FAILURE | | * \c ::xlalErrno to one of the following values: \c #XLAL_ENOMEM | |
| if the input pointer is \c NULL, in which case \c xlalErrno | | * if the routine was unable to allocate memory for the output or | |
| is set to \c #XLAL_EFAULT | | * \c #XLAL_EFAILED if the routine was unable to parse the unit string. | |
| | | * | |
| XLALUnitCompare() returns 0 if the the normal form of the two unit | | * XLALUnitNormalize() returns 0 upon success or \c #XLAL_FAILURE | |
| structures are the same or \> 0 if they are different. It returns | | * if the input pointer is \c NULL, in which case \c xlalErrno | |
| \c #XLAL_FAILURE and \c ::xlalErrno is set to \c #XLAL_EFAULT if | | * is set to \c #XLAL_EFAULT | |
| one of the input pointers is \c NULL. | | * | |
| | | * XLALUnitCompare() returns 0 if the the normal form of the two unit | |
| XLALUnitMultiply(), XLALUnitRaiseRAT4(), XLALUnitRaiseINT2(), XLALUnitSquar | | * structures are the same or \> 0 if they are different. It returns | |
| e() and | | * \c #XLAL_FAILURE and \c ::xlalErrno is set to \c #XLAL_EFAULT if | |
| XLALUnitSqrt() all return a pointer to the output unit structure | | * one of the input pointers is \c NULL. | |
| \c output upon success or \c NULL upon failure. If there is | | * | |
| a failure, \c ::xlalErrno is set to one of the following values: | | * XLALUnitMultiply(), XLALUnitRaiseRAT4(), XLALUnitRaiseINT2(), XLALUnitSq | |
| \c #XLAL_EFAULT if one of the input pointers is \c NULL, | | uare() and | |
| \c #XLAL_ERANGE if one of the unit powers exceeds the allowed range, | | * XLALUnitSqrt() all return a pointer to the output unit structure | |
| or \c #XLAL_EINVAL (for the raise functions only) if the unit power | | * \c output upon success or \c NULL upon failure. If there is | |
| would not be an integer. | | * a failure, \c ::xlalErrno is set to one of the following values: | |
| | | * \c #XLAL_EFAULT if one of the input pointers is \c NULL, | |
| @{ | | * \c #XLAL_ERANGE if one of the unit powers exceeds the allowed range, | |
| \defgroup UnitDefs_c Module UnitDefs.c | | * or \c #XLAL_EINVAL (for the raise functions only) if the unit power | |
| \defgroup UnitNormalize_c Module UnitNormalize.c | | * would not be an integer. | |
| \defgroup UnitRaise_c Module UnitRaise.c | | * | |
| \defgroup UnitMultiply_c Module UnitMultiply.c | | * @{ | |
| \defgroup UnitCompare_c Module UnitCompare.c | | * \defgroup UnitDefs_c Module UnitDefs.c | |
| @} | | * \defgroup UnitNormalize_c Module UnitNormalize.c | |
| */ | | * \defgroup UnitRaise_c Module UnitRaise.c | |
| | | * \defgroup UnitMultiply_c Module UnitMultiply.c | |
| | | * \defgroup UnitCompare_c Module UnitCompare.c | |
| | | * @} | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /** \name Error Codes */ | | /** \name Error Codes */ | |
| /*@{*/ | | /*@{*/ | |
| #define UNITSH_ENULLPIN 1 /**< Null pointer to input */ | | #define UNITSH_ENULLPIN 1 /**< Null pointer to input */ | |
| #define UNITSH_ENULLPOUT 2 /**< Null pointer to output */ | | #define UNITSH_ENULLPOUT 2 /**< Null pointer to output */ | |
| #define UNITSH_ENULLPD 3 /**< Null pointer to data member of
vector */ | | #define UNITSH_ENULLPD 3 /**< Null pointer to data member of
vector */ | |
| #define UNITSH_ENULLPPARAM 4 /**< Null pointer to parameters */ | | #define UNITSH_ENULLPPARAM 4 /**< Null pointer to parameters */ | |
| #define UNITSH_ESTRINGSIZE 5 /**< Output string too short */ | | #define UNITSH_ESTRINGSIZE 5 /**< Output string too short */ | |
| #define UNITSH_EOVERFLOW 6 /**< Exponent outside of (U)INT2 bou
nds */ | | #define UNITSH_EOVERFLOW 6 /**< Exponent outside of (U)INT2 bou
nds */ | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 152 | |
| #define UNITSH_MSGENULLPIN "Null pointer to input" | | #define UNITSH_MSGENULLPIN "Null pointer to input" | |
| #define UNITSH_MSGENULLPOUT "Null pointer to output" | | #define UNITSH_MSGENULLPOUT "Null pointer to output" | |
| #define UNITSH_MSGENULLPD "Null pointer to data member of vector" | | #define UNITSH_MSGENULLPD "Null pointer to data member of vector" | |
| #define UNITSH_MSGENULLPPARAM "Null pointer to parameters" | | #define UNITSH_MSGENULLPPARAM "Null pointer to parameters" | |
| #define UNITSH_MSGESTRINGSIZE "Output string too short" | | #define UNITSH_MSGESTRINGSIZE "Output string too short" | |
| #define UNITSH_MSGEOVERFLOW "Exponent outside of (U)INT2 bounds" | | #define UNITSH_MSGEOVERFLOW "Exponent outside of (U)INT2 bounds" | |
| #define UNITSH_MSGENONINT "Non-integer power of ten" | | #define UNITSH_MSGENONINT "Non-integer power of ten" | |
| #define UNITSH_MSGEPARSE "Error parsing unit string" | | #define UNITSH_MSGEPARSE "Error parsing unit string" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** A four-byte rational number, used as a parameter structure for | | /** | |
| | | * A four-byte rational number, used as a parameter structure for | |
| * LALUnitRaise(). | | * LALUnitRaise(). | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagRAT4 | | tagRAT4 | |
| { | | { | |
| INT2 numerator; /**< The numerator */ | | INT2 numerator; /**< The numerator */ | |
| UINT2 denominatorMinusOne; /**< One less than the denominator */ | | UINT2 denominatorMinusOne; /**< One less than the denominator */ | |
| } RAT4; | | } RAT4; | |
| | | | |
|
| /** Consists of a pair of unit structures; used as an input structure for | | /** | |
| | | * Consists of a pair of unit structures; used as an input structure for | |
| * the LALUnitCompare() and LALUnitMultiply() functions. | | * the LALUnitCompare() and LALUnitMultiply() functions. | |
| */ | | */ | |
| typedef struct | | typedef struct | |
| tagLALUnitPair | | tagLALUnitPair | |
| { | | { | |
| const LALUnit *unitOne; /**< The first unit */ | | const LALUnit *unitOne; /**< The first unit */ | |
| const LALUnit *unitTwo; /**< The second unit */ | | const LALUnit *unitTwo; /**< The second unit */ | |
| } | | } | |
| LALUnitPair; | | LALUnitPair; | |
| | | | |
| | | | |
End of changes. 3 change blocks. |
| 99 lines changed or deleted | | 105 lines changed or added | |
|
| UserInput.h | | UserInput.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| | | | |
| #ifdef __cplusplus /* C++ protection. */ | | #ifdef __cplusplus /* C++ protection. */ | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| #include <lal/ConfigFile.h> | | #include <lal/ConfigFile.h> | |
| #if 0 | | #if 0 | |
| #include <lal/LIGOMetadataTables.h> | | #include <lal/LIGOMetadataTables.h> | |
| #endif | | #endif | |
| | | | |
|
| /** \addtogroup UserInput_h | | /** | |
| | | * \addtogroup UserInput_h | |
| * \author Reinhard Prix | | * \author Reinhard Prix | |
| * \brief Module for simple unified handling of user-input from config-file
and/or command-line. | | * \brief Module for simple unified handling of user-input from config-file
and/or command-line. | |
|
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| This module provides simple function and macros to 'register' a set of C-v | | * This module provides simple function and macros to 'register' a set of C | |
| ariables as 'User Variables', | | -variables as 'User Variables', | |
| which can then be read in from the commandline and/or an input config file | | * which can then be read in from the commandline and/or an input config fi | |
| , as parsed by \ref ConfigFile_h. | | le, as parsed by \ref ConfigFile_h. | |
| | | * | |
| The module handles generating and outputting a help-string on the availabl | | * The module handles generating and outputting a help-string on the availa | |
| e inputs when requested, and | | ble inputs when requested, and | |
| can deal with required inputs and providing defaults. | | * can deal with required inputs and providing defaults. | |
| | | * | |
| \heading{Usage} | | * ### Usage ### | |
| | | * | |
| The general approach consists of these steps | | * The general approach consists of these steps | |
| <ol> | | * <ol> | |
| <li> set default-value for optional user-variables</li> | | * <li> set default-value for optional user-variables</li> | |
| <li> \c register all user-variables using calls to \c XLALRegister<TYPE>Us | | * <li> \c register all user-variables using calls to \c XLALRegister<TYPE> | |
| erVar(), or more conveniently, using the shortcut-macros | | UserVar(), or more conveniently, using the shortcut-macros | |
| XLALreg<TYPE>UserStruct() that assume a struct-pointer named 'uvar' c | | * XLALreg<TYPE>UserStruct() that assume a struct-pointer named 'uvar' cont | |
| ontaining all user-variables as 'uvar->UserVariable'.</li> | | aining all user-variables as 'uvar->UserVariable'.</li> | |
| <li> parse all user-input using XLALUserVarReadAllInput()</li> | | * <li> parse all user-input using XLALUserVarReadAllInput()</li> | |
| <li> At the end, free user-input structure</li> | | * <li> At the end, free user-input structure</li> | |
| </ol> | | * </ol> | |
| | | * | |
| One can use XLALUserVarWasSet() to determine wheter the user specified inp | | * One can use XLALUserVarWasSet() to determine wheter the user specified i | |
| ut for a given (optional) variable, or if it still has just its default val | | nput for a given (optional) variable, or if it still has just its default v | |
| ue. | | alue. | |
| | | * | |
| The function XLALUserVarGetLog() can be used to obtain a log-string contai | | * The function XLALUserVarGetLog() can be used to obtain a log-string cont | |
| ning the full user-input, either in \c commandline- or \c ConfigFile format | | aining the full user-input, either in \c commandline- or \c ConfigFile form | |
| . | | at. | |
| | | * | |
| Here is a worked simple example of its recommended use: | | * Here is a worked simple example of its recommended use: | |
| \code | | * \code | |
| #include <stdio.h> | | * #include <stdio.h> | |
| #include <lal/UserInput.h> | | * #include <lal/UserInput.h> | |
| | | * | |
| // these are the C-variables we want to read in from user-input | | * // these are the C-variables we want to read in from user-input | |
| typedef struct { | | * typedef struct { | |
| BOOLEAN help; // did user request help-output? | | * BOOLEAN help; // did user request help-output? | |
| INT4 anInteger; | | * INT4 anInteger; | |
| REAL8 aDoubleVar; | | * REAL8 aDoubleVar; | |
| CHAR *andAString; | | * CHAR *andAString; | |
| REAL8 specialGeekSwitch; | | * REAL8 specialGeekSwitch; | |
| } UserInput_t; | | * } UserInput_t; | |
| | | * | |
| UserInput_t empty_UserInput; // this is zero-intialized! | | * UserInput_t empty_UserInput; // this is zero-intialized! | |
| | | * | |
| int main(int argc,char *argv[]) | | * int main(int argc,char *argv[]) | |
| { | | * { | |
| UserInput_t UserVariables = empty_UserInput; // initializes this struct | | * UserInput_t UserVariables = empty_UserInput; // initializes this struc | |
| to {0} | | t to {0} | |
| UserInput_t *uvar = &UserVariables; // struct-pointer allows us | | * UserInput_t *uvar = &UserVariables; // struct-pointer allows | |
| to use the XLALreg<TYPE>UserStruct() macros... | | us to use the XLALreg<TYPE>UserStruct() macros... | |
| | | * | |
| // 1. step: set default-values for optional user-input variables | | * // 1. step: set default-values for optional user-input variables | |
| uvar->anInteger = 0; | | * uvar->anInteger = 0; | |
| uvar->andAString = NULL; // Note: need to assign allocated strings h | | * uvar->andAString = NULL; // Note: need to assign allocated strings | |
| ere as default!! | | here as default!! | |
| | | * | |
| // 2. step: Register all user-variables using the shortcut macros: | | * // 2. step: Register all user-variables using the shortcut macros: | |
| XLALregBOOLUserStruct ( help, 'h', UVAR_HELP, "Outpu | | * XLALregBOOLUserStruct ( help, 'h', UVAR_HELP, "Out | |
| t this help-message"); | | put this help-message"); | |
| XLALregINTUserStruct ( anInteger, 'i', UVAR_OPTIONAL, "An ex | | * XLALregINTUserStruct ( anInteger, 'i', UVAR_OPTIONAL, "An | |
| ample user-variable of an optional integer"); | | example user-variable of an optional integer"); | |
| XLALregREALUserStruct ( aDoubleVar, 'r', UVAR_REQUIRED, "This | | * XLALregREALUserStruct ( aDoubleVar, 'r', UVAR_REQUIRED, "Thi | |
| REAL8 user-variable is required"); | | s REAL8 user-variable is required"); | |
| XLALregSTRINGUserStruct( andAString, 0, UVAR_OPTIONAL, "Optio | | * XLALregSTRINGUserStruct( andAString, 0, UVAR_OPTIONAL, "Opt | |
| nal string-input, has no short-option"); | | ional string-input, has no short-option"); | |
| | | * XLALregREALUserStruct ( specialGeekSwitch, 'g', UVAR_DEVELOPER, "T | |
| XLALregREALUserStruct ( specialGeekSwitch, 'g', UVAR_DEVELOPER, "Thi | | his REAL8 user-variable is required"); | |
| s REAL8 user-variable is required"); | | * | |
| | | * // 3. step: parse all user-input, from either config-file if given, or | |
| // 3. step: parse all user-input, from either config-file if given, or c | | commandline (overloads config-file values) | |
| ommandline (overloads config-file values) | | * if ( XLALUserVarReadAllInput ( argc, argv ) != XLAL_SUCCESS ) | |
| if ( XLALUserVarReadAllInput ( argc, argv ) != XLAL_SUCCESS ) | | * XLAL_ERROR ( XLAL_EFUNC ); | |
| XLAL_ERROR ( XLAL_EFUNC ); | | * | |
| | | * if (uvar->help) // if user had requested help, then we're already | |
| if (uvar->help) // if user had requested help, then we're already d | | done here | |
| one here | | * return 0; | |
| return 0; | | * | |
| | | * printf ("User-input was: anInteger = %d, aDoubleVar = %f, andAString = | |
| printf ("User-input was: anInteger = %d, aDoubleVar = %f, andAString = % | | %s\n", uvar->anInteger, uvar->aDoubleVar, uvar->andAString ); | |
| s\n", uvar->anInteger, uvar->aDoubleVar, uvar->andAString ); | | * | |
| | | * // 4. step: free user-input module memory | |
| // 4. step: free user-input module memory | | * XLALDestroyUserVars(); | |
| XLALDestroyUserVars(); | | * | |
| | | * LALCheckMemoryLeaks(); | |
| LALCheckMemoryLeaks(); | | * return 0; | |
| return 0; | | * } // main() | |
| } // main() | | * \endcode | |
| \endcode | | * | |
| | | * \note This code can be compiled <b>as is</b> within lalapps, and yields | |
| \note This code can be compiled <b>as is</b> within lalapps, and yields | | * | |
| | | * \code | |
| \code | | * $ ./testUserInput -v1 --help | |
| $ ./testUserInput -v1 --help | | * | |
| | | * Usage: testUserInput [@ConfigFile] [options], where options are: | |
| Usage: testUserInput [@ConfigFile] [options], where options are: | | * | |
| | | * -v INT set lalDebugLevel [0] | |
| -v INT set lalDebugLevel [0] | | * -h, --help BOOL Output this help-message [] | |
| -h, --help BOOL Output this help-message [] | | * -i, --anInteger INT An example user-variable of an option | |
| -i, --anInteger INT An example user-variable of an optiona | | al integer [0] | |
| l integer [0] | | * -r, --aDoubleVar REAL This REAL8 user-variable is required | |
| -r, --aDoubleVar REAL This REAL8 user-variable is required [ | | [REQUIRED] | |
| REQUIRED] | | * --andAString STRING Optional string-input, has no short-optio | |
| --andAString STRING Optional string-input, has no short-op | | n [NULL] | |
| tion [NULL] | | * | |
| | | * ---------- The following are 'Developer'-options not useful for most use | |
| ---------- The following are 'Developer'-options not useful for most use | | rs:---------- | |
| rs:---------- | | * | |
| | | * -g, --specialGeekSwitch REAL This REAL8 user-variable is required | |
| -g, --specialGeekSwitch REAL This REAL8 user-variable is required [ | | [0.0] | |
| 0.0] | | * \endcode | |
| \endcode | | * | |
| | | * And if called correctly: | |
| And if called correctly: | | * \code | |
| \code | | * $ ./testUserInput -r 3.1415 --andAString="stupid example" | |
| $ ./testUserInput -r 3.1415 --andAString="stupid example" | | * User-input was: anInteger = 0, aDoubleVar = 3.141500, andAString = stupi | |
| User-input was: anInteger = 0, aDoubleVar = 3.141500, andAString = stupid e | | d example | |
| xample | | * \endcode | |
| \endcode | | * | |
| | | * \note For a real-world example of usage, see various codes in lalapps/sr | |
| \note For a real-world example of usage, see various codes in lalapps/src/p | | c/pulsar, notably synthesizeLVStats.c | |
| ulsar, notably synthesizeLVStats.c | | * | |
| | | */ | |
| */ | | | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| /** \name Shortcut Macros | | /** | |
| | | * \name Shortcut Macros | |
| * With this family of short-cut macros one can conveniently register User-
variables | | * With this family of short-cut macros one can conveniently register User-
variables | |
| * that are accessible via a \e struct-pointer "uvar->" | | * that are accessible via a \e struct-pointer "uvar->" | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| #define XLALregREALUserStruct(name,option,flag,help) \ | | #define XLALregREALUserStruct(name,option,flag,help) \ | |
| XLALRegisterREALUserVar(#name, option, flag, help, &(uvar-> name)) | | XLALRegisterREALUserVar(#name, option, flag, help, &(uvar-> name)) | |
| | | | |
| #define XLALregINTUserStruct(name,option,flag,help) \ | | #define XLALregINTUserStruct(name,option,flag,help) \ | |
| XLALRegisterINTUserVar(#name, option,flag, help, &(uvar-> name)) | | XLALRegisterINTUserVar(#name, option,flag, help, &(uvar-> name)) | |
| | | | |
| | | | |
| skipping to change at line 170 | | skipping to change at line 171 | |
| /** State-flags: variable is optional, required, help, developer or was_set
*/ | | /** State-flags: variable is optional, required, help, developer or was_set
*/ | |
| typedef enum { | | typedef enum { | |
| UVAR_OPTIONAL = 0, /**< not required, and hasn't been s
et */ | | UVAR_OPTIONAL = 0, /**< not required, and hasn't been s
et */ | |
| UVAR_REQUIRED = 1<<0, /**< we require the user to set this variabl
e */ | | UVAR_REQUIRED = 1<<0, /**< we require the user to set this variabl
e */ | |
| UVAR_HELP = 1<<1, /**< special variable: trigger output of hel
p-string */ | | UVAR_HELP = 1<<1, /**< special variable: trigger output of hel
p-string */ | |
| UVAR_DEVELOPER = 1<<2, /**< OPTIONAL and hidden in help-output at l
alDebugLevel==0 */ | | UVAR_DEVELOPER = 1<<2, /**< OPTIONAL and hidden in help-output at l
alDebugLevel==0 */ | |
| UVAR_SPECIAL = 1<<3, /**< OPTIONAL and *turns off* checking of re
quired variables (LALUserVarCheckRequired) */ | | UVAR_SPECIAL = 1<<3, /**< OPTIONAL and *turns off* checking of re
quired variables (LALUserVarCheckRequired) */ | |
| UVAR_WAS_SET = 1<<7 /**< flag that this user-var has bee
n set by user */ | | UVAR_WAS_SET = 1<<7 /**< flag that this user-var has bee
n set by user */ | |
| } UserVarState; | | } UserVarState; | |
| | | | |
|
| /** Format for logging User-input: configFile- or cmdLine-style. | | /** | |
| | | * Format for logging User-input: configFile- or cmdLine-style. | |
| * This determines the format of the string returned from LALLogUserInput()
. | | * This determines the format of the string returned from LALLogUserInput()
. | |
| */ | | */ | |
| typedef enum { | | typedef enum { | |
| UVAR_LOGFMT_CFGFILE, /**< return UserVars as a config-file */ | | UVAR_LOGFMT_CFGFILE, /**< return UserVars as a config-file */ | |
| UVAR_LOGFMT_CMDLINE, /**< return UserVars as a command-line */ | | UVAR_LOGFMT_CMDLINE, /**< return UserVars as a command-line */ | |
| UVAR_LOGFMT_PROCPARAMS, /**< return UserVars suitable for filling in proc
ess-params struct */ | | UVAR_LOGFMT_PROCPARAMS, /**< return UserVars suitable for filling in proc
ess-params struct */ | |
| UVAR_LOGFMT_LAST | | UVAR_LOGFMT_LAST | |
| } UserVarLogFormat; | | } UserVarLogFormat; | |
| | | | |
| /* Function prototypes */ | | /* Function prototypes */ | |
| | | | |
| skipping to change at line 232 | | skipping to change at line 234 | |
| #define USERINPUTH_MSGECMDLARG "Illegal command-line argument" | | #define USERINPUTH_MSGECMDLARG "Illegal command-line argument" | |
| #define USERINPUTH_MSGEUNKNOWN "Unknown user-variable" | | #define USERINPUTH_MSGEUNKNOWN "Unknown user-variable" | |
| #define USERINPUTH_MSGENOTSET "Required user-variable was not set" | | #define USERINPUTH_MSGENOTSET "Required user-variable was not set" | |
| #define USERINPUTH_MSGEDEBUG "lalDebugLevel can only be read before ANY m
allocs(), even hidden.." | | #define USERINPUTH_MSGEDEBUG "lalDebugLevel can only be read before ANY m
allocs(), even hidden.." | |
| #define USERINPUTH_MSGEONECONFIG "Currently one ONE config-file can be spec
ified using '@'" | | #define USERINPUTH_MSGEONECONFIG "Currently one ONE config-file can be spec
ified using '@'" | |
| #define USERINPUTH_MSGERECFORMAT "Unknown format for recording user-input
" | | #define USERINPUTH_MSGERECFORMAT "Unknown format for recording user-input
" | |
| #define USERINPUTH_MSGEXLAL "Failure in XLAL function" | | #define USERINPUTH_MSGEXLAL "Failure in XLAL function" | |
| #define USERINPUTH_MSGENAMECOLL "Commandline option assigned more than once
" | | #define USERINPUTH_MSGENAMECOLL "Commandline option assigned more than once
" | |
| /** \endcond */ | | /** \endcond */ | |
| | | | |
|
| /** \name Deprecated LAL-interface | | /** | |
| | | * \name Deprecated LAL-interface | |
| * These functions and macros are deprecated, and you should user their XLA
L-equivalents instead. | | * These functions and macros are deprecated, and you should user their XLA
L-equivalents instead. | |
|
| */ /*@{*/ | | */ | |
| | | /*@{*/ | |
| /*----- short-cut macros to register global "uvar_" User-Variables ----- */ | | /*----- short-cut macros to register global "uvar_" User-Variables ----- */ | |
| #define LALregREALUserVar(status,name,option,flag,help) \ | | #define LALregREALUserVar(status,name,option,flag,help) \ | |
| TRY(LALRegisterREALUserVar((status)->statusPtr, #name, option, flag, help,&
(uvar_ ## name)), status) | | TRY(LALRegisterREALUserVar((status)->statusPtr, #name, option, flag, help,&
(uvar_ ## name)), status) | |
| | | | |
| #define LALregINTUserVar(status,name,option,flag,help) \ | | #define LALregINTUserVar(status,name,option,flag,help) \ | |
| TRY(LALRegisterINTUserVar((status)->statusPtr, #name, option,flag, help,&(u
var_ ## name)), status) | | TRY(LALRegisterINTUserVar((status)->statusPtr, #name, option,flag, help,&(u
var_ ## name)), status) | |
| | | | |
| #define LALregBOOLUserVar(status,name,option,flag,help) \ | | #define LALregBOOLUserVar(status,name,option,flag,help) \ | |
| TRY(LALRegisterBOOLUserVar((status)->statusPtr, #name, option, flag, help,
&(uvar_ ## name)),status) | | TRY(LALRegisterBOOLUserVar((status)->statusPtr, #name, option, flag, help,
&(uvar_ ## name)),status) | |
| | | | |
| | | | |
End of changes. 6 change blocks. |
| 133 lines changed or deleted | | 137 lines changed or added | |
|
| Window.h | | Window.h | |
| | | | |
| skipping to change at line 35 | | skipping to change at line 35 | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * \defgroup Window_h Header Window.h | | * \defgroup Window_h Header Window.h | |
| * \ingroup pkg_window | | * \ingroup pkg_window | |
| * \brief This header file provides routines and structures to create and s
tore window functions (also called a taper, | | * \brief This header file provides routines and structures to create and s
tore window functions (also called a taper, | |
| * lag window, or apodization function). | | * lag window, or apodization function). | |
|
| | | * | |
| \heading{Synopsis} | | * ### Synopsis ### | |
| | | * | |
| \code | | * \code | |
| #include <lal/Window.h> | | * #include <lal/Window.h> | |
| \endcode | | * \endcode | |
| | | * | |
| \heading{Description} | | * ### Description ### | |
| | | * | |
| These functions create or destroy a time-domain window function in a vector | | * These functions create or destroy a time-domain window function in a vec | |
| of specified length. If you wish to construct a custom window, call | | tor | |
| <tt>XLALCreateRectangularREAL8Window()</tt> (or the \c REAL4 | | * of specified length. If you wish to construct a custom window, call | |
| version), then replace the samples inside it with your own, and update the | | * <tt>XLALCreateRectangularREAL8Window()</tt> (or the \c REAL4 | |
| \c sumofsquares and \c sum elements. If the window function | | * version), then replace the samples inside it with your own, and update t | |
| proves useful, consider adding it here so that others can benefit. | | he | |
| | | * \c sumofsquares and \c sum elements. If the window function | |
| It is convenient to describe the windows as functions on the normalized | | * proves useful, consider adding it here so that others can benefit. | |
| domain \f$y \in [-1, 1]\f$. The window is zero outside this domain. The | | * | |
| window functions defined in this package are as follows. | | * It is convenient to describe the windows as functions on the normalized | |
| | | * domain \f$y \in [-1, 1]\f$. The window is zero outside this domain. Th | |
| \heading{Rectangle} | | e | |
| \f{equation}{ | | * window functions defined in this package are as follows. | |
| w(y) | | * | |
| = 1. | | * ### Rectangle ### | |
| \f}</dd> | | * | |
| | | * \f{equation}{ | |
| \heading{Hann} | | * w(y) | |
| \f{equation}{ | | * = 1. | |
| w(y) | | * \f}</dd> | |
| = \cos^2 \frac{\pi}{2} y. | | * | |
| \f}</dd> | | * ### Hann ### | |
| | | * | |
| \heading{Welch} | | * \f{equation}{ | |
| \f{equation}{ | | * w(y) | |
| w(y) | | * = \cos^2 \frac{\pi}{2} y. | |
| = 1 - y^2. | | * \f}</dd> | |
| \f}</dd> | | * | |
| | | * ### Welch ### | |
| \heading{Bartlett} | | * | |
| \f{equation}{ | | * \f{equation}{ | |
| w(y) | | * w(y) | |
| = 1 - |y|. | | * = 1 - y^2. | |
| \f}</dd> | | * \f}</dd> | |
| | | * | |
| \heading{Parzen} | | * ### Bartlett ### | |
| \f{equation}{ | | * | |
| w(y) | | * \f{equation}{ | |
| = \left\{ \begin{array}{ll} | | * w(y) | |
| 1 - 6 y^2 (1 - |y|) & |y| \leq 1 / 2, \\ | | * = 1 - |y|. | |
| 2 (1 - |y|)^3 & |y| > 1 / 2. | | * \f}</dd> | |
| \end{array}\right. | | * | |
| \f}</dd> | | * ### Parzen ### | |
| | | * | |
| \heading{Papoulis} | | * \f{equation}{ | |
| \f{equation}{ | | * w(y) | |
| w(y) | | * = \left\{ \begin{array}{ll} | |
| = \frac{1}{\pi} \sin \pi |y| + (1 - |y|) \cos \pi |y|. | | * 1 - 6 y^2 (1 - |y|) & |y| \leq 1 / 2, \\ | |
| \f}</dd> | | * 2 (1 - |y|)^3 & |y| > 1 / 2. | |
| | | * \end{array}\right. | |
| \heading{Hamming} | | * \f}</dd> | |
| \f{equation}{ | | * | |
| w(y) | | * ### Papoulis ### | |
| = 0.08 + 0.92 \cos^{2} \frac{\pi}{2} y. | | * | |
| \f} | | * \f{equation}{ | |
| This is the same as the Hann window, but with an additional DC bias, or | | * w(y) | |
| "foot," of 0.08.</dd> | | * = \frac{1}{\pi} \sin \pi |y| + (1 - |y|) \cos \pi |y|. | |
| | | * \f}</dd> | |
| \heading{Kaiser} | | * | |
| \f{equation}{ | | * ### Hamming ### | |
| w(y) | | * | |
| = I_0 \left( \beta \sqrt{1-y^2} \right) / I_0(\beta), | | * \f{equation}{ | |
| \f} | | * w(y) | |
| where \f$I_0(x)\f$ is the \f$0\f$th order, modified Bessel function of the | | * = 0.08 + 0.92 \cos^{2} \frac{\pi}{2} y. | |
| first | | * \f} | |
| kind. The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpness o | | * This is the same as the Hann window, but with an additional DC bias, or | |
| f | | * "foot," of 0.08.</dd> | |
| the central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta | | * | |
| \rightarrow \infty\f$ yields a \f$\delta\f$ function with a single non-zero | | * ### Kaiser ### | |
| sample in the middle. This window is difficult to compute for large | | * | |
| \f$\beta\f$, and an asymptotic approximation is used for \f$\beta \ge 705\f | | * \f{equation}{ | |
| $. A | | * w(y) | |
| linearly-interpolated transition occurs between \f$\beta = 695\f$ and \f$\b | | * = I_0 \left( \beta \sqrt{1-y^2} \right) / I_0(\beta), | |
| eta = | | * \f} | |
| 705\f$. Finite-difference derivatives of the window with respect to \f$\be | | * where \f$I_0(x)\f$ is the \f$0\f$th order, modified Bessel function of t | |
| ta\f$ | | he first | |
| are unlikely to work well in this regime.</dd> | | * kind. The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpnes | |
| | | s of | |
| \heading{Creighton} | | * the central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta | |
| \f{equation}{ | | * \rightarrow \infty\f$ yields a \f$\delta\f$ function with a single non-z | |
| w(y) | | ero | |
| = \exp \left( -\beta \frac{y^2}{1 - y^2} \right). | | * sample in the middle. This window is difficult to compute for large | |
| \f} | | * \f$\beta\f$, and an asymptotic approximation is used for \f$\beta \ge 70 | |
| This window function is based on a fairly standard \f$C_{\infty}\f$ test | | 5\f$. A | |
| function used in distribution theory, e.g.\ <em>Green's Functions and | | * linearly-interpolated transition occurs between \f$\beta = 695\f$ and \f | |
| Boundary Value Problems</em> [\ref stakgold79], by Stakgold. The shape par | | $\beta = | |
| ameter | | * 705\f$. Finite-difference derivatives of the window with respect to \f$ | |
| \f$\beta \in [0, \infty]\f$ sets the sharpness of the central peak. \f$\be | | \beta\f$ | |
| ta = | | * are unlikely to work well in this regime.</dd> | |
| 0\f$ yields the rectangle window, \f$\beta \rightarrow \infty\f$ yields a | | * | |
| \f$\delta\f$ function with a single non-zero sample in the middle.</dd> | | * ### Creighton ### | |
| | | * | |
| \heading{Tukey} | | * \f{equation}{ | |
| \f{equation}{ | | * w(y) | |
| w(y) | | * = \exp \left( -\beta \frac{y^2}{1 - y^2} \right). | |
| = \left\{ \begin{array}{ll} | | * \f} | |
| \sin^2 \left[ \frac{\pi}{2} (|y| - 1) / \beta \right] & |y| \geq 1 - | | * This window function is based on a fairly standard \f$C_{\infty}\f$ test | |
| \beta, | | * function used in distribution theory, e.g.\ <em>Green's Functions and | |
| \\ | | * Boundary Value Problems</em> \cite stakgold79, by Stakgold. The shape p | |
| 1 & |y| < 1 - \beta. | | arameter | |
| \end{array} \right. | | * \f$\beta \in [0, \infty]\f$ sets the sharpness of the central peak. \f$ | |
| \f} | | \beta = | |
| The shape parameter \f$\beta \in [0, 1]\f$ sets what fraction of the window | | * 0\f$ yields the rectangle window, \f$\beta \rightarrow \infty\f$ yields | |
| is | | a | |
| spanned by the tapers. \f$\beta = 0\f$ yields the rectangle window, \f$\be | | * \f$\delta\f$ function with a single non-zero sample in the middle.</dd> | |
| ta = | | * | |
| 1\f$ yields the Hann window.</dd> | | * ### Tukey ### | |
| | | * | |
| \heading{Gauss} | | * \f{equation}{ | |
| \f{equation}{ | | * w(y) | |
| w(y) | | * = \left\{ \begin{array}{ll} | |
| = \exp \left( -\frac{1}{2} \beta^{2} y^{2} \right). | | * \sin^2 \left[ \frac{\pi}{2} (|y| - 1) / \beta \right] & |y| \geq 1 - | |
| \f} | | * \beta, \\ | |
| The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpness of the | | * 1 & |y| < 1 - \beta. | |
| central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta \right | | * \end{array} \right. | |
| arrow \infty\f$ yields a \f$\delta\f$ function with a single non-zero sampl | | * \f} | |
| e in the | | * The shape parameter \f$\beta \in [0, 1]\f$ sets what fraction of the win | |
| middle. | | dow is | |
| | | * spanned by the tapers. \f$\beta = 0\f$ yields the rectangle window, \f$ | |
| These window functions are shown in Fig.\figref{f_window_t}, showing variou | | \beta = | |
| s windows as functions of the normalized | | * 1\f$ yields the Hann window.</dd> | |
| independend variable \f$y\f$, choosing \f$\beta = 6\f$ for the Kaiser windo | | * | |
| w, \f$\beta = 2\f$ for the Creighton window, | | * ### Gauss ### | |
| \f$\beta = 0.5\f$ for the Tukey window, and \f$\beta = 3\f$ for the Gauss w | | * | |
| indow. | | * \f{equation}{ | |
| | | * w(y) | |
| \floatfig{htbp,f_window_t} | | * = \exp \left( -\frac{1}{2} \beta^{2} y^{2} \right). | |
| \image html window_t.png "Fig. [f_window_t]: Various windows as functions | | * \f} | |
| of the normalized independend variable y" | | * The shape parameter \f$\beta \in [0, \infty]\f$ sets the sharpness of th | |
| \image latex window_t.pdf "Various windows as functions of the normalized i | | e | |
| ndependend variable y" | | * central peak. \f$\beta = 0\f$ yields the rectangle window, \f$\beta \ri | |
| | | ghtarrow \infty\f$ yields a \f$\delta\f$ function with a single non-zero sa | |
| For a vector of length \f$L\f$ (an integer), the mapping from integer array | | mple in the | |
| index \f$i\f$ to normalized co-ordinate \f$y\f$ is | | * middle. | |
| \f{equation}{ | | * | |
| y(i) | | * These window functions are shown in \figref{window_t}, showing various w | |
| = \left\{ \begin{array}{ll} | | indows as functions of the normalized | |
| 0 & L \le 1, \\ | | * independend variable \f$y\f$, choosing \f$\beta = 6\f$ for the Kaiser wi | |
| 2 i / (L - 1) - 1 & L > 1, | | ndow, \f$\beta = 2\f$ for the Creighton window, | |
| \end{array} \right. | | * \f$\beta = 0.5\f$ for the Tukey window, and \f$\beta = 3\f$ for the Gaus | |
| \f} | | s window. | |
| where \f$0 \le i < L\f$, and floating-point division is used. This agrees | | * | |
| with | | * \figure{window_t,pdf,0.6,Various windows as functions of the normalized | |
| J. G. Proakis and D. G. Manolakis, <em>Digital Signal Processing</em> | | independend variable y} | |
| [\ref pm95], and \c MatLab. The first sample is \f$y = -1\f$, the last | | * | |
| sample is \f$y = +1\f$. For odd-lengthed vectors, the middle sample is \f$ | | * For a vector of length \f$L\f$ (an integer), the mapping from integer ar | |
| y = | | ray | |
| 0\f$, while for even-lengthed vectors \f$y = 0\f$ occurs half-way between t | | * index \f$i\f$ to normalized co-ordinate \f$y\f$ is | |
| he two | | * \f{equation}{ | |
| middle samples. Substituting \f$y(i)\f$ into the definitions of the window | | * y(i) | |
| functions above yields \f$w(i)\f$, the value of the window function at the | | * = \left\{ \begin{array}{ll} | |
| integer sample \f$i\f$. | | * 0 & L \le 1, \\ | |
| | | * 2 i / (L - 1) - 1 & L > 1, | |
| The Fourier transforms of the windows are shown as functions of \f$1 / y\f$ | | * \end{array} \right. | |
| in | | * \f} | |
| Fig.\figref{f_window_f}, showing frequency behaviour of various windows as | | * where \f$0 \le i < L\f$, and floating-point division is used. This agre | |
| functions | | es with | |
| of the inverse of the normalized independend variable \f$y\f$, choosing \f$ | | * J. G. Proakis and D. G. Manolakis, <em>Digital Signal Processing</em> | |
| \beta = 6\f$ | | * \cite pm95, and \c MatLab. The first sample is \f$y = -1\f$, the last | |
| for the Kaiser window, \f$\beta = 2\f$ for the Creighton window, \f$\beta = | | * sample is \f$y = +1\f$. For odd-lengthed vectors, the middle sample is | |
| 0.5\f$ for | | \f$y = | |
| the Tukey window, and \f$\beta = 3\f$ for the Gauss window. | | * 0\f$, while for even-lengthed vectors \f$y = 0\f$ occurs half-way betwee | |
| | | n the two | |
| \floatfig{htbp,f_window_f} | | * middle samples. Substituting \f$y(i)\f$ into the definitions of the win | |
| \image html window_f.png "Fig. [f_window_f]: Frequency behaviour of variou | | dow | |
| s windows as functions of the inverse of the normalized independend variabl | | * functions above yields \f$w(i)\f$, the value of the window function at t | |
| e y" | | he | |
| \image latex window_f.pdf "Frequency behaviour of various windows as functi | | * integer sample \f$i\f$. | |
| ons of the inverse of the normalized independend variable y" | | * | |
| | | * The Fourier transforms of the windows are shown as functions of \f$1 / y | |
| Since the Fourier transform of windowed data is the Fourier transform of | | \f$ in | |
| the data convolved with the Fourier transform of the window, | | * \figref{window_f}, showing frequency behaviour of various windows as fun | |
| Fig.\figref{f_window_f} is the major guideline for selecting a window. One | | ctions | |
| can see that windows with a narrow central lobe tend to have higher | | * of the inverse of the normalized independend variable \f$y\f$, choosing | |
| sidelobes, and windows which suppress their low-order sidelobes tend to | | \f$\beta = 6\f$ | |
| have more power in the high-order sidelobes. The choice of window thus | | * for the Kaiser window, \f$\beta = 2\f$ for the Creighton window, \f$\bet | |
| depends on whether one is trying to resolve nearby spectral features of | | a = 0.5\f$ for | |
| comparable magnitude (suggesting a rectangular or a Welch window), to | | * the Tukey window, and \f$\beta = 3\f$ for the Gauss window. | |
| reduce spectral bias and low-order sidelobes (a Hamming or Kaiser window), | | * | |
| or to measure a broad spectrum with a large dynamical range (a Creighton or | | * \figure{window_f,pdf,0.6,Frequency behaviour of various windows as funct | |
| a Papoulis window). | | ions of the inverse of the normalized independend variable y} | |
| | | * | |
| */ | | * Since the Fourier transform of windowed data is the Fourier transform of | |
| | | * the data convolved with the Fourier transform of the window, | |
| | | * \figref{window_f} is the major guideline for selecting a window. One | |
| | | * can see that windows with a narrow central lobe tend to have higher | |
| | | * sidelobes, and windows which suppress their low-order sidelobes tend to | |
| | | * have more power in the high-order sidelobes. The choice of window thus | |
| | | * depends on whether one is trying to resolve nearby spectral features of | |
| | | * comparable magnitude (suggesting a rectangular or a Welch window), to | |
| | | * reduce spectral bias and low-order sidelobes (a Hamming or Kaiser window | |
| | | ), | |
| | | * or to measure a broad spectrum with a large dynamical range (a Creighton | |
| | | or | |
| | | * a Papoulis window). | |
| | | * | |
| | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
|
| /** Structure for storing REAL4 window function data, providing storage for | | /** | |
| a sequence of samples | | * Structure for storing REAL4 window function data, providing storage for | |
| | | a sequence of samples | |
| * as well as metadata about the window such as the sum-of-squarse of the s
amples | | * as well as metadata about the window such as the sum-of-squarse of the s
amples | |
| */ | | */ | |
| typedef struct tagREAL4Window { | | typedef struct tagREAL4Window { | |
| REAL4Sequence *data; /**< The window function samples */ | | REAL4Sequence *data; /**< The window function samples */ | |
| REAL8 sumofsquares; /**< The sum of the squares of the w
indow function samples */ | | REAL8 sumofsquares; /**< The sum of the squares of the w
indow function samples */ | |
| REAL8 sum; /**< The sum of the window function
samples */ | | REAL8 sum; /**< The sum of the window function
samples */ | |
| } REAL4Window; | | } REAL4Window; | |
| | | | |
|
| /** Structure for storing REAL8 window function data, providing storage for | | /** | |
| a sequence of samples | | * Structure for storing REAL8 window function data, providing storage for | |
| | | a sequence of samples | |
| * as well as metadata about the window such as the sum-of-squarse of the s
amples | | * as well as metadata about the window such as the sum-of-squarse of the s
amples | |
| */ | | */ | |
| typedef struct tagREAL8Window { | | typedef struct tagREAL8Window { | |
| REAL8Sequence *data; /**< The window function samples */ | | REAL8Sequence *data; /**< The window function samples */ | |
| REAL8 sumofsquares; /**< The sum of the squares of the w
indow function samples */ | | REAL8 sumofsquares; /**< The sum of the squares of the w
indow function samples */ | |
| REAL8 sum; /**< The sum of the window function
samples */ | | REAL8 sum; /**< The sum of the window function
samples */ | |
| } REAL8Window; | | } REAL8Window; | |
| | | | |
|
| | | #ifdef SWIG /* SWIG interface directives */ | |
| | | SWIGLAL(ACQUIRES_OWNERSHIP(REAL4Sequence*, sequence)); | |
| | | SWIGLAL(ACQUIRES_OWNERSHIP(REAL8Sequence*, sequence)); | |
| | | #endif | |
| REAL4Window *XLALCreateREAL4WindowFromSequence(REAL4Sequence *sequence); | | REAL4Window *XLALCreateREAL4WindowFromSequence(REAL4Sequence *sequence); | |
| REAL8Window *XLALCreateREAL8WindowFromSequence(REAL8Sequence *sequence); | | REAL8Window *XLALCreateREAL8WindowFromSequence(REAL8Sequence *sequence); | |
|
| | | #ifdef SWIG /* SWIG interface directives */ | |
| | | SWIGLAL_CLEAR(ACQUIRES_OWNERSHIP(REAL4Sequence*, sequence)); | |
| | | SWIGLAL_CLEAR(ACQUIRES_OWNERSHIP(REAL8Sequence*, sequence)); | |
| | | #endif | |
| | | | |
| REAL4Window *XLALCreateRectangularREAL4Window(UINT4 length); | | REAL4Window *XLALCreateRectangularREAL4Window(UINT4 length); | |
| REAL4Window *XLALCreateHannREAL4Window(UINT4 length); | | REAL4Window *XLALCreateHannREAL4Window(UINT4 length); | |
| REAL4Window *XLALCreateWelchREAL4Window(UINT4 length); | | REAL4Window *XLALCreateWelchREAL4Window(UINT4 length); | |
| REAL4Window *XLALCreateBartlettREAL4Window(UINT4 length); | | REAL4Window *XLALCreateBartlettREAL4Window(UINT4 length); | |
| REAL4Window *XLALCreateParzenREAL4Window(UINT4 length); | | REAL4Window *XLALCreateParzenREAL4Window(UINT4 length); | |
| REAL4Window *XLALCreatePapoulisREAL4Window(UINT4 length); | | REAL4Window *XLALCreatePapoulisREAL4Window(UINT4 length); | |
| REAL4Window *XLALCreateHammingREAL4Window(UINT4 length); | | REAL4Window *XLALCreateHammingREAL4Window(UINT4 length); | |
| REAL4Window *XLALCreateKaiserREAL4Window(UINT4 length, REAL4 beta); | | REAL4Window *XLALCreateKaiserREAL4Window(UINT4 length, REAL4 beta); | |
| REAL4Window *XLALCreateCreightonREAL4Window(UINT4 length, REAL4 beta); | | REAL4Window *XLALCreateCreightonREAL4Window(UINT4 length, REAL4 beta); | |
| | | | |
End of changes. 5 change blocks. |
| 196 lines changed or deleted | | 220 lines changed or added | |
|
| XLALError.h | | XLALError.h | |
| | | | |
| skipping to change at line 40 | | skipping to change at line 40 | |
| } /* so that editors will match preceding brace */ | | } /* so that editors will match preceding brace */ | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| * \addtogroup XLALError_h | | * \addtogroup XLALError_h | |
| * \author Creighton, J. D. E. | | * \author Creighton, J. D. E. | |
| * \date 2005 | | * \date 2005 | |
| * \brief This header covers routines to provide the XLAL interface error | | * \brief This header covers routines to provide the XLAL interface error | |
| * handling. | | * handling. | |
| * | | * | |
|
| * \heading{XLAL Errors} | | * ### XLAL Errors ### | |
| * | | * | |
| * When an XLAL routine fails, the routine should set the <tt>xlalErrno</tt
> to | | * When an XLAL routine fails, the routine should set the <tt>xlalErrno</tt
> to | |
| * an appropriate error number and return with the appropriate error code.
The | | * an appropriate error number and return with the appropriate error code.
The | |
| * return value depends on the return type of the XLAL function. Furthermo
re, | | * return value depends on the return type of the XLAL function. Furthermo
re, | |
| * the XLAL error handler should be invoked. | | * the XLAL error handler should be invoked. | |
| * | | * | |
| * Whenever possible (i.e., always), standard XLAL error macros should be u
sed | | * Whenever possible (i.e., always), standard XLAL error macros should be u
sed | |
| * when generating an error. These macros (i) invoke the current error han
dler, | | * when generating an error. These macros (i) invoke the current error han
dler, | |
| * (ii) set the error code to the specified value, and (iii) return with th
e | | * (ii) set the error code to the specified value, and (iii) return with th
e | |
| * correct return value. In addition, these macros may take an optional | | * correct return value. In addition, these macros may take an optional | |
| | | | |
| skipping to change at line 110 | | skipping to change at line 110 | |
| * y += 0.5 * log(2.0 * LAL_PI * n); | | * y += 0.5 * log(2.0 * LAL_PI * n); | |
| * return y; | | * return y; | |
| * default: | | * default: | |
| * XLALSetErrno(errnum); | | * XLALSetErrno(errnum); | |
| * XLAL_ERROR_REAL8(XLAL_EFUNC); | | * XLAL_ERROR_REAL8(XLAL_EFUNC); | |
| * } | | * } | |
| * return log(y); | | * return log(y); | |
| * } | | * } | |
| * \endcode | | * \endcode | |
| * | | * | |
|
| * \heading{XLAL Function Return Codes} | | * ### XLAL Function Return Codes ### | |
| * | | * | |
| * XLAL functions that return an integer-type will return <tt>#XLAL_FAILURE
</tt> | | * XLAL functions that return an integer-type will return <tt>#XLAL_FAILURE
</tt> | |
| * on failure. XLAL functions that return a pointer will return <tt>NULL</
tt> | | * on failure. XLAL functions that return a pointer will return <tt>NULL</
tt> | |
| * on failure. | | * on failure. | |
| * | | * | |
| * The LAL specification requires that XLAL functions that return a | | * The LAL specification requires that XLAL functions that return a | |
| * floating-point type (either <tt>::REAL4</tt> or <tt>::REAL8</tt>) should
return | | * floating-point type (either <tt>::REAL4</tt> or <tt>::REAL8</tt>) should
return | |
| * a particular value to indicate an error. These values are given by the | | * a particular value to indicate an error. These values are given by the | |
| * macros <tt>#XLAL_REAL4_FAIL_NAN</tt> and <tt>#XLAL_REAL8_FAIL_NAN</tt> (
they | | * macros <tt>#XLAL_REAL4_FAIL_NAN</tt> and <tt>#XLAL_REAL8_FAIL_NAN</tt> (
they | |
| * are Not a Number or NaN values). To implement these we choose hexadecim
al | | * are Not a Number or NaN values). To implement these we choose hexadecim
al | |
| | | | |
| skipping to change at line 135 | | skipping to change at line 135 | |
| * hexadecimal representation to the floating-point representation is done | | * hexadecimal representation to the floating-point representation is done | |
| * using a union. | | * using a union. | |
| * | | * | |
| * The LAL specification also requires that there be two macros, | | * The LAL specification also requires that there be two macros, | |
| * <tt>#XLAL_IS_REAL4_FAIL_NAN(val)</tt> and | | * <tt>#XLAL_IS_REAL4_FAIL_NAN(val)</tt> and | |
| * <tt>#XLAL_IS_REAL8_FAIL_NAN(val)</tt> that will test if val is one of th
ese | | * <tt>#XLAL_IS_REAL8_FAIL_NAN(val)</tt> that will test if val is one of th
ese | |
| * XLAL-specific fail NaNs. Again these macros invoke static functions tha
t | | * XLAL-specific fail NaNs. Again these macros invoke static functions tha
t | |
| * return the result of the comparison. The cmparison itself is done with
the | | * return the result of the comparison. The cmparison itself is done with
the | |
| * hexadecimal representation. | | * hexadecimal representation. | |
| * | | * | |
|
| * \heading{XLAL Error Codes} | | * ### XLAL Error Codes ### | |
| * | | * | |
| * The LAL specification requires particular return code and error values. | | * The LAL specification requires particular return code and error values. | |
| * These are implemented here as enumeration constants in the | | * These are implemented here as enumeration constants in the | |
| * <tt>::XLALErrorValue</tt> enumeration. | | * <tt>::XLALErrorValue</tt> enumeration. | |
| */ | | */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| /* | | /* | |
| * | | * | |
| * Use these functions to print arbitrary messages as errors or warnings. | | * Use these functions to print arbitrary messages as errors or warnings. | |
| | | | |
| skipping to change at line 177 | | skipping to change at line 177 | |
| int XLALVPrintInfo(const char *fmt, va_list ap); | | int XLALVPrintInfo(const char *fmt, va_list ap); | |
| | | | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| | | | |
| /* | | /* | |
| * | | * | |
| * Miscelaneous routines to print information with standard formatting. | | * Miscelaneous routines to print information with standard formatting. | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** Print an error message with standard XLAL formatting (if error messages | | /** | |
| * are enabled by lalDebugLevel). */ | | * Print an error message with standard XLAL formatting (if error messages | |
| | | * are enabled by lalDebugLevel). | |
| | | */ | |
| void XLALPrintErrorMessage(const char *func, const char *file, int line, | | void XLALPrintErrorMessage(const char *func, const char *file, int line, | |
| const char *fmt, ...); | | const char *fmt, ...); | |
| | | | |
|
| /** Print an warning message with standard XLAL formatting (if warning mess | | /** | |
| ages | | * Print an warning message with standard XLAL formatting (if warning messa | |
| * are enabled by lalDebugLevel). */ | | ges | |
| | | * are enabled by lalDebugLevel). | |
| | | */ | |
| void XLALPrintWarningMessage(const char *func, const char *file, int line, | | void XLALPrintWarningMessage(const char *func, const char *file, int line, | |
| const char *fmt, ...); | | const char *fmt, ...); | |
| | | | |
|
| /** Print an info message with standard XLAL formatting (if info messages | | /** | |
| * are enabled by lalDebugLevel). */ | | * Print an info message with standard XLAL formatting (if info messages | |
| | | * are enabled by lalDebugLevel). | |
| | | */ | |
| void XLALPrintInfoMessage(const char *func, const char *file, int line, | | void XLALPrintInfoMessage(const char *func, const char *file, int line, | |
| const char *fmt, ...); | | const char *fmt, ...); | |
| | | | |
| #ifndef SWIG /* exclude from SWIG interface */ | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | | |
|
| /** Print an error message with standard XLAL formatting (if error messages | | /** | |
| * are enabled by lalDebugLevel). */ | | * Print an error message with standard XLAL formatting (if error messages | |
| | | * are enabled by lalDebugLevel). | |
| | | */ | |
| void XLALVPrintErrorMessage(const char *func, const char *file, int line, | | void XLALVPrintErrorMessage(const char *func, const char *file, int line, | |
| const char *fmt, va_list ap); | | const char *fmt, va_list ap); | |
| | | | |
|
| /** Print an warning message with standard XLAL formatting (if warning mess | | /** | |
| ages | | * Print an warning message with standard XLAL formatting (if warning messa | |
| * are enabled by lalDebugLevel). */ | | ges | |
| | | * are enabled by lalDebugLevel). | |
| | | */ | |
| void XLALVPrintWarningMessage(const char *func, const char *file, int line, | | void XLALVPrintWarningMessage(const char *func, const char *file, int line, | |
| const char *fmt, va_list ap); | | const char *fmt, va_list ap); | |
| | | | |
|
| /** Print an error message with standard XLAL formatting (if error messages | | /** | |
| * are enabled by lalDebugLevel). */ | | * Print an error message with standard XLAL formatting (if error messages | |
| | | * are enabled by lalDebugLevel). | |
| | | */ | |
| void XLALVPrintInfoMessage(const char *func, const char *file, int line, | | void XLALVPrintInfoMessage(const char *func, const char *file, int line, | |
| const char *fmt, va_list ap); | | const char *fmt, va_list ap); | |
| | | | |
| #endif /* SWIG */ | | #endif /* SWIG */ | |
| | | | |
| /** Prints a progress bar at the "info" verbosity level. */ | | /** Prints a progress bar at the "info" verbosity level. */ | |
| int XLALPrintProgressBar(double); | | int XLALPrintProgressBar(double); | |
| | | | |
| /** Prints a deprecation warning at the "warning" verbosity level. */ | | /** Prints a deprecation warning at the "warning" verbosity level. */ | |
|
| int XLALPrintDeprecationWarning(const char *old, const char *replacement); | | #define XLAL_PRINT_DEPRECATION_WARNING(replacement) \ | |
| | | do { \ | |
| | | static int _xlal_print_deprecation_warning_ = 1; \ | |
| | | if (_xlal_print_deprecation_warning_) { \ | |
| | | XLALPrintWarning( \ | |
| | | "\nDEPRECATION WARNING: program has invoked obsolete function %s(). | |
| | | " \ | |
| | | "Please see %s() for information about a replacement.\n", \ | |
| | | __func__, replacement); \ | |
| | | _xlal_print_deprecation_warning_ = 0; \ | |
| | | } \ | |
| | | } while(0) | |
| | | | |
| /* | | /* | |
| * | | * | |
| * Macros that will print error/warning/info messages with a standard forma
t. | | * Macros that will print error/warning/info messages with a standard forma
t. | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** \brief Macro that will print an error message with a standard format. | | /** | |
| | | * \brief Macro that will print an error message with a standard format. | |
| * | | * | |
| * Prototype: <b>XLAL_PRINT_ERROR(fmt [, ...])</b> | | * Prototype: <b>XLAL_PRINT_ERROR(fmt [, ...])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b fmt A printf-like format string. | | * <li> \b fmt A printf-like format string. | |
| * <li> \b ... (Optional) Arguments to the format string. | | * <li> \b ... (Optional) Arguments to the format string. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_PRINT_ERROR(...) \ | | #define XLAL_PRINT_ERROR(...) \ | |
| XLALPrintErrorMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) | | XLALPrintErrorMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro that will print a warning message with a standard format. | | /** | |
| | | * \brief Macro that will print a warning message with a standard format. | |
| * | | * | |
| * Prototype: <b>XLAL_PRINT_WARNING(fmt [, ...])</b> | | * Prototype: <b>XLAL_PRINT_WARNING(fmt [, ...])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b fmt A printf-like format string. | | * <li> \b fmt A printf-like format string. | |
| * <li> \b ... (Optional) Arguments to the format string. | | * <li> \b ... (Optional) Arguments to the format string. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_PRINT_WARNING(...) \ | | #define XLAL_PRINT_WARNING(...) \ | |
| XLALPrintWarningMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) | | XLALPrintWarningMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro that will print an info message with a standard format. | | /** | |
| | | * \brief Macro that will print an info message with a standard format. | |
| * | | * | |
| * Prototype: <b>XLAL_PRINT_INFO(fmt [, ...])</b> | | * Prototype: <b>XLAL_PRINT_INFO(fmt [, ...])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b fmt A printf-like format string. | | * <li> \b fmt A printf-like format string. | |
| * <li> \b ... (Optional) Arguments to the format string. | | * <li> \b ... (Optional) Arguments to the format string. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_PRINT_INFO(...) \ | | #define XLAL_PRINT_INFO(...) \ | |
| XLALPrintInfoMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) | | XLALPrintInfoMessage(__func__, __FILE__, __LINE__, __VA_ARGS__) | |
| | | | |
|
| /* silence gcc warnings about certain (possibly) unused symbols */ | | | |
| #ifdef __GNUC__ | | | |
| #define UNUSED __attribute__ ((unused)) | | | |
| #else | | | |
| #define UNUSED | | | |
| #endif | | | |
| | | | |
| /* | | /* | |
| * | | * | |
| * The LAL specification requires that XLAL functions that return a | | * The LAL specification requires that XLAL functions that return a | |
| * floating-point type (either <tt>REAL4</tt> or <tt>REAL8</tt>) should ret
urn | | * floating-point type (either <tt>REAL4</tt> or <tt>REAL8</tt>) should ret
urn | |
| * a particular value to indicate an error. These values are given by the | | * a particular value to indicate an error. These values are given by the | |
| * macros <tt>XLAL_REAL4_FAIL_NAN</tt> and <tt>XLAL_REAL8_FAIL_NAN</tt> (th
ey | | * macros <tt>XLAL_REAL4_FAIL_NAN</tt> and <tt>XLAL_REAL8_FAIL_NAN</tt> (th
ey | |
| * are Not a Number or NaN values). To implement these we choose hexadecim
al | | * are Not a Number or NaN values). To implement these we choose hexadecim
al | |
| * representations and then provide static functions that return the equiva
lent | | * representations and then provide static functions that return the equiva
lent | |
| * <tt>REAL4</tt> or <tt>REAL8</tt> values. The macros then invoke these | | * <tt>REAL4</tt> or <tt>REAL8</tt> values. The macros then invoke these | |
| * functions. This is done so that the compiler can easily inline the | | * functions. This is done so that the compiler can easily inline the | |
| | | | |
| skipping to change at line 301 | | skipping to change at line 319 | |
| #define XLAL_REAL4_FAIL_NAN_INT 0x7fc001a1 /**< Hexadecimal representation
of <tt>REAL4</tt> NaN failure bit pattern */ | | #define XLAL_REAL4_FAIL_NAN_INT 0x7fc001a1 /**< Hexadecimal representation
of <tt>REAL4</tt> NaN failure bit pattern */ | |
| #define XLAL_REAL8_FAIL_NAN_INT LAL_INT8_C(0x7ff80000000001a1) /**< Hexadec
imal representation of <tt>REAL8</tt> NaN failure bit pattern */ | | #define XLAL_REAL8_FAIL_NAN_INT LAL_INT8_C(0x7ff80000000001a1) /**< Hexadec
imal representation of <tt>REAL8</tt> NaN failure bit pattern */ | |
| | | | |
| /* | | /* | |
| * The floating point values themselves are returned by static functions th
at | | * The floating point values themselves are returned by static functions th
at | |
| * can be easily inlined by the compiler; similarly, the routines to test i
f a | | * can be easily inlined by the compiler; similarly, the routines to test i
f a | |
| * value is the LAL failure NaN can also be inlined. | | * value is the LAL failure NaN can also be inlined. | |
| */ | | */ | |
| | | | |
| /** Returns the value of the XLAL <tt>REAL4</tt> failure NaN. */ | | /** Returns the value of the XLAL <tt>REAL4</tt> failure NaN. */ | |
|
| static REAL4 UNUSED XLALREAL4FailNaN(void) | | static _LAL_INLINE_ REAL4 XLALREAL4FailNaN(void); | |
| | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | static _LAL_INLINE_ REAL4 XLALREAL4FailNaN(void) | |
| { | | { | |
| volatile const union { | | volatile const union { | |
| INT4 i; | | INT4 i; | |
| REAL4 x; | | REAL4 x; | |
| } val = { | | } val = { | |
| XLAL_REAL4_FAIL_NAN_INT}; | | XLAL_REAL4_FAIL_NAN_INT}; | |
| return val.x; | | return val.x; | |
| } | | } | |
|
| | | #endif /* SWIG */ | |
| | | | |
| /** Returns the value of the XLAL <tt>REAL8</tt> failure NaN. */ | | /** Returns the value of the XLAL <tt>REAL8</tt> failure NaN. */ | |
|
| static REAL8 UNUSED XLALREAL8FailNaN(void) | | static _LAL_INLINE_ REAL8 XLALREAL8FailNaN(void); | |
| | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | static _LAL_INLINE_ REAL8 XLALREAL8FailNaN(void) | |
| { | | { | |
| volatile const union { | | volatile const union { | |
| INT8 i; | | INT8 i; | |
| REAL8 x; | | REAL8 x; | |
| } val = { | | } val = { | |
| XLAL_REAL8_FAIL_NAN_INT}; | | XLAL_REAL8_FAIL_NAN_INT}; | |
| return val.x; | | return val.x; | |
| } | | } | |
|
| | | #endif /* SWIG */ | |
| | | | |
| /** Tests if a value is an XLAL <tt>REAL4</tt> failure NaN. */ | | /** Tests if a value is an XLAL <tt>REAL4</tt> failure NaN. */ | |
|
| static int UNUSED XLALIsREAL4FailNaN(REAL4 val) | | static _LAL_INLINE_ int XLALIsREAL4FailNaN(REAL4 val); | |
| | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | static _LAL_INLINE_ int XLALIsREAL4FailNaN(REAL4 val) | |
| { | | { | |
| volatile const union { | | volatile const union { | |
| INT4 i; | | INT4 i; | |
| unsigned char s[4]; | | unsigned char s[4]; | |
| } a = { | | } a = { | |
| XLAL_REAL4_FAIL_NAN_INT}; | | XLAL_REAL4_FAIL_NAN_INT}; | |
| volatile union { | | volatile union { | |
| REAL4 x; | | REAL4 x; | |
| unsigned char s[4]; | | unsigned char s[4]; | |
| } b; | | } b; | |
| size_t n; | | size_t n; | |
| b.x = val; | | b.x = val; | |
| for (n = 0; n < sizeof(val); ++n) | | for (n = 0; n < sizeof(val); ++n) | |
| if (a.s[n] != b.s[n]) | | if (a.s[n] != b.s[n]) | |
| return 0; | | return 0; | |
| return 1; | | return 1; | |
| } | | } | |
|
| | | #endif /* SWIG */ | |
| | | | |
| /** Tests if a value is an XLAL <tt>REAL8</tt> failure NaN. */ | | /** Tests if a value is an XLAL <tt>REAL8</tt> failure NaN. */ | |
|
| static int UNUSED XLALIsREAL8FailNaN(REAL8 val) | | static _LAL_INLINE_ int XLALIsREAL8FailNaN(REAL8 val); | |
| | | #ifndef SWIG /* exclude from SWIG interface */ | |
| | | static _LAL_INLINE_ int XLALIsREAL8FailNaN(REAL8 val) | |
| { | | { | |
| volatile const union { | | volatile const union { | |
| INT8 i; | | INT8 i; | |
| unsigned char s[8]; | | unsigned char s[8]; | |
| } a = { | | } a = { | |
| XLAL_REAL8_FAIL_NAN_INT}; | | XLAL_REAL8_FAIL_NAN_INT}; | |
| volatile union { | | volatile union { | |
| REAL8 x; | | REAL8 x; | |
| unsigned char s[8]; | | unsigned char s[8]; | |
| } b; | | } b; | |
| size_t n; | | size_t n; | |
| b.x = val; | | b.x = val; | |
| for (n = 0; n < sizeof(val); ++n) | | for (n = 0; n < sizeof(val); ++n) | |
| if (a.s[n] != b.s[n]) | | if (a.s[n] != b.s[n]) | |
| return 0; | | return 0; | |
| return 1; | | return 1; | |
| } | | } | |
|
| | | #endif /* SWIG */ | |
| #undef UNUSED | | | |
| | | | |
| /* Here are the macro constants for the fail NaNs. */ | | /* Here are the macro constants for the fail NaNs. */ | |
| #define XLAL_REAL4_FAIL_NAN ( XLALREAL4FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL4</tt> failure NaN. */ | | #define XLAL_REAL4_FAIL_NAN ( XLALREAL4FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL4</tt> failure NaN. */ | |
| #define XLAL_REAL8_FAIL_NAN ( XLALREAL8FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL8</tt> failure NaN. */ | | #define XLAL_REAL8_FAIL_NAN ( XLALREAL8FailNaN() ) /**< Floating-point valu
e of the XLAL <tt>REAL8</tt> failure NaN. */ | |
| | | | |
| /* Here are the macros to test for fail NaNs. */ | | /* Here are the macros to test for fail NaNs. */ | |
| #define XLAL_IS_REAL4_FAIL_NAN(val) XLALIsREAL4FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL4</tt> failure NaN. */ | | #define XLAL_IS_REAL4_FAIL_NAN(val) XLALIsREAL4FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL4</tt> failure NaN. */ | |
| #define XLAL_IS_REAL8_FAIL_NAN(val) XLALIsREAL8FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL8</tt> failure NaN. */ | | #define XLAL_IS_REAL8_FAIL_NAN(val) XLALIsREAL8FailNaN(val) /**< Tests if <
tt>val</tt> is a XLAL <tt>REAL8</tt> failure NaN. */ | |
| | | | |
| /** XLAL error numbers and return values. */ | | /** XLAL error numbers and return values. */ | |
| | | | |
| skipping to change at line 568 | | skipping to change at line 596 | |
| /* | | /* | |
| * | | * | |
| * Here are the routines and macros that are used to report errors when | | * Here are the routines and macros that are used to report errors when | |
| * an XLAL function fails. They (i) set the XLAL error number and (ii) | | * an XLAL function fails. They (i) set the XLAL error number and (ii) | |
| * invoke the XLAL error handler. The macros also (iii) return the | | * invoke the XLAL error handler. The macros also (iii) return the | |
| * appropriate failure codes. The macros should be used to report all | | * appropriate failure codes. The macros should be used to report all | |
| * failures. | | * failures. | |
| * | | * | |
| */ | | */ | |
| | | | |
|
| /** Routine to set the XLAL error number and invoke the XLAL error handler. | | /** | |
| * It is used by the error macros. */ | | * Routine to set the XLAL error number and invoke the XLAL error handler. | |
| | | * It is used by the error macros. | |
| | | */ | |
| void XLALError(const char *func, | | void XLALError(const char *func, | |
| /**< name of function where the error occurs */ | | /**< name of function where the error occurs */ | |
| const char *file, | | const char *file, | |
| /**< source file name (use the __FILE__ macro) */ | | /**< source file name (use the __FILE__ macro) */ | |
| int line, /**< source line number (use the __LINE__ macro)
*/ | | int line, /**< source line number (use the __LINE__ macro)
*/ | |
| int errnum /**< error code */ | | int errnum /**< error code */ | |
| ); | | ); | |
| | | | |
|
| /** \brief Macro to invoke the <tt>XLALError()</tt> function and return | | /** | |
| | | * \brief Macro to invoke the <tt>XLALError()</tt> function and return | |
| * with code val (it should not really be used itself, but forms the basis
for | | * with code val (it should not really be used itself, but forms the basis
for | |
| * other macros). | | * other macros). | |
| * | | * | |
| * Prototype: <b>XLAL_ERROR_VAL(val, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_ERROR_VAL(val, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b val The value to return. | | * <li> \b val The value to return. | |
| * <li> \b errnum The XLAL error number to set. | | * <li> \b errnum The XLAL error number to set. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| | | | |
| skipping to change at line 603 | | skipping to change at line 634 | |
| /* Helper macro for internal use only */ | | /* Helper macro for internal use only */ | |
| #define XLAL_ERROR_VAL_(val, errnum, fmt, ...) \ | | #define XLAL_ERROR_VAL_(val, errnum, fmt, ...) \ | |
| do { \ | | do { \ | |
| if (fmt) { \ | | if (fmt) { \ | |
| XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \ | | XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \ | |
| } \ | | } \ | |
| XLALError(__func__, __FILE__, __LINE__, errnum); \ | | XLALError(__func__, __FILE__, __LINE__, errnum); \ | |
| return val; \ | | return val; \ | |
| } while (0) | | } while (0) | |
| | | | |
|
| /** Macro to invoke a failure from a XLAL routine returning an integer. | | /** | |
| | | * Macro to invoke a failure from a XLAL routine returning an integer. | |
| * | | * | |
| * Prototype: <b>XLAL_ERROR(errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_ERROR(errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b errnum The XLAL error number to set. | | * <li> \b errnum The XLAL error number to set. | |
| * <li> \b fmt (Optional) Format string for additional error informatio
n. | | * <li> \b fmt (Optional) Format string for additional error informatio
n. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_ERROR(...) XLAL_ERROR_VAL(XLAL_FAILURE, __VA_ARGS__) | | #define XLAL_ERROR(...) XLAL_ERROR_VAL(XLAL_FAILURE, __VA_ARGS__) | |
| | | | |
|
| /** Macro to invoke a failure from a XLAL routine returning a pointer. | | /** | |
| | | * Macro to invoke a failure from a XLAL routine returning a pointer. | |
| * | | * | |
| * Prototype: <b>XLAL_ERROR_NULL(errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_ERROR_NULL(errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b errnum The XLAL error number to set. | | * <li> \b errnum The XLAL error number to set. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_ERROR_NULL(...) XLAL_ERROR_VAL(NULL, __VA_ARGS__) | | #define XLAL_ERROR_NULL(...) XLAL_ERROR_VAL(NULL, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro to invoke a failure from a XLAL routine returning void. | | /** | |
| | | * \brief Macro to invoke a failure from a XLAL routine returning void. | |
| * | | * | |
| * Prototype: <b>XLAL_ERROR_VOID(errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_ERROR_VOID(errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b errnum The XLAL error number to set. | | * <li> \b errnum The XLAL error number to set. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_ERROR_VOID(...) XLAL_ERROR_VAL(/* void */, __VA_ARGS__) | | #define XLAL_ERROR_VOID(...) XLAL_ERROR_VAL(/* void */, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro to invoke a failure from a XLAL routine returning a <tt>RE | | /** | |
| AL4</tt>. | | * \brief Macro to invoke a failure from a XLAL routine returning a <tt>REA | |
| | | L4</tt>. | |
| * | | * | |
| * Prototype: <b>XLAL_ERROR_REAL4(errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_ERROR_REAL4(errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b errnum The XLAL error number to set. | | * <li> \b errnum The XLAL error number to set. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_ERROR_REAL4(...) XLAL_ERROR_VAL(XLAL_REAL4_FAIL_NAN, __VA_ARGS
__) | | #define XLAL_ERROR_REAL4(...) XLAL_ERROR_VAL(XLAL_REAL4_FAIL_NAN, __VA_ARGS
__) | |
| | | | |
|
| /** * \brief Macro to invoke a failure from a XLAL routine returning a <tt | | /** | |
| >REAL8</tt>. | | * \brief Macro to invoke a failure from a XLAL routine returning a <tt>REA | |
| | | L8</tt>. | |
| * | | * | |
| * Prototype <b>XLAL_ERROR_REAL8(errnum [, fmt [, ...]])</b> | | * Prototype <b>XLAL_ERROR_REAL8(errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b errnum The XLAL error number to set. | | * <li> \b errnum The XLAL error number to set. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_ERROR_REAL8(...) XLAL_ERROR_VAL(XLAL_REAL8_FAIL_NAN, __VA_ARGS
__) | | #define XLAL_ERROR_REAL8(...) XLAL_ERROR_VAL(XLAL_REAL8_FAIL_NAN, __VA_ARGS
__) | |
| | | | |
|
| /** \brief Macro to test an assertion; if it is not true, invoke the | | /** | |
| | | * \brief Macro to test an assertion; if it is not true, invoke the | |
| * <tt>XLALError()</tt> function and return with code val (it should not re
ally | | * <tt>XLALError()</tt> function and return with code val (it should not re
ally | |
| * be used itself, but forms the basis for other macros). | | * be used itself, but forms the basis for other macros). | |
| * | | * | |
| * Prototype: <b>XLAL_CHECK_VAL(val, assertion, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_CHECK_VAL(val, assertion, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b val The value to return. | | * <li> \b val The value to return. | |
| * <li> \b assertion The assertion to test. | | * <li> \b assertion The assertion to test. | |
| * <li> \b errnum The XLAL error number to set if the assertion is false. | | * <li> \b errnum The XLAL error number to set if the assertion is false. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| | | | |
| skipping to change at line 693 | | skipping to change at line 730 | |
| if (fmt) { \ | | if (fmt) { \ | |
| XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \ | | XLAL_PRINT_ERROR(fmt, __VA_ARGS__); \ | |
| } else { \ | | } else { \ | |
| XLAL_PRINT_ERROR("Check failed: " #assertion
); \ | | XLAL_PRINT_ERROR("Check failed: " #assertion
); \ | |
| } \ | | } \ | |
| XLALError(__func__, __FILE__, __LINE__, errnum); \ | | XLALError(__func__, __FILE__, __LINE__, errnum); \ | |
| return val; \ | | return val; \ | |
| } \ | | } \ | |
| } while (0) | | } while (0) | |
| | | | |
|
| /** * \brief Macro to test an assertion and invoke a failure if it is not | | /** | |
| true | | * \brief Macro to test an assertion and invoke a failure if it is not true | |
| * in a function that returns an integer. | | * in a function that returns an integer. | |
| * | | * | |
| * Prototype: <b>XLAL_CHECK(assertion, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_CHECK(assertion, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b assertion The assertion to test. | | * <li> \b assertion The assertion to test. | |
| * <li> \b errnum The XLAL error number to set if the assertion is false. | | * <li> \b errnum The XLAL error number to set if the assertion is false. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_CHECK(assertion, ...) \ | | #define XLAL_CHECK(assertion, ...) \ | |
| XLAL_CHECK_VAL(XLAL_FAILURE, assertion, __VA_ARGS__) | | XLAL_CHECK_VAL(XLAL_FAILURE, assertion, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro to test an assertion and invoke a failure if it is not tru | | /** | |
| e | | * \brief Macro to test an assertion and invoke a failure if it is not true | |
| * in a function that returns a pointer. | | * in a function that returns a pointer. | |
| * | | * | |
| * Prototype: <b>XLAL_CHECK_NULL(assertion, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_CHECK_NULL(assertion, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b assertion The assertion to test. | | * <li> \b assertion The assertion to test. | |
| * <li> \b errnum The XLAL error number to set if the assertion is false. | | * <li> \b errnum The XLAL error number to set if the assertion is false. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_CHECK_NULL(assertion, ...) \ | | #define XLAL_CHECK_NULL(assertion, ...) \ | |
| XLAL_CHECK_VAL(NULL, assertion, __VA_ARGS__) | | XLAL_CHECK_VAL(NULL, assertion, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro to test an assertion and invoke a failure if it is not tru | | /** | |
| e | | * \brief Macro to test an assertion and invoke a failure if it is not true | |
| * in a function that returns void. | | * in a function that returns void. | |
| * | | * | |
| * Prototype: <b>XLAL_CHECK_VOID(assertion, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_CHECK_VOID(assertion, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b assertion The assertion to test. | | * <li> \b assertion The assertion to test. | |
| * <li> \b errnum The XLAL error number to set if the assertion is false. | | * <li> \b errnum The XLAL error number to set if the assertion is false. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_CHECK_VOID(assertion, ...) \ | | #define XLAL_CHECK_VOID(assertion, ...) \ | |
| XLAL_CHECK_VAL(/* void */, assertion, __VA_ARGS__) | | XLAL_CHECK_VAL(/* void */, assertion, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro to test an assertion and invoke a failure if it is not tru | | /** | |
| e | | * \brief Macro to test an assertion and invoke a failure if it is not true | |
| * in a function that returns a <tt>REAL4</tt>. | | * in a function that returns a <tt>REAL4</tt>. | |
| * | | * | |
| * Prototype: <b>XLAL_CHECK_REAL4(assertion, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_CHECK_REAL4(assertion, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b assertion The assertion to test. | | * <li> \b assertion The assertion to test. | |
| * <li> \b errnum The XLAL error number to set if the assertion is false. | | * <li> \b errnum The XLAL error number to set if the assertion is false. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| */ | | */ | |
| #define XLAL_CHECK_REAL4(assertion, ...) \ | | #define XLAL_CHECK_REAL4(assertion, ...) \ | |
| XLAL_CHECK_VAL(XLAL_REAL4_FAIL_NAN, assertion, __VA_ARGS__) | | XLAL_CHECK_VAL(XLAL_REAL4_FAIL_NAN, assertion, __VA_ARGS__) | |
| | | | |
|
| /** \brief Macro to test an assertion and invoke a failure if it is not tru | | /** | |
| e | | * \brief Macro to test an assertion and invoke a failure if it is not true | |
| * in a function that returns a <tt>REAL8</tt>. | | * in a function that returns a <tt>REAL8</tt>. | |
| * | | * | |
| * Prototype: <b>XLAL_CHECK_REAL8(assertion, errnum [, fmt [, ...]])</b> | | * Prototype: <b>XLAL_CHECK_REAL8(assertion, errnum [, fmt [, ...]])</b> | |
| * | | * | |
| * \b Parameters:<ul> | | * \b Parameters:<ul> | |
| * <li> \b assertion The assertion to test. | | * <li> \b assertion The assertion to test. | |
| * <li> \b errnum The XLAL error number to set if the assertion is false. | | * <li> \b errnum The XLAL error number to set if the assertion is false. | |
| * <li> \b fmt (Optional) Format string for additional error information. | | * <li> \b fmt (Optional) Format string for additional error information. | |
| * <li> \b ... (Optional) Additional arguments for printf-like format. | | * <li> \b ... (Optional) Additional arguments for printf-like format. | |
| * </ul> | | * </ul> | |
| | | | |
End of changes. 35 change blocks. |
| 55 lines changed or deleted | | 93 lines changed or added | |
|
| swiglal_common.i | | swiglal_common.i | |
| | | | |
| skipping to change at line 157 | | skipping to change at line 157 | |
| #else | | #else | |
| #include <assert.h> | | #include <assert.h> | |
| #include <stdlib.h> | | #include <stdlib.h> | |
| #include <stdio.h> | | #include <stdio.h> | |
| #include <string.h> | | #include <string.h> | |
| #include <stdbool.h> | | #include <stdbool.h> | |
| #include <complex.h> | | #include <complex.h> | |
| #endif | | #endif | |
| %} | | %} | |
| | | | |
|
| | | // Remove LAL macros for certain keywords. | |
| | | #define _LAL_INLINE_ | |
| | | #define _LAL_RESTRICT_ | |
| | | | |
| | | // If necessary, redefine 'restrict' keyword for C++ code. | |
| | | %header %{ | |
| | | #ifdef __cplusplus | |
| | | # ifndef restrict | |
| | | # if defined __GNUC__ | |
| | | # define restrict __restrict__ | |
| | | # else | |
| | | # define restrict | |
| | | # endif | |
| | | # endif | |
| | | #endif | |
| | | %} | |
| | | | |
| | | // Include SWIG configuration header generated from 'config.h'. | |
| | | %header %{ | |
| | | #include <swig_config.h> | |
| | | %} | |
| | | | |
| // Include LAL headers. | | // Include LAL headers. | |
| %header %{ | | %header %{ | |
| #include <lal/LALDatatypes.h> | | #include <lal/LALDatatypes.h> | |
| #include <lal/LALMalloc.h> | | #include <lal/LALMalloc.h> | |
| #include <lal/XLALError.h> | | #include <lal/XLALError.h> | |
| #include <lal/Date.h> | | #include <lal/Date.h> | |
| %} | | %} | |
| | | | |
| // Version of SWIG used to generate wrapping code. | | // Version of SWIG used to generate wrapping code. | |
|
| %inline %{const int swig_version = SWIG_VERSION;%} | | %constant int swig_version = SWIG_VERSION; | |
| | | | |
| // Whether wrapping code was generated in debug mode. | | | |
| #ifdef NDEBUG | | | |
| %inline %{const bool swig_debug = false;%} | | | |
| #else | | | |
| %inline %{const bool swig_debug = true;%} | | | |
| #endif | | | |
| | | | |
| // Constructors for GSL complex numbers, if required. | | // Constructors for GSL complex numbers, if required. | |
|
| #ifdef HAVE_LIBGSL | | | |
| %header %{ | | %header %{ | |
|
| #include <gsl/gsl_complex_math.h> // provides gsl_complex_rect() | | #ifdef SWIGLAL_HAVE_LIBGSL | |
| SWIGINTERNINLINE gsl_complex_float gsl_complex_float_rect(float x, float | | #include <gsl/gsl_complex_math.h> // provides gsl_complex_rect() | |
| y) { | | SWIGINTERNINLINE gsl_complex_float gsl_complex_float_rect(float x, float y) | |
| gsl_complex_float z; | | { | |
| GSL_SET_COMPLEX(&z, x, y); | | gsl_complex_float z; | |
| return z; | | GSL_SET_COMPLEX(&z, x, y); | |
| } | | return z; | |
| %} | | } | |
| #endif | | #endif | |
|
| | | %} | |
| | | | |
| // Convert XLAL/LAL errors into native scripting-language exceptions: | | // Convert XLAL/LAL errors into native scripting-language exceptions: | |
| // - XLAL: Before performing any action, clear the XLAL error number. | | // - XLAL: Before performing any action, clear the XLAL error number. | |
| // Check it after the action is performed; if it is non-zero, raise | | // Check it after the action is performed; if it is non-zero, raise | |
| // a native scripting-language exception with the appropriate XLAL | | // a native scripting-language exception with the appropriate XLAL | |
| // error message. | | // error message. | |
| // - LAL: For any function which has a LALStatus* argument, create a | | // - LAL: For any function which has a LALStatus* argument, create a | |
| // blank LALStatus struct and pass its pointer to the LAL function. | | // blank LALStatus struct and pass its pointer to the LAL function. | |
| // After the function is called, check the LALStatus statusCode; | | // After the function is called, check the LALStatus statusCode; | |
| // if it is non-zero, raise a generic XLAL error (to set the XLAL | | // if it is non-zero, raise a generic XLAL error (to set the XLAL | |
| | | | |
| skipping to change at line 260 | | skipping to change at line 275 | |
| | | | |
| ////////// Generate interface ////////// | | ////////// Generate interface ////////// | |
| | | | |
| // The SWIG interface file is generated by 'generate_swiglal_iface.py', whi
ch | | // The SWIG interface file is generated by 'generate_swiglal_iface.py', whi
ch | |
| // extracts lists of interface symbols (functions, structs, typedefs to str
ucts) | | // extracts lists of interface symbols (functions, structs, typedefs to str
ucts) | |
| // and headers from the preprocessing interface, and generates calls to the | | // and headers from the preprocessing interface, and generates calls to the | |
| // following macros: | | // following macros: | |
| | | | |
| // Process an interface function NAME: rename it to RENAME, and set it to | | // Process an interface function NAME: rename it to RENAME, and set it to | |
| // always return SWIG-owned wrapping objects (unless the function is being | | // always return SWIG-owned wrapping objects (unless the function is being | |
|
| // ignored). If IGNORE_TYPE is given, ignore the function's return value. | | // ignored). If RETN_1STARG is true, define 'swiglal_return_1starg_##NAME'. | |
| // If DISOWN is true, disown the function's first argument. | | %define %swiglal_process_function(NAME, RENAME, RETN_1STARG) | |
| %define %swiglal_process_function(NAME, RENAME, IGNORE_TYPE, DISOWN) | | | |
| %rename(#RENAME) NAME; | | %rename(#RENAME) NAME; | |
| #if #RENAME != "$ignore" | | #if #RENAME != "$ignore" | |
| %feature("new", "1") NAME; | | %feature("new", "1") NAME; | |
|
| #if #IGNORE_TYPE != "" | | #if RETN_1STARG | |
| %apply SWIGTYPE SWIGLAL_RETURN_VOID { IGNORE_TYPE NAME }; | | %header {#define swiglal_return_1starg_##NAME} | |
| #endif | | | |
| #if DISOWN | | | |
| %feature("del", "1") NAME; | | | |
| #endif | | #endif | |
| #endif | | #endif | |
| %enddef | | %enddef | |
| | | | |
| // Process a typedef to an interface struct TAGNAME: rename it to RENAME. | | // Process a typedef to an interface struct TAGNAME: rename it to RENAME. | |
| %define %swiglal_process_tdstruct(TAGNAME, RENAME) | | %define %swiglal_process_tdstruct(TAGNAME, RENAME) | |
| %rename(#RENAME) TAGNAME; | | %rename(#RENAME) TAGNAME; | |
| %enddef | | %enddef | |
| | | | |
| // Do not generate any default (copy) contructors or destructors. | | // Do not generate any default (copy) contructors or destructors. | |
| | | | |
| skipping to change at line 301 | | skipping to change at line 312 | |
| %enddef | | %enddef | |
| | | | |
| // Generate constructors and destructors for a struct NAME. | | // Generate constructors and destructors for a struct NAME. | |
| %define %swiglal_generate_struct_cdtor(NAME, TAGNAME, OPAQUE, DTORFUNC) | | %define %swiglal_generate_struct_cdtor(NAME, TAGNAME, OPAQUE, DTORFUNC) | |
| | | | |
| // If this is an opaque struct: | | // If this is an opaque struct: | |
| #if OPAQUE | | #if OPAQUE | |
| | | | |
| // Create an empty struct to represent the opaque struct, | | // Create an empty struct to represent the opaque struct, | |
| // so that SWIG has something to attach the destructor to. | | // so that SWIG has something to attach the destructor to. | |
|
| | | // No constructors are generated, since it is assumed that | |
| | | // the struct will be created internally by some function | |
| | | // and returned. | |
| struct TAGNAME { | | struct TAGNAME { | |
| }; | | }; | |
| | | | |
| #else | | #else | |
| | | | |
|
| // If there is no XLAL destructor function, this is taken to mean | | // Generate constructors, using XLALCalloc() to allocate memory. | |
| // this struct can be validly constructed using XLALCalloc(), i.e. | | %extend TAGNAME { | |
| // it contains no pointers which must also be initialised. | | TAGNAME() { | |
| #if #DTORFUNC == "" | | NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME*); | |
| %extend TAGNAME { | | return self; | |
| TAGNAME() { | | } | |
| NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME* | | TAGNAME(NAME* src) { | |
| ); | | NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME*); | |
| return self; | | memcpy(self, src, sizeof(NAME)); | |
| } | | return self; | |
| TAGNAME(NAME* src) { | | | |
| NAME* self = %reinterpret_cast(XLALCalloc(1, sizeof(NAME)), NAME* | | | |
| ); | | | |
| memcpy(self, src, sizeof(NAME)); | | | |
| return self; | | | |
| } | | | |
| } | | } | |
|
| #endif | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
|
| // If there is no XLAL destructor function, this is taken to mean | | // Generate destructor, using either the destructor function DTORFUNC, | |
| // this struct can be validly destroyed using XLALFree(), i.e. | | // or else XLALFree() if DTORFUNC is undefined, to destroy memory. | |
| // it contains no pointers which must first be destroyed. Otherwise, | | | |
| // use the XLAL destructor function. | | | |
| #if #DTORFUNC == "" | | #if #DTORFUNC == "" | |
| %extend TAGNAME { | | %extend TAGNAME { | |
| ~TAGNAME() { | | ~TAGNAME() { | |
| %swiglal_call_dtor(XLALFree, $self); | | %swiglal_call_dtor(XLALFree, $self); | |
| } | | } | |
| } | | } | |
| #else | | #else | |
| %extend TAGNAME { | | %extend TAGNAME { | |
| ~TAGNAME() { | | ~TAGNAME() { | |
| %swiglal_call_dtor(%arg(DTORFUNC), $self); | | %swiglal_call_dtor(%arg(DTORFUNC), $self); | |
| | | | |
| skipping to change at line 454 | | skipping to change at line 462 | |
| // Call the appropriate conversion function for C TYPE arrays. | | // Call the appropriate conversion function for C TYPE arrays. | |
| #define %swiglal_array_copyin(TYPE) %swiglal_array_copyin_func($typemap(swi
glal_array_typeid, TYPE)) | | #define %swiglal_array_copyin(TYPE) %swiglal_array_copyin_func($typemap(swi
glal_array_typeid, TYPE)) | |
| #define %swiglal_array_copyout(TYPE) %swiglal_array_copyout_func($typemap(s
wiglal_array_typeid, TYPE)) | | #define %swiglal_array_copyout(TYPE) %swiglal_array_copyout_func($typemap(s
wiglal_array_typeid, TYPE)) | |
| #define %swiglal_array_viewout(TYPE) %swiglal_array_viewout_func($typemap(s
wiglal_array_typeid, TYPE)) | | #define %swiglal_array_viewout(TYPE) %swiglal_array_viewout_func($typemap(s
wiglal_array_typeid, TYPE)) | |
| | | | |
| // | | // | |
| // Typemaps which convert to/from fixed-size arrays. | | // Typemaps which convert to/from fixed-size arrays. | |
| // | | // | |
| | | | |
| // Input typemaps for functions and structs: | | // Input typemaps for functions and structs: | |
|
| %typemap(in) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] { | | %typemap(in, noblock=1) SWIGTYPE[ANY], SWIGTYPE INOUT[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0]; | |
| const size_t strides[] = {1}; | | $1 = &temp$argnum[0]; | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; | | { | |
| $1 = &temp[0]; | | const size_t dims[] = {$1_dim0}; | |
| // swiglal_array_typeid input type: $1_type | | const size_t strides[] = {1}; | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as | | // swiglal_array_typeid input type: $1_type | |
| _voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, % | |
| sizeof($1[0]), 1, dims, stride | | as_voidptr($1), | |
| s, | | sizeof($1[0]), 1, dim | |
| false, $typemap(swiglal_fixarr | | s, strides, | |
| _tinfo, $1_type), | | false, $typemap(swigl | |
| $disown | %convertptr_flags); | | al_fixarr_tinfo, $1_type), | |
| if (!SWIG_IsOK(ecode)) { | | $disown | %convertptr | |
| %argument_fail(ecode, "$type", $symname, $argnum); | | _flags); | |
| | | if (!SWIG_IsOK(ecode)) { | |
| | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| | | } | |
| } | | } | |
| } | | } | |
|
| %typemap(in) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | | %typemap(in, noblock=1) SWIGTYPE[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0][$1_dim1]; | |
| const size_t strides[] = {$1_dim1, 1}; | | $1 = &temp$argnum[0]; | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; | | { | |
| $1 = &temp[0]; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| // swiglal_array_typeid input type: $1_type | | const size_t strides[] = {$1_dim1, 1}; | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as | | // swiglal_array_typeid input type: $1_type | |
| _voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, % | |
| sizeof($1[0][0]), 2, dims, str | | as_voidptr($1), | |
| ides, | | sizeof($1[0][0]), 2, dims, s | |
| false, $typemap(swiglal_fixarr | | trides, | |
| _tinfo, $1_type), | | false, $typemap(swiglal_fixa | |
| $disown | %convertptr_flags); | | rr_tinfo, $1_type), | |
| if (!SWIG_IsOK(ecode)) { | | $disown | %convertptr_flags) | |
| %argument_fail(ecode, "$type", $symname, $argnum); | | ; | |
| | | if (!SWIG_IsOK(ecode)) { | |
| | | %argument_fail(ecode, "$type", $symname, $argnum); | |
| | | } | |
| } | | } | |
| } | | } | |
| | | | |
| // Input typemaps for global variables: | | // Input typemaps for global variables: | |
| %typemap(varin) SWIGTYPE[ANY] { | | %typemap(varin) SWIGTYPE[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | const size_t dims[] = {$1_dim0}; | |
| const size_t strides[] = {1}; | | const size_t strides[] = {1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | | int ecode = %swiglal_array_copyin($1_type)(swiglal_no_self(), $input, %as
_voidptr($1), | |
| sizeof($1[0]), 1, dims, stride
s, | | sizeof($1[0]), 1, dims, stride
s, | |
| | | | |
| skipping to change at line 564 | | skipping to change at line 576 | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| const size_t strides[] = {$1_dim1, 1}; | | const size_t strides[] = {$1_dim1, 1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | | %set_output(%swiglal_array_viewout($1_type)(swiglal_no_self(), %as_voidpt
r($1), | |
| sizeof($1[0][0]), 2, dims, st
rides, | | sizeof($1[0][0]), 2, dims, st
rides, | |
| false, $typemap(swiglal_fixar
r_tinfo, $1_type), | | false, $typemap(swiglal_fixar
r_tinfo, $1_type), | |
| %newpointer_flags)); | | %newpointer_flags)); | |
| } | | } | |
| | | | |
| // Argument-output typemaps for functions: | | // Argument-output typemaps for functions: | |
|
| %typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY] { | | %typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY] { | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0]; | | $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0]; | |
| $1 = &temp[0]; | | $1 = &temp$argnum[0]; | |
| } | | } | |
| %typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] { | | %typemap(argout) SWIGTYPE OUTPUT[ANY], SWIGTYPE INOUT[ANY] { | |
| const size_t dims[] = {$1_dim0}; | | const size_t dims[] = {$1_dim0}; | |
| const size_t strides[] = {1}; | | const size_t strides[] = {1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | | %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | |
| sizeof($1[0]), 1, dims, st
rides, | | sizeof($1[0]), 1, dims, st
rides, | |
| false, $typemap(swiglal_fi
xarr_tinfo, $1_type), | | false, $typemap(swiglal_fi
xarr_tinfo, $1_type), | |
| SWIG_POINTER_OWN | %newpoi
nter_flags)); | | SWIG_POINTER_OWN | %newpoi
nter_flags)); | |
| } | | } | |
|
| %typemap(in, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] { | | %typemap(in, noblock=1, numinputs=0) SWIGTYPE OUTPUT[ANY][ANY] { | |
| $typemap(swiglal_fixarr_ltype, $1_type) temp[$1_dim0][$1_dim1]; | | $typemap(swiglal_fixarr_ltype, $1_type) temp$argnum[$1_dim0][$1_dim1]; | |
| $1 = &temp[0]; | | $1 = &temp$argnum[0]; | |
| } | | } | |
| %typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | | %typemap(argout) SWIGTYPE OUTPUT[ANY][ANY], SWIGTYPE INOUT[ANY][ANY] { | |
| const size_t dims[] = {$1_dim0, $1_dim1}; | | const size_t dims[] = {$1_dim0, $1_dim1}; | |
| const size_t strides[] = {$1_dim1, 1}; | | const size_t strides[] = {$1_dim1, 1}; | |
| // swiglal_array_typeid input type: $1_type | | // swiglal_array_typeid input type: $1_type | |
| %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | | %append_output(%swiglal_array_copyout($1_type)(swiglal_no_self(), %as_voi
dptr($1), | |
| sizeof($1[0][0]), 2, dims,
strides, | | sizeof($1[0][0]), 2, dims,
strides, | |
| false, $typemap(swiglal_fi
xarr_tinfo, $1_type), | | false, $typemap(swiglal_fi
xarr_tinfo, $1_type), | |
| SWIG_POINTER_OWN | %newpoi
nter_flags)); | | SWIG_POINTER_OWN | %newpoi
nter_flags)); | |
| } | | } | |
| | | | |
| skipping to change at line 851 | | skipping to change at line 863 | |
| %enddef | | %enddef | |
| #define %swiglal_public_clear_FUNCTION_POINTER(...) | | #define %swiglal_public_clear_FUNCTION_POINTER(...) | |
| | | | |
| // The SWIGLAL(IMMUTABLE_MEMBERS(TAGNAME, ...)) macro can be used to make | | // The SWIGLAL(IMMUTABLE_MEMBERS(TAGNAME, ...)) macro can be used to make | |
| // the listed members of the struct TAGNAME immutable. | | // the listed members of the struct TAGNAME immutable. | |
| %define %swiglal_public_IMMUTABLE_MEMBERS(TAGNAME, ...) | | %define %swiglal_public_IMMUTABLE_MEMBERS(TAGNAME, ...) | |
| %swiglal_map_abc(%swiglal_feature_nspace, "immutable", "1", TAGNAME, __VA_A
RGS__); | | %swiglal_map_abc(%swiglal_feature_nspace, "immutable", "1", TAGNAME, __VA_A
RGS__); | |
| %enddef | | %enddef | |
| #define %swiglal_public_clear_IMMUTABLE_MEMBERS(...) | | #define %swiglal_public_clear_IMMUTABLE_MEMBERS(...) | |
| | | | |
|
| | | // Typemap for functions which return 'int'. If these functions also return | |
| | | // other output arguments (via 'argout' typemaps), the 'int' return value i | |
| | | s | |
| | | // ignored. This is because 'int' is very commonly used to return an XLAL | |
| | | // error code, which will be converted into a native scripting-language | |
| | | // exception, and so the error code itself is not needed directly. To avoid | |
| | | // having to unpack the error code when collecting the other output argumen | |
| | | ts, | |
| | | // therefore, it is ignored in the wrappings. Functions which fit this crit | |
| | | eria | |
| | | // but do return a useful 'int' can use SWIGLAL(RETURN_VALUE(int, ...)) to | |
| | | // disable this behaviour. | |
| | | // | |
| | | // For functions, since %feature("new") is set, the 'out' typemap will have | |
| | | $owner=1, | |
| | | // and the 'newfree' typemap is also applied. The 'out' typemap ignores the | |
| | | 'int' | |
| | | // return value by setting the output argument list to VOID_Object; the wra | |
| | | pping | |
| | | // function them proceeds to add other output arguments to the list, if any | |
| | | . After | |
| | | // this, the 'newfree' typemap is triggered, which appends the 'int' return | |
| | | if the | |
| | | // output argument list is empty, using the scripting-language-specific mac | |
| | | ro | |
| | | // swiglal_append_output_if_empty(). For structs, $owner=0, so the int retu | |
| | | rn is | |
| | | // set straight away, and the 'newfree' typemap is never applied. | |
| | | %typemap(out, noblock=1, fragment=SWIG_From_frag(int)) int { | |
| | | %#if $owner | |
| | | %set_output(VOID_Object); | |
| | | %#else | |
| | | %set_output(SWIG_From(int)($1)); | |
| | | %#endif | |
| | | } | |
| | | %typemap(newfree, noblock=1, fragment=SWIG_From_frag(int)) int { | |
| | | swiglal_append_output_if_empty(SWIG_From(int)($1)); | |
| | | } | |
| | | | |
| // Typemaps for empty arguments. These typemaps are useful when no input fr
om the | | // Typemaps for empty arguments. These typemaps are useful when no input fr
om the | |
| // scripting language is required, and an empty struct needs to be supplied
to | | // scripting language is required, and an empty struct needs to be supplied
to | |
| // the C function. The SWIGLAL(EMPTY_ARGUMENT(TYPE, ...)) macro applies the
typemap which | | // the C function. The SWIGLAL(EMPTY_ARGUMENT(TYPE, ...)) macro applies the
typemap which | |
| // supplies a static struct, while the SWIGLAL(NEW_EMPTY_ARGUMENT(TYPE, ...
)) macro | | // supplies a static struct, while the SWIGLAL(NEW_EMPTY_ARGUMENT(TYPE, ...
)) macro | |
|
| // applies the typemap which supplies a dynamically-allocated struct. | | // applies the typemap which supplies a dynamically-allocated struct. These | |
| | | typemaps | |
| | | // may cause there to be no SWIG-wrapped object for the first argument; if | |
| | | so, | |
| | | // 'swiglal_no_1starg' is defined for the duration of the wrapping function | |
| | | . | |
| %define %swiglal_public_EMPTY_ARGUMENT(TYPE, ...) | | %define %swiglal_public_EMPTY_ARGUMENT(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT, TYPE, __V
A_ARGS__); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT, TYPE, __V
A_ARGS__); | |
| %enddef | | %enddef | |
| %define %swiglal_public_clear_EMPTY_ARGUMENT(TYPE, ...) | | %define %swiglal_public_clear_EMPTY_ARGUMENT(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
| %typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT ($*lt
ype emptyarg) { | | %typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT ($*lt
ype emptyarg) { | |
| memset(&emptyarg, 0, sizeof($*type)); | | memset(&emptyarg, 0, sizeof($*type)); | |
| $1 = &emptyarg; | | $1 = &emptyarg; | |
|
| | | %#if $argnum == 1 | |
| | | %#define swiglal_no_1starg | |
| | | %#endif | |
| | | } | |
| | | %typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT { | |
| | | %#undef swiglal_no_1starg | |
| } | | } | |
|
| %typemap(freearg) SWIGTYPE* SWIGLAL_EMPTY_ARGUMENT ""; | | | |
| %define %swiglal_public_NEW_EMPTY_ARGUMENT(TYPE, ...) | | %define %swiglal_public_NEW_EMPTY_ARGUMENT(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT, TYPE,
__VA_ARGS__); | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT, TYPE,
__VA_ARGS__); | |
| %enddef | | %enddef | |
| %define %swiglal_public_clear_NEW_EMPTY_ARGUMENT(TYPE, ...) | | %define %swiglal_public_clear_NEW_EMPTY_ARGUMENT(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
| %typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT { | | %typemap(in, noblock=1, numinputs=0) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT { | |
| $1 = %swiglal_new_instance($*type); | | $1 = %swiglal_new_instance($*type); | |
|
| | | %#if $argnum == 1 | |
| | | %#define swiglal_no_1starg | |
| | | %#endif | |
| | | } | |
| | | %typemap(freearg, noblock=1) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT { | |
| | | %#undef swiglal_no_1starg | |
| } | | } | |
|
| %typemap(freearg) SWIGTYPE* SWIGLAL_NEW_EMPTY_ARGUMENT ""; | | | |
| | | | |
| // SWIG conversion functions for C99 integer types. | | // SWIG conversion functions for C99 integer types. | |
| // These are mapped to the corresponding basic C types, | | // These are mapped to the corresponding basic C types, | |
| // conversion functions for which are supplied by SWIG. | | // conversion functions for which are supplied by SWIG. | |
| %define %swiglal_numeric_typedef(CHECKCODE, BASETYPE, TYPE) | | %define %swiglal_numeric_typedef(CHECKCODE, BASETYPE, TYPE) | |
| %numeric_type_from(TYPE, BASETYPE); | | %numeric_type_from(TYPE, BASETYPE); | |
| %numeric_type_asval(TYPE, BASETYPE, "swiglal_empty_frag", false); | | %numeric_type_asval(TYPE, BASETYPE, "swiglal_empty_frag", false); | |
| %typemaps_primitive(%checkcode(CHECKCODE), TYPE); | | %typemaps_primitive(%checkcode(CHECKCODE), TYPE); | |
| %enddef | | %enddef | |
| %swiglal_numeric_typedef(INT8, signed char, int8_t); | | %swiglal_numeric_typedef(INT8, signed char, int8_t); | |
| | | | |
| skipping to change at line 1024 | | skipping to change at line 1077 | |
| // ownership of the pointer, since it cannot free it (since it is a pointer
-to-const). | | // ownership of the pointer, since it cannot free it (since it is a pointer
-to-const). | |
| %typemap(in,noblock=1) const SWIGTYPE * (void *argp = 0, int res = 0) { | | %typemap(in,noblock=1) const SWIGTYPE * (void *argp = 0, int res = 0) { | |
| res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 /*$disown*/ | %conver
tptr_flags); | | res = SWIG_ConvertPtr($input, &argp, $descriptor, 0 /*$disown*/ | %conver
tptr_flags); | |
| if (!SWIG_IsOK(res)) { | | if (!SWIG_IsOK(res)) { | |
| %argument_fail(res, "$type", $symname, $argnum); | | %argument_fail(res, "$type", $symname, $argnum); | |
| } | | } | |
| $1 = %reinterpret_cast(argp, $ltype); | | $1 = %reinterpret_cast(argp, $ltype); | |
| } | | } | |
| %typemap(freearg) const SWIGTYPE * ""; | | %typemap(freearg) const SWIGTYPE * ""; | |
| | | | |
|
| // Typemap for output SWIGTYPEs. This typemaps will match either the SWIG-w
rapped | | // Typemaps for output SWIGTYPEs. This typemaps will match either the SWIG-
wrapped | |
| // return argument from functions (which will have the SWIG_POINTER_OWN bit
set | | // return argument from functions (which will have the SWIG_POINTER_OWN bit
set | |
| // in $owner) or return a member of a struct through a 'get' functions (in
which | | // in $owner) or return a member of a struct through a 'get' functions (in
which | |
|
| // case SWIG_POINTER_OWN will not be set). If it is the latter case, the fu | | // case SWIG_POINTER_OWN will not be set). They require the following macro | |
| nction | | s: | |
| // swiglal_store_parent() is called to store a reference to the struct cont | | // | |
| aining | | // The macro %swiglal_store_parent() is called to store a reference to the | |
| // the member being accessed, in order to prevent it from being destroyed a | | struct | |
| s long | | // containing the member being accessed, in order to prevent it from being | |
| // as the SWIG-wrapped member object is in scope. The return object is then | | destroyed | |
| always | | // as long as the SWIG-wrapped member object is in scope. The return object | |
| // created with SWIG_POINTER_OWN, so that its destructor will always be cal | | is then | |
| led. | | // always created with SWIG_POINTER_OWN, so that its destructor will always | |
| | | be called. | |
| %define %swiglal_store_parent(PTR, OWNER, SELF) | | %define %swiglal_store_parent(PTR, OWNER, SELF) | |
| %#if !(OWNER & SWIG_POINTER_OWN) | | %#if !(OWNER & SWIG_POINTER_OWN) | |
| if (%as_voidptr(PTR) != NULL) { | | if (%as_voidptr(PTR) != NULL) { | |
| swiglal_store_parent(%as_voidptr(PTR), SELF); | | swiglal_store_parent(%as_voidptr(PTR), SELF); | |
| } | | } | |
| %#endif | | %#endif | |
| %enddef | | %enddef | |
|
| | | // | |
| | | // The macro %swiglal_set_output() sets the output of the wrapping function | |
| | | . If the | |
| | | // (pointer) return type of the function is the same as its first argument, | |
| | | then | |
| | | // 'swiglal_return_1starg_##NAME' is defined. Unless 'swiglal_no_1starg' is | |
| | | defined | |
| | | // (in which case the first argument is being handled by e.g. the EMPTY_ARG | |
| | | UMENT | |
| | | // typemap), the macro compares the pointer of the return value (result) to | |
| | | that of | |
| | | // the first argument (arg1). If they're equal, the SWIG-wrapped function w | |
| | | ill return | |
| | | // a *reference* to the SWIG object wrapping the first argument, i.e. the s | |
| | | ame object | |
| | | // with its reference count incremented. That way, if the return value is a | |
| | | ssigned to | |
| | | // a different scripting-language variable than the first argument, the und | |
| | | erlying | |
| | | // C struct will not be destroyed until both scripting-language variables a | |
| | | re cleared. | |
| | | // If the pointers are not equal, or one pointer is NULL, the macro return | |
| | | a SWIG | |
| | | // object wrapping the new C struct. | |
| | | %define %swiglal_set_output(NAME, OBJ) | |
| | | %#if defined(swiglal_return_1starg_##NAME) && !defined(swiglal_no_1starg) | |
| | | if (result != NULL && result == arg1) { | |
| | | %set_output(swiglal_get_reference(swiglal_1starg())); | |
| | | } else { | |
| | | %set_output(OBJ); | |
| | | } | |
| | | %#else | |
| | | %set_output(OBJ); | |
| | | %#endif | |
| | | %enddef | |
| | | // | |
| | | // Typemaps: | |
| %typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] { | | %typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] { | |
| %swiglal_store_parent($1, $owner, swiglal_self()); | | %swiglal_store_parent($1, $owner, swiglal_self()); | |
|
| %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) | SWIG_POINTER_OWN)); | | %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr($1), $descrip
tor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out,noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[
] { | | %typemap(out,noblock=1) const SWIGTYPE *, const SWIGTYPE &, const SWIGTYPE[
] { | |
| %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) & ~SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out, noblock=1) SWIGTYPE *const& { | | %typemap(out, noblock=1) SWIGTYPE *const& { | |
| %swiglal_store_parent(*$1, $owner, swiglal_self()); | | %swiglal_store_parent(*$1, $owner, swiglal_self()); | |
|
| %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner |
%newpointer_flags) | SWIG_POINTER_OWN)); | | %swiglal_set_output($1_name, SWIG_NewPointerObj(%as_voidptr(*$1), $*descr
iptor, ($owner | %newpointer_flags) | SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out, noblock=1) const SWIGTYPE *const& { | | %typemap(out, noblock=1) const SWIGTYPE *const& { | |
| %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner |
%newpointer_flags) & ~SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, ($owner |
%newpointer_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(out, noblock=1) SWIGTYPE (void* copy = NULL) { | | %typemap(out, noblock=1) SWIGTYPE (void* copy = NULL) { | |
| copy = %swiglal_new_copy($1, $ltype); | | copy = %swiglal_new_copy($1, $ltype); | |
| %swiglal_store_parent(copy, SWIG_POINTER_OWN, swiglal_self()); | | %swiglal_store_parent(copy, SWIG_POINTER_OWN, swiglal_self()); | |
| %set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) |
SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(copy, $&descriptor, (%newpointer_flags) |
SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] { | | %typemap(varout, noblock=1) SWIGTYPE *, SWIGTYPE [] { | |
| %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpoin
ter_flags) & ~SWIG_POINTER_OWN)); | | %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, (%newpoin
ter_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(varout, noblock=1) SWIGTYPE & { | | %typemap(varout, noblock=1) SWIGTYPE & { | |
| %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpoi
nter_flags) & ~SWIG_POINTER_OWN)); | | %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, (%newpoi
nter_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| %typemap(varout, noblock=1) SWIGTYPE { | | %typemap(varout, noblock=1) SWIGTYPE { | |
| %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpo
inter_flags) & ~SWIG_POINTER_OWN)); | | %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, (%newpo
inter_flags) & ~SWIG_POINTER_OWN)); | |
| } | | } | |
| | | | |
|
| // The SWIGLAL(GET_OBJECT(...)) macro is used when a function returns an ob
ject whose | | // The SWIGLAL(RETURNS_PROPERTY(...)) macro is used when a function returns
an object whose | |
| // memory is owned by the object supplied as the first argument to the func
tion. | | // memory is owned by the object supplied as the first argument to the func
tion. | |
| // Typically this occurs when the function is returning some property of it
s first | | // Typically this occurs when the function is returning some property of it
s first | |
| // argument. The macro applies a typemap which calles swiglal_store_parent(
) to store | | // argument. The macro applies a typemap which calles swiglal_store_parent(
) to store | |
| // a reference to the first argument as the 'parent' of the return argument
, so that | | // a reference to the first argument as the 'parent' of the return argument
, so that | |
| // the parent will not be destroyed as long as the return value is in scope
. | | // the parent will not be destroyed as long as the return value is in scope
. | |
|
| %define %swiglal_public_GET_OBJECT(TYPE, ...) | | %define %swiglal_public_RETURNS_PROPERTY(TYPE, ...) | |
| %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_GET_OBJECT, TYPE, __VA_AR | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE* SWIGLAL_RETURNS_PROPERTY, TYPE, _ | |
| GS__); | | _VA_ARGS__); | |
| %enddef | | %enddef | |
|
| %define %swiglal_public_clear_GET_OBJECT(TYPE, ...) | | %define %swiglal_public_clear_RETURNS_PROPERTY(TYPE, ...) | |
| %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| %enddef | | %enddef | |
|
| %typemap(out,noblock=1) SWIGTYPE* SWIGLAL_GET_OBJECT { | | %typemap(out,noblock=1) SWIGTYPE* SWIGLAL_RETURNS_PROPERTY { | |
| | | %#ifndef swiglal_no_1starg | |
| %swiglal_store_parent($1, 0, swiglal_1starg()); | | %swiglal_store_parent($1, 0, swiglal_1starg()); | |
|
| | | %#endif | |
| %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) | SWIG_POINTER_OWN)); | | %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, ($owner | %n
ewpointer_flags) | SWIG_POINTER_OWN)); | |
| } | | } | |
| | | | |
|
| | | // The SWIGLAL(ACQUIRES_OWNERSHIP(...)) macro indicates that a function wil | |
| | | l acquire ownership | |
| | | // of a particular argument, e.g. by storing that argument in some containe | |
| | | r, and that therefore | |
| | | // the SWIG object wrapping that argument should no longer own its memory. | |
| | | %define %swiglal_public_ACQUIRES_OWNERSHIP(TYPE, ...) | |
| | | %swiglal_map_ab(%swiglal_apply, SWIGTYPE* DISOWN, TYPE, __VA_ARGS__); | |
| | | %enddef | |
| | | %define %swiglal_public_clear_ACQUIRES_OWNERSHIP(TYPE, ...) | |
| | | %swiglal_map_a(%swiglal_clear, TYPE, __VA_ARGS__); | |
| | | %enddef | |
| | | | |
| // Typemaps for pointers to primitive scalars. These are treated as output-
only | | // Typemaps for pointers to primitive scalars. These are treated as output-
only | |
| // arguments by default, by globally applying the SWIG OUTPUT typemaps. The
INOUT | | // arguments by default, by globally applying the SWIG OUTPUT typemaps. The
INOUT | |
| // typemaps can be supplied as needed using the SWIGLAL(INOUT_SCALARS(TYPE,
...)) macro. | | // typemaps can be supplied as needed using the SWIGLAL(INOUT_SCALARS(TYPE,
...)) macro. | |
| %apply int* OUTPUT { enum SWIGTYPE* }; | | %apply int* OUTPUT { enum SWIGTYPE* }; | |
| %apply short* OUTPUT { short* }; | | %apply short* OUTPUT { short* }; | |
| %apply unsigned short* OUTPUT { unsigned short* }; | | %apply unsigned short* OUTPUT { unsigned short* }; | |
| %apply int* OUTPUT { int* }; | | %apply int* OUTPUT { int* }; | |
| %apply unsigned int* OUTPUT { unsigned int* }; | | %apply unsigned int* OUTPUT { unsigned int* }; | |
| %apply long* OUTPUT { long* }; | | %apply long* OUTPUT { long* }; | |
| %apply unsigned long* OUTPUT { unsigned long* }; | | %apply unsigned long* OUTPUT { unsigned long* }; | |
| | | | |
End of changes. 32 change blocks. |
| 104 lines changed or deleted | | 222 lines changed or added | |
|
| swiglal_python.i | | swiglal_python.i | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| | | | |
| // Include NumPy headers in wrapping code, and ensure that | | // Include NumPy headers in wrapping code, and ensure that | |
| // NumPy array module is loaded along with this module. | | // NumPy array module is loaded along with this module. | |
| %header %{ | | %header %{ | |
| #include <numpy/arrayobject.h> | | #include <numpy/arrayobject.h> | |
| %} | | %} | |
| %init %{ | | %init %{ | |
| import_array(); | | import_array(); | |
| %} | | %} | |
| | | | |
|
| // Name of PyObject containing the SWIG wrapping of the 'this' | | // Include compatibility code for NumPy API < 1.7 | |
| // pointer, i.e. the struct whose members are being accessed. | | | |
| %header %{ | | %header %{ | |
|
| #define swiglal_self() self | | #if !SWIGLAL_HAVE_DECL_NPY_ARRAY_WRITEABLE | |
| #define swiglal_no_self() NULL | | #define NPY_ARRAY_WRITEABLE NPY_WRITEABLE | |
| | | #endif | |
| | | #if !SWIGLAL_HAVE_DECL_PYARRAY_SETBASEOBJECT | |
| | | #define PyArray_SetBaseObject(arr, obj) do { (arr)->base = (obj); } while(0 | |
| | | ) | |
| | | #endif | |
| | | %} | |
| | | | |
| | | // Name of PyObject containing the SWIG wrapping of the struct whose member | |
| | | s are being accessed. | |
| | | %header %{ | |
| | | #define swiglal_self() (self) | |
| | | #define swiglal_no_self() (NULL) | |
| | | %} | |
| | | | |
| | | // Name of PyObject containing the SWIG wrapping of the first argument to a | |
| | | function. | |
| | | %header %{ | |
| | | #define swiglal_1starg() (obj0) | |
| | | %} | |
| | | | |
| | | // Return a reference to the supplied PyObject; increment its reference cou | |
| | | nt, then return it. | |
| | | %header %{ | |
| | | static inline PyObject* swiglal_get_reference(PyObject* v) { Py_XINCREF(v); | |
| | | return v; } | |
| %} | | %} | |
| | | | |
|
| // Name of PyObject containing the SWIG wrapping of the | | // Append an argument to the output argument list of an Python SWIG-wrapped | |
| // first argument to a function. | | function, if the list is empty. | |
| %header %{ | | %header %{ | |
|
| #define swiglal_1starg() obj0 | | #define swiglal_append_output_if_empty(v) \ | |
| | | if (resultobj == Py_None) resultobj = SWIG_Python_AppendOutput(resultobj, | |
| | | v) | |
| %} | | %} | |
| | | | |
| ////////// SWIG directives for operators ////////// | | ////////// SWIG directives for operators ////////// | |
| | | | |
| // These macros apply the correct python:slot directives | | // These macros apply the correct python:slot directives | |
| // to map Python __operator__ functions (which may be | | // to map Python __operator__ functions (which may be | |
| // defined in %extend) to the correct PyTypeObject slots. | | // defined in %extend) to the correct PyTypeObject slots. | |
| | | | |
| // Unary operators which do not return a new object. | | // Unary operators which do not return a new object. | |
| %define %swiglal_py_ury_op(NAME, FUNCTYPE, SLOT) | | %define %swiglal_py_ury_op(NAME, FUNCTYPE, SLOT) | |
| | | | |
| skipping to change at line 400 | | skipping to change at line 419 | |
| | | | |
| // Array of NumPy types that a NumPy object-view array can be safely cast
to. | | // Array of NumPy types that a NumPy object-view array can be safely cast
to. | |
| static int swiglal_py_array_objview_copyswap_cancastto[2] = {NPY_OBJECT,
NPY_NOTYPE}; | | static int swiglal_py_array_objview_copyswap_cancastto[2] = {NPY_OBJECT,
NPY_NOTYPE}; | |
| | | | |
| // NumPy array descriptor function for copying/byte-swapping an array ele
ment. | | // NumPy array descriptor function for copying/byte-swapping an array ele
ment. | |
| static void swiglal_py_array_objview_copyswap(void* dst, void* src, int s
wap, void* arr) { | | static void swiglal_py_array_objview_copyswap(void* dst, void* src, int s
wap, void* arr) { | |
| | | | |
| // Check input. | | // Check input. | |
| assert(arr != NULL); | | assert(arr != NULL); | |
| PyArrayObject* nparr = (PyArrayObject*)arr; | | PyArrayObject* nparr = (PyArrayObject*)arr; | |
|
| assert(nparr->descr != NULL); | | assert(PyArray_DESCR(nparr) != NULL); | |
| | | | |
| // Copy array element. | | // Copy array element. | |
| if (src != NULL) { | | if (src != NULL) { | |
|
| memcpy(dst, src, nparr->descr->elsize); | | memcpy(dst, src, PyArray_DESCR(nparr)->elsize); | |
| } | | } | |
| | | | |
| // Byte-swap array element, if required. | | // Byte-swap array element, if required. | |
| if (swap) { | | if (swap) { | |
|
| const size_t n = nparr->descr->elsize / 2; | | const size_t n = PyArray_DESCR(nparr)->elsize / 2; | |
| char *a, *b, c; | | char *a, *b, c; | |
| a = (char *)dst; | | a = (char *)dst; | |
|
| b = a + (nparr->descr->elsize-1); | | b = a + (PyArray_DESCR(nparr)->elsize-1); | |
| for (size_t i = 0; i < n; i++) { | | for (size_t i = 0; i < n; i++) { | |
| c = *a; | | c = *a; | |
| *a++ = *b; | | *a++ = *b; | |
| *b-- = c; | | *b-- = c; | |
| } | | } | |
| } | | } | |
| | | | |
| } | | } | |
| | | | |
| } // fragment swiglal_py_array_objview | | } // fragment swiglal_py_array_objview | |
| | | | |
| skipping to change at line 454 | | skipping to change at line 473 | |
| fragment=INFRAG, fragment=OUTFRAG) | | fragment=INFRAG, fragment=OUTFRAG) | |
| { | | { | |
| | | | |
| // NumPy array descriptor function which gets an element from the viewed
array. | | // NumPy array descriptor function which gets an element from the viewed
array. | |
| static PyObject* swiglal_py_array_objview_##ACFTYPE##_getitem(void* elemp
tr, void* arr) { | | static PyObject* swiglal_py_array_objview_##ACFTYPE##_getitem(void* elemp
tr, void* arr) { | |
| | | | |
| // Check input. | | // Check input. | |
| assert(elemptr != NULL); | | assert(elemptr != NULL); | |
| assert(arr != NULL); | | assert(arr != NULL); | |
| PyArrayObject* nparr = (PyArrayObject*)arr; | | PyArrayObject* nparr = (PyArrayObject*)arr; | |
|
| assert(nparr->descr != NULL); | | assert(PyArray_DESCR(nparr) != NULL); | |
| | | | |
| // Look up the SWIG type descriptor for this array. | | // Look up the SWIG type descriptor for this array. | |
| bool isptr; | | bool isptr; | |
| swig_type_info* tinfo = NULL; | | swig_type_info* tinfo = NULL; | |
|
| swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, nparr->descr); | | swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, PyArray_DESCR(nparr))
; | |
| assert(tinfo != NULL); | | assert(tinfo != NULL); | |
| | | | |
| // Get the Python object wrapping the C array element. | | // Get the Python object wrapping the C array element. | |
| const int tflags = 0; | | const int tflags = 0; | |
|
| PyObject* parent = nparr->base; | | PyObject* parent = PyArray_BASE(nparr); | |
| return OUTCALL; | | return OUTCALL; | |
| | | | |
| } | | } | |
| | | | |
| // NumPy array descriptor function which assigns an element in the viewed
array. | | // NumPy array descriptor function which assigns an element in the viewed
array. | |
| static int swiglal_py_array_objview_##ACFTYPE##_setitem(PyObject* objelem
, void* elemptr, void* arr) { | | static int swiglal_py_array_objview_##ACFTYPE##_setitem(PyObject* objelem
, void* elemptr, void* arr) { | |
| | | | |
| // Check input. | | // Check input. | |
| assert(elemptr != NULL); | | assert(elemptr != NULL); | |
| assert(arr != NULL); | | assert(arr != NULL); | |
| PyArrayObject* nparr = (PyArrayObject*)arr; | | PyArrayObject* nparr = (PyArrayObject*)arr; | |
|
| assert(nparr->descr != NULL); | | assert(PyArray_DESCR(nparr) != NULL); | |
| | | | |
| // Look up the SWIG type descriptor for this array. | | // Look up the SWIG type descriptor for this array. | |
| bool isptr; | | bool isptr; | |
| swig_type_info* tinfo = NULL; | | swig_type_info* tinfo = NULL; | |
|
| swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, nparr->descr); | | swiglal_py_array_tinfo_from_descr(&isptr, &tinfo, PyArray_DESCR(nparr))
; | |
| assert(tinfo != NULL); | | assert(tinfo != NULL); | |
| | | | |
| // Set the C array element to the supplied Python object. | | // Set the C array element to the supplied Python object. | |
| const int tflags = 0; | | const int tflags = 0; | |
|
| const size_t esize = nparr->descr->elsize; | | const size_t esize = PyArray_DESCR(nparr)->elsize; | |
| PyObject* parent = nparr->base; | | PyObject* parent = PyArray_BASE(nparr); | |
| int ecode = INCALL; | | int ecode = INCALL; | |
| if (!SWIG_IsOK(ecode)) { | | if (!SWIG_IsOK(ecode)) { | |
| SWIG_Error(ecode, "failure in swiglal_py_array_objview_" #ACFTYPE "_s
etitem()"); | | SWIG_Error(ecode, "failure in swiglal_py_array_objview_" #ACFTYPE "_s
etitem()"); | |
| return -1; | | return -1; | |
| } | | } | |
| return 0; | | return 0; | |
| | | | |
| } | | } | |
| | | | |
| // NumPy array descriptor function which casts elements of the viewed arr
ay to NPY_OBJECTs. | | // NumPy array descriptor function which casts elements of the viewed arr
ay to NPY_OBJECTs. | |
| static void swiglal_py_array_objview_##ACFTYPE##_cast_to_object(void *fro
m, void *to, npy_intp n, void *fromarr, void *toarr) { | | static void swiglal_py_array_objview_##ACFTYPE##_cast_to_object(void *fro
m, void *to, npy_intp n, void *fromarr, void *toarr) { | |
| | | | |
| // Check input. | | // Check input. | |
| assert(fromarr != NULL); | | assert(fromarr != NULL); | |
| PyArrayObject* npfromarr = (PyArrayObject*)fromarr; | | PyArrayObject* npfromarr = (PyArrayObject*)fromarr; | |
|
| assert(npfromarr->descr != NULL); | | assert(PyArray_DESCR(npfromarr) != NULL); | |
| assert(toarr != NULL); | | assert(toarr != NULL); | |
| PyArrayObject* nptoarr = (PyArrayObject*)toarr; | | PyArrayObject* nptoarr = (PyArrayObject*)toarr; | |
|
| assert(nptoarr->descr != NULL); | | assert(PyArray_DESCR(nptoarr) != NULL); | |
| | | | |
| // toarr should be an array of pointers to PyObjects. | | // toarr should be an array of pointers to PyObjects. | |
|
| assert(nptoarr->descr->elsize == sizeof(PyObject*)); | | assert(PyArray_DESCR(nptoarr)->elsize == sizeof(PyObject*)); | |
| | | | |
| // Loop over n elements, and assign each element of toarr | | // Loop over n elements, and assign each element of toarr | |
| // the Python object wrapping the corresponding element of fromarr. | | // the Python object wrapping the corresponding element of fromarr. | |
| char* fromelem = (void*)from; | | char* fromelem = (void*)from; | |
| PyObject** toelem = (PyObject**)to; | | PyObject** toelem = (PyObject**)to; | |
| while (--n >= 0) { | | while (--n >= 0) { | |
| *toelem = swiglal_py_array_objview_##ACFTYPE##_getitem(fromelem, from
arr); | | *toelem = swiglal_py_array_objview_##ACFTYPE##_getitem(fromelem, from
arr); | |
|
| fromelem += npfromarr->descr->elsize; | | fromelem += PyArray_DESCR(npfromarr)->elsize; | |
| ++toelem; | | ++toelem; | |
| } | | } | |
| | | | |
| } | | } | |
| | | | |
| // NumPy array descriptor function table for type ACFTYPE. | | // NumPy array descriptor function table for type ACFTYPE. | |
| static PyArray_ArrFuncs swiglal_py_array_objview_##ACFTYPE##_arrfuncs = { | | static PyArray_ArrFuncs swiglal_py_array_objview_##ACFTYPE##_arrfuncs = { | |
| {(PyArray_VectorUnaryFunc*)NULL}, // cast | | {(PyArray_VectorUnaryFunc*)NULL}, // cast | |
| (PyArray_GetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_getitem,
// getitem | | (PyArray_GetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_getitem,
// getitem | |
| (PyArray_SetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_setitem,
// setitem | | (PyArray_SetItemFunc*)&swiglal_py_array_objview_##ACFTYPE##_setitem,
// setitem | |
| | | | |
| skipping to change at line 622 | | skipping to change at line 641 | |
| PyObject* obj, | | PyObject* obj, | |
| void* ptr, | | void* ptr, | |
| const size_t esize, | | const size_t esize, | |
| const size_t ndims, | | const size_t ndims, | |
| const size_t dims[], | | const size_t dims[], | |
| const size_t strides
[], | | const size_t strides
[], | |
| const bool isptr, | | const bool isptr, | |
| swig_type_info *tinf
o, | | swig_type_info *tinf
o, | |
| const int tflags) | | const int tflags) | |
| { | | { | |
|
| | | PyArrayObject* nparr = NULL; | |
| int ecode = 0; | | int ecode = 0; | |
| npy_intp idx[ndims]; | | npy_intp idx[ndims]; | |
| | | | |
| // Check that C array is non-NULL. | | // Check that C array is non-NULL. | |
| if (ptr == NULL) { | | if (ptr == NULL) { | |
| return SWIG_MemoryError; | | return SWIG_MemoryError; | |
| } | | } | |
| | | | |
| // Convert the input Python object to a NumPy array. | | // Convert the input Python object to a NumPy array. | |
|
| PyObject* nparr = NULL; | | if (PyArray_Converter(obj, (PyObject**)&nparr) != NPY_SUCCEED) { | |
| if (PyArray_Converter(obj, &nparr) != NPY_SUCCEED) { | | | |
| ecode = SWIG_ValueError; | | ecode = SWIG_ValueError; | |
| goto end; | | goto end; | |
| } | | } | |
| | | | |
| // Check that NumPy array dimensions are consistent with C array dime
nsions. | | // Check that NumPy array dimensions are consistent with C array dime
nsions. | |
| if (PyArray_NDIM(nparr) != ndims) { | | if (PyArray_NDIM(nparr) != ndims) { | |
| ecode = SWIG_ValueError; | | ecode = SWIG_ValueError; | |
| goto end; | | goto end; | |
| } | | } | |
| size_t nelem = 1; | | size_t nelem = 1; | |
| | | | |
| skipping to change at line 694 | | skipping to change at line 713 | |
| SWIGINTERN PyObject* %swiglal_array_copyout_func(ACFTYPE)(PyObject* par
ent, | | SWIGINTERN PyObject* %swiglal_array_copyout_func(ACFTYPE)(PyObject* par
ent, | |
| void* ptr, | | void* ptr, | |
| const size_t
esize, | | const size_t
esize, | |
| const size_t
ndims, | | const size_t
ndims, | |
| const size_t
dims[], | | const size_t
dims[], | |
| const size_t
strides[], | | const size_t
strides[], | |
| const bool is
ptr, | | const bool is
ptr, | |
| swig_type_inf
o *tinfo, | | swig_type_inf
o *tinfo, | |
| const int tfl
ags) | | const int tfl
ags) | |
| { | | { | |
|
| PyObject* nparr = NULL; | | PyArrayObject* nparr = NULL; | |
| npy_intp objdims[ndims]; | | npy_intp objdims[ndims]; | |
| npy_intp idx[ndims]; | | npy_intp idx[ndims]; | |
| | | | |
| // Check that C array is non-NULL. | | // Check that C array is non-NULL. | |
| if (ptr == NULL) { | | if (ptr == NULL) { | |
| goto fail; | | goto fail; | |
| } | | } | |
| | | | |
| // Copy C array dimensions. | | // Copy C array dimensions. | |
| size_t nelem = 1; | | size_t nelem = 1; | |
| for (int i = 0; i < ndims; ++i) { | | for (int i = 0; i < ndims; ++i) { | |
| objdims[i] = dims[i]; | | objdims[i] = dims[i]; | |
| nelem *= dims[i]; | | nelem *= dims[i]; | |
| } | | } | |
| | | | |
| // Create new NumPy array. | | // Create new NumPy array. | |
|
| nparr = PyArray_EMPTY(ndims, objdims, NPYTYPE, 0); | | nparr = (PyArrayObject*)PyArray_EMPTY(ndims, objdims, NPYTYPE, 0); | |
| if (nparr == NULL) { | | if (nparr == NULL) { | |
| goto fail; | | goto fail; | |
| } | | } | |
| | | | |
| // Iterate over all elements in the C array. | | // Iterate over all elements in the C array. | |
| memset(idx, 0, ndims*sizeof(npy_intp)); | | memset(idx, 0, ndims*sizeof(npy_intp)); | |
| for (size_t i = 0; i < nelem; ++i) { | | for (size_t i = 0; i < nelem; ++i) { | |
| | | | |
| // Get a pointer to the element of the C array. | | // Get a pointer to the element of the C array. | |
| void* elemptr = swiglal_py_get_element_ptr(ptr, esize, ndims, strid
es, idx); | | void* elemptr = swiglal_py_get_element_ptr(ptr, esize, ndims, strid
es, idx); | |
| | | | |
| // Copy the C array element to the NumPy array. | | // Copy the C array element to the NumPy array. | |
| PyObject* objelem = OUTCALL; | | PyObject* objelem = OUTCALL; | |
| PyArray_SETITEM(nparr, PyArray_GetPtr((PyArrayObject*)nparr, idx),
objelem); | | PyArray_SETITEM(nparr, PyArray_GetPtr((PyArrayObject*)nparr, idx),
objelem); | |
| | | | |
| // Increment the NumPy array index. | | // Increment the NumPy array index. | |
| swiglal_py_increment_idx(ndims, dims, idx); | | swiglal_py_increment_idx(ndims, dims, idx); | |
| | | | |
| } | | } | |
| | | | |
|
| return nparr; | | return (PyObject*)nparr; | |
| | | | |
| fail: | | fail: | |
| Py_CLEAR(nparr); | | Py_CLEAR(nparr); | |
| Py_INCREF(Py_None); | | Py_INCREF(Py_None); | |
| return Py_None; | | return Py_None; | |
| | | | |
| } | | } | |
| } | | } | |
| | | | |
| // Output view conversion fragment for arrays of type ACFTYPE. | | // Output view conversion fragment for arrays of type ACFTYPE. | |
| | | | |
| skipping to change at line 756 | | skipping to change at line 775 | |
| SWIGINTERN PyObject* %swiglal_array_viewout_func(ACFTYPE)(PyObject* par
ent, | | SWIGINTERN PyObject* %swiglal_array_viewout_func(ACFTYPE)(PyObject* par
ent, | |
| void* ptr, | | void* ptr, | |
| const size_t
esize, | | const size_t
esize, | |
| const size_t
ndims, | | const size_t
ndims, | |
| const size_t
dims[], | | const size_t
dims[], | |
| const size_t
strides[], | | const size_t
strides[], | |
| const bool is
ptr, | | const bool is
ptr, | |
| swig_type_inf
o *tinfo, | | swig_type_inf
o *tinfo, | |
| const int tfl
ags) | | const int tfl
ags) | |
| { | | { | |
|
| PyObject* nparr = NULL; | | PyArrayObject* nparr = NULL; | |
| npy_intp objdims[ndims]; | | npy_intp objdims[ndims]; | |
| npy_intp objstrides[ndims]; | | npy_intp objstrides[ndims]; | |
| | | | |
| // Copy C array dimensions and strides. | | // Copy C array dimensions and strides. | |
| for (int i = 0; i < ndims; ++i) { | | for (int i = 0; i < ndims; ++i) { | |
| objdims[i] = dims[i]; | | objdims[i] = dims[i]; | |
| objstrides[i] = strides[i] * esize; | | objstrides[i] = strides[i] * esize; | |
| } | | } | |
| | | | |
| // Create a new NumPy array view. | | // Create a new NumPy array view. | |
| PyArray_Descr* descr = NPYDESCR; | | PyArray_Descr* descr = NPYDESCR; | |
| if (descr == NULL) { | | if (descr == NULL) { | |
| goto fail; | | goto fail; | |
| } | | } | |
|
| nparr = PyArray_NewFromDescr(&PyArray_Type, descr, ndims, objdims, ob
jstrides, ptr, NPY_WRITEABLE, NULL); | | nparr = (PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, descr, nd
ims, objdims, objstrides, ptr, NPY_ARRAY_WRITEABLE, NULL); | |
| if (nparr == NULL) { | | if (nparr == NULL) { | |
| goto fail; | | goto fail; | |
| } | | } | |
| | | | |
| // Set the NumPy array view parent, if given. | | // Set the NumPy array view parent, if given. | |
| if (parent) { | | if (parent) { | |
| Py_INCREF(parent); | | Py_INCREF(parent); | |
|
| ((PyArrayObject*)nparr)->base = parent; | | PyArray_SetBaseObject(nparr, parent); | |
| } | | } | |
| | | | |
|
| return nparr; | | return (PyObject*)nparr; | |
| | | | |
| fail: | | fail: | |
| Py_CLEAR(nparr); | | Py_CLEAR(nparr); | |
| Py_INCREF(Py_None); | | Py_INCREF(Py_None); | |
| return Py_None; | | return Py_None; | |
| | | | |
| } | | } | |
| } | | } | |
| | | | |
| %enddef // %swiglal_py_array_frags | | %enddef // %swiglal_py_array_frags | |
| | | | |
End of changes. 27 change blocks. |
| 31 lines changed or deleted | | 57 lines changed or added | |
|