20 #include <lal/LALSimSphHarmSeries.h>
21 #include <lal/LALStdlib.h>
22 #include <lal/Sequence.h>
23 #include <lal/TimeSeries.h>
24 #include <lal/FrequencySeries.h>
25 #include <lal/TimeFreqFFT.h>
26 #include <lal/Units.h>
27 #include <lal/SphericalHarmonics.h>
30 #define UNUSED __attribute__ ((unused))
60 if(
l ==
ts->l &&
m ==
ts->m ){
151 if( !
ts )
return NULL;
154 while( itr->
l !=
l || itr->
m !=
m ){
156 if( !itr )
return NULL;
169 maxl = itr->
l > maxl ? itr->
l : maxl;
183 minl = itr->
l < minl ? itr->
l : minl;
240 for(
l = 2;
l <= Lmax;
l++) {
241 for(
m = -
l;
m <= (int)
l;
m++) {
246 for (
i =0;
i<length;
i++) {
286 if(
l ==
ts->l &&
m ==
ts->m ){
317 XLAL_CHECK_NULL(!inAmpl,
XLAL_EFUNC,
"Both mode amplitude and phase need to be defined with the same length or NULL.\n");
392 if( !
ts )
return NULL;
395 while( itr->
l !=
l || itr->
m !=
m ){
397 if( !itr )
return NULL;
412 if( !
ts )
return NULL;
415 while( itr->
l !=
l || itr->
m !=
m ){
417 if( !itr )
return NULL;
431 maxl = itr->
l > maxl ? itr->
l : maxl;
557 for(
l = 2;
l <= Lmax;
l++) {
558 for(
m = -
l;
m <= (int)
l;
m++) {
589 if(
l ==
ts->l &&
m ==
ts->m ){
680 if( !
ts )
return NULL;
683 while( itr->
l !=
l || itr->
m !=
m ){
685 if( !itr )
return NULL;
698 maxl = itr->
l > maxl ? itr->
l : maxl;
void XLALDestroyCOMPLEX16FFTPlan(COMPLEX16FFTPlan *plan)
COMPLEX16FFTPlan * XLALCreateForwardCOMPLEX16FFTPlan(UINT4 size, int measurelvl)
COMPLEX16FFTPlan * XLALCreateReverseCOMPLEX16FFTPlan(UINT4 size, int measurelvl)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
COMPLEX16FrequencySeries * XLALCutCOMPLEX16FrequencySeries(const COMPLEX16FrequencySeries *series, size_t first, size_t length)
void XLALDestroyCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series)
void * XLALMalloc(size_t n)
REAL8TimeSeries * XLALSphHarmPolarTimeSeriesGetModePhase(SphHarmPolarTimeSeries *ts, UINT4 l, INT4 m)
Get the time series of a waveform's (l,m) spherical harmonic mode phase from a SphHarmPolarTimeSeries...
UINT4 XLALSphHarmPolarTimeSeriesGetMaxL(SphHarmPolarTimeSeries *ts)
Get the largest l index of any mode in the SphHarmTimeSeries linked list.
UINT4 XLALSphHarmTimeSeriesGetMinL(SphHarmTimeSeries *ts)
Get the smallest l index of any mode in the SphHarmTimeSeries linked list.
SphHarmTimeSeries * XLALSphHarmTimeSeriesAddMode(SphHarmTimeSeries *appended, const COMPLEX16TimeSeries *inmode, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmTimeSeries, or create a new head.
SphHarmFrequencySeries * XLALSphHarmFrequencySeriesFromSphHarmTimeSeries(SphHarmTimeSeries *hlms_TD)
Create a SphHarmFrequencySeries from a SphHarmTimeSeries by performing an FFT on each mode in the Sph...
REAL8Sequence * XLALSphHarmTimeSeriesGetTData(SphHarmTimeSeries *ts)
Get the tdata member for nodes in the list.
COMPLEX16TimeSeries * XLALSphHarmTimeSeriesGetMode(SphHarmTimeSeries *ts, UINT4 l, INT4 m)
Get the time series of a waveform's (l,m) spherical harmonic mode from a SphHarmTimeSeries linked lis...
SphHarmTimeSeries * XLALResizeSphHarmTimeSeries(SphHarmTimeSeries *ts, int first, size_t length)
For every (l,m) node in the SphHarmTimeSeries linked list, call XLALResizeCOMPLEX16TimeSeries(ts->mod...
REAL8Sequence * XLALSphHarmPolarTimeSeriesGetTData(SphHarmPolarTimeSeries *ts)
Get the tdata member for nodes in the list.
void XLALSphHarmTimeSeriesSetTData(SphHarmTimeSeries *ts, REAL8Sequence *tdata)
Set the tdata member for all nodes in the list.
REAL8TimeSeries * XLALSphHarmPolarTimeSeriesGetModeAmplitude(SphHarmPolarTimeSeries *ts, UINT4 l, INT4 m)
Get the time series of a waveform's (l,m) spherical harmonic mode amplitude from a SphHarmPolarTimeSe...
SphHarmPolarTimeSeries * XLALSphHarmPolarTimeSeriesAddMode(SphHarmPolarTimeSeries *appended, const REAL8TimeSeries *inAmpl, const REAL8TimeSeries *inphase, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmPolarTimeSeries, or create a new head.
UINT4 XLALSphHarmFrequencySeriesGetMaxL(SphHarmFrequencySeries *ts)
Get the largest l index of any mode in the SphHarmFrequencySeries linked list.
UINT4 XLALSphHarmTimeSeriesGetMaxL(SphHarmTimeSeries *ts)
Get the largest l index of any mode in the SphHarmTimeSeries linked list.
void XLALDestroySphHarmTimeSeries(SphHarmTimeSeries *ts)
Delete list from current pointer to the end of the list.
COMPLEX16FrequencySeries * XLALSphHarmFrequencySeriesGetMode(SphHarmFrequencySeries *ts, UINT4 l, INT4 m)
Get the time series of a waveform's (l,m) spherical harmonic mode from a SphHarmFrequencySeries linke...
SphHarmFrequencySeries * XLALSphHarmFrequencySeriesAddMode(SphHarmFrequencySeries *appended, const COMPLEX16FrequencySeries *inmode, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmFrequencySeries, or create a new head.
void XLALDestroySphHarmFrequencySeries(SphHarmFrequencySeries *ts)
Delete list from current pointer to the end of the list.
void XLALDestroySphHarmPolarTimeSeries(SphHarmPolarTimeSeries *ts)
Delete list from current pointer to the end of the list.
void XLALSphHarmPolarTimeSeriesSetTData(SphHarmPolarTimeSeries *ts, REAL8Sequence *tdata)
Set the tdata member for all nodes in the list.
SphHarmPolarTimeSeries * XLALResizeSphHarmPolarTimeSeries(SphHarmPolarTimeSeries *ts, int first, size_t length)
For every (l,m) node in the SphHarmPolarTimeSeries linked list, call XLALResizeREAL8TimeSeries(ts->am...
void XLALSphHarmFrequencySeriesSetFData(SphHarmFrequencySeries *ts, REAL8Sequence *fdata)
Set the tdata member for all nodes in the list.
REAL8Sequence * XLALSphHarmFrequencySeriesGetFData(SphHarmFrequencySeries *ts)
Get the fdata member.
SphHarmPolarTimeSeries * XLALCutSphHarmPolarTimeSeries(SphHarmPolarTimeSeries *ts, int first, size_t length)
Create a new SphHarmPolarTimeSeries linked listby extracting a section of an existing SphHarmPolarTim...
SphHarmTimeSeries * XLALSphHarmTimeSeriesFromSphHarmFrequencySeriesDataAndPSD(SphHarmFrequencySeries *hlms, COMPLEX16FrequencySeries *data, COMPLEX16FrequencySeries *psd)
REAL8Sequence * XLALCutREAL8Sequence(REAL8Sequence *sequence, size_t first, size_t length)
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
int XLALCOMPLEX16FreqTimeFFT(COMPLEX16TimeSeries *tser, const COMPLEX16FrequencySeries *freq, const COMPLEX16FFTPlan *plan)
int XLALCOMPLEX16TimeFreqFFT(COMPLEX16FrequencySeries *freq, const COMPLEX16TimeSeries *tser, const COMPLEX16FFTPlan *plan)
REAL8TimeSeries * XLALResizeREAL8TimeSeries(REAL8TimeSeries *series, int first, size_t length)
REAL8TimeSeries * XLALCutREAL8TimeSeries(const REAL8TimeSeries *series, size_t first, size_t length)
void XLALDestroyCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series)
COMPLEX16TimeSeries * XLALResizeCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series, int first, size_t length)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
COMPLEX16TimeSeries * XLALCutCOMPLEX16TimeSeries(const COMPLEX16TimeSeries *series, size_t first, size_t length)
COMPLEX16TimeSeries * XLALCreateCOMPLEX16TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
const LALUnit lalHertzUnit
const LALUnit lalDimensionlessUnit
#define XLAL_ERROR_NULL(...)
#define XLAL_CHECK_NULL(assertion,...)
struct tagSphHarmFrequencySeries * next
next pointer
REAL8Sequence * fdata
Frequency values.
COMPLEX16FrequencySeries * mode
The sequences of sampled data.
REAL8TimeSeries * ampl
The sequences of mode amplitude.
REAL8TimeSeries * phase
The sequences of mode phase (not modulo 2Pi).
struct tagSphHarmPolarTimeSeries * next
next pointer
REAL8Sequence * tdata
Timestamp values.
Structure to carry a collection of spherical harmonic modes in COMPLEX16 time series.
struct tagSphHarmTimeSeries * next
next pointer
REAL8Sequence * tdata
Timestamp values.
COMPLEX16TimeSeries * mode
The sequences of sampled data.