00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _SFTUTILS_H
00037 #define _SFTUTILS_H
00038
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00044 NRCSID( SFTUTILSH, "$Id: SFTutils.h,v 1.35 2008/05/29 21:21:24 whelan Exp $" );
00045
00046 #include <stdarg.h>
00047
00048 #include <lal/LALDatatypes.h>
00049 #include <lal/DetectorSite.h>
00050 #include <lal/Date.h>
00051 #include <lal/SkyCoordinates.h>
00052 #include <lal/RngMedBias.h>
00053 #include <lal/LALRunningMedian.h>
00054
00055
00056
00057
00058
00059
00060
00061
00062 #define SFTUTILS_ENULL 1
00063 #define SFTUTILS_ENONULL 2
00064 #define SFTUTILS_EMEM 3
00065 #define SFTUTILS_EINPUT 4
00066 #define SFTUTILS_EFUNC 6
00067
00068 #define SFTUTILS_MSGENULL "Arguments contained an unexpected null pointer"
00069 #define SFTUTILS_MSGENONULL "Output pointer is not NULL"
00070 #define SFTUTILS_MSGEMEM "Out of memory"
00071 #define SFTUTILS_MSGEINPUT "Invald input parameter"
00072 #define SFTUTILS_MSGEFUNC "Sub-routine failed"
00073
00074
00075
00076
00077 typedef struct {
00078 UINT4 length;
00079 COMPLEX8FrequencySeries *data;
00080 } COMPLEX8FrequencySeriesVector;
00081
00082
00083 typedef struct {
00084 UINT4 length;
00085 REAL8FrequencySeries *data;
00086 } REAL8FrequencySeriesVector;
00087
00088
00089
00090 typedef COMPLEX8FrequencySeries SFTtype;
00091
00092
00093
00094 typedef COMPLEX8FrequencySeriesVector SFTVector;
00095
00096
00097 typedef REAL8FrequencySeriesVector PSDVector;
00098
00099
00100 typedef struct tagMultiSFTVector {
00101 UINT4 length;
00102 SFTVector **data;
00103 } MultiSFTVector;
00104
00105
00106
00107 typedef struct {
00108 UINT4 length;
00109 PSDVector **data;
00110 } MultiPSDVector;
00111
00112
00113 typedef struct {
00114 UINT4 length;
00115 REAL8Vector **data;
00116 REAL8 Sinv_Tsft;
00117 } MultiNoiseWeights;
00118
00119
00120 typedef struct {
00121 UINT4 length;
00122 REAL4TimeSeries **data;
00123 } MultiREAL4TimeSeries;
00124
00125
00126 typedef struct {
00127 UINT4 length;
00128 LIGOTimeGPS *data;
00129 REAL8 deltaT;
00130 } LIGOTimeGPSVector;
00131
00132
00133 typedef struct {
00134 UINT4 length;
00135 LIGOTimeGPSVector **data;
00136 } MultiLIGOTimeGPSVector;
00137
00138
00139
00140 extern const SFTtype empty_SFTtype;
00141 extern const SFTVector empty_SFTVector;
00142 extern const PSDVector empty_PSDVector;
00143 extern const MultiSFTVector empty_MultiSFTVector;
00144 extern const MultiPSDVector empty_MultiPSDVector;
00145 extern const MultiNoiseWeights empty_MultiNoiseWeights;
00146 extern const MultiREAL4TimeSeries empty_MultiREAL4TimeSeries;
00147 extern const LIGOTimeGPSVector empty_LIGOTimeGPSVector;
00148 extern const MultiLIGOTimeGPSVector empty_MultiLIGOTimeGPSVector;
00149
00150
00151
00152
00153
00154 void LALCreateSFTtype (LALStatus *status, SFTtype **sft, UINT4 SFTlen);
00155 void LALCreateSFTVector (LALStatus *status, SFTVector **sftvect, UINT4 numSFTs, UINT4 SFTlen);
00156 void LALCreateMultiSFTVector ( LALStatus *status, MultiSFTVector **out, UINT4 length, UINT4Vector *numsft );
00157
00158 SFTVector* XLALCreateSFTVector (UINT4 numSFTs, UINT4 numBins );
00159
00160 COMPLEX8Vector *XLALrefineCOMPLEX8Vector (const COMPLEX8Vector *in, UINT4 refineby, UINT4 Dterms);
00161 void upsampleMultiSFTVector (LALStatus *, MultiSFTVector *inout, UINT4 upsample, UINT4 Dterms);
00162 void upsampleSFTVector (LALStatus *, SFTVector *inout, UINT4 upsample, UINT4 Dterms);
00163
00164 void XLALDestroySFTVector (SFTVector *vect);
00165
00166 void LALDestroySFTtype (LALStatus *status, SFTtype **sft);
00167 void LALDestroySFTVector (LALStatus *status, SFTVector **sftvect);
00168 void LALDestroyPSDVector (LALStatus *status, PSDVector **vect);
00169
00170 void LALDestroyMultiSFTVector (LALStatus *status, MultiSFTVector **multvect);
00171 void LALDestroyMultiPSDVector (LALStatus *status, MultiPSDVector **multvect);
00172
00173 SFTVector* XLALExtractBandfromSFTs ( const SFTVector *sfts, REAL8 fMin, REAL8 fMax );
00174 void LALCopySFT (LALStatus *status, SFTtype *dest, const SFTtype *src);
00175
00176 void LALSubtractSFTVectors (LALStatus *, SFTVector **outVect, const SFTVector *inVect1, const SFTVector *inVect2 );
00177 void LALLinearlyCombineSFTVectors (LALStatus *, SFTVector **outVect, SFTVector **inVects, const COMPLEX16Vector *weights, const CHAR *outName);
00178 void LALAppendSFT2Vector (LALStatus *, SFTVector *vect, const SFTtype *sft );
00179
00180 LIGOTimeGPSVector *XLALCreateTimestampVector (UINT4 len);
00181 void XLALDestroyTimestampVector (LIGOTimeGPSVector *vect);
00182
00183 void LALCreateTimestampVector (LALStatus *status, LIGOTimeGPSVector **vect, UINT4 len);
00184 void LALDestroyTimestampVector (LALStatus *status, LIGOTimeGPSVector **vect);
00185
00186 void LALMakeTimestamps (LALStatus *, LIGOTimeGPSVector **timestamps, const LIGOTimeGPS tStart, REAL8 duration, REAL8 Tsft);
00187 void LALGetSFTtimestamps (LALStatus *, LIGOTimeGPSVector **timestamps, const SFTVector *sfts );
00188
00189 CHAR *XLALGetChannelPrefix ( const CHAR *name );
00190 LALDetector *XLALGetSiteInfo ( const CHAR *name );
00191
00192 void LALComputeNoiseWeights (LALStatus *status, REAL8Vector *weightV, const SFTVector *sftVect,
00193 INT4 blkSize, UINT4 excludePercentile);
00194 void LALComputeMultiNoiseWeights (LALStatus *status, MultiNoiseWeights **weightsV, const MultiPSDVector *multipsd,
00195 UINT4 blocksRngMed, UINT4 excludePercentile);
00196 void LALDestroyMultiNoiseWeights (LALStatus *status, MultiNoiseWeights **weights);
00197
00198 #ifdef __cplusplus
00199 }
00200 #endif
00201
00202
00203 #endif