LALInference  4.1.6.1-89842e6
LALInferenceReadBurstData.c
Go to the documentation of this file.
1 /*
2  * LALInferenceReadData.c: Bayesian Followup functions
3  *
4  * Copyright (C) 2013 Salvatore Vitale
5  *
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with with program; see the file COPYING. If not, write to the
19  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20  * MA 02110-1301 USA
21  */
22 
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <lal/LALStdio.h>
26 #include <lal/LALStdlib.h>
27 #include <lal/LALInspiral.h>
28 #include <lal/LALCache.h>
29 #include <lal/LALFrStream.h>
30 #include <lal/TimeFreqFFT.h>
31 #include <lal/LALDetectors.h>
32 #include <lal/AVFactories.h>
33 #include <lal/ResampleTimeSeries.h>
34 #include <lal/TimeSeries.h>
35 #include <lal/FrequencySeries.h>
36 #include <lal/Units.h>
37 #include <lal/Date.h>
38 #include <lal/StringInput.h>
39 #include <lal/VectorOps.h>
40 #include <lal/Random.h>
41 #include <lal/LALNoiseModels.h>
42 #include <lal/XLALError.h>
43 #include <lal/GenerateInspiral.h>
44 #include <lal/LIGOLwXMLRead.h>
45 #include <lal/SeqFactories.h>
46 #include <lal/DetectorSite.h>
47 #include <lal/GenerateInspiral.h>
48 #include <lal/GeneratePPNInspiral.h>
49 #include <lal/SimulateCoherentGW.h>
50 #include <lal/LIGOMetadataTables.h>
51 #include <lal/LIGOMetadataUtils.h>
52 #include <lal/LIGOMetadataInspiralUtils.h>
53 #include <lal/LIGOMetadataRingdownUtils.h>
54 #include <lal/LALInspiralBank.h>
55 #include <lal/FindChirp.h>
56 #include <lal/LALInspiralBank.h>
57 #include <lal/GenerateInspiral.h>
58 #include <lal/NRWaveInject.h>
59 #include <lal/GenerateInspRing.h>
60 #include <math.h>
61 #include <lal/LALInspiral.h>
62 #include <lal/LALSimulation.h>
63 #include <lal/LALInference.h>
64 #include <lal/LALInferenceLikelihood.h>
65 #include <lal/LALInferenceTemplate.h>
66 #include <lal/GenerateBurst.h>
67 #include <lal/LALInferenceBurstRoutines.h>
68 #include <lal/LALInferenceReadBurstData.h>
69 #include <lal/LALSimNoise.h>
70 
71 #define LALINFERENCE_DEFAULT_FLOW "40.0"
72 //typedef void (NoiseFunc)(LALStatus *statusPtr,REAL8 *psd,REAL8 f);
73 static void PrintSNRsToFile(LALInferenceIFOData *IFOdata , char SNRpath[] );
74 void InjectBurstFD(LALInferenceIFOData *IFOdata, SimBurst *inj_table, ProcessParamsTable *commandLine);
75 //typedef void (NoiseFunc)(LALStatus *statusPtr,REAL8 *psd,REAL8 f);
76 
78 {
80  memset(&status,0,sizeof(status));
81  SimBurst *injTable=NULL;
82  SimBurst *injEvent=NULL;
83  TimeSlide *tslide=NULL;
84  INT4 Ninj=0;
85  INT4 event=0;
86  UINT4 i=0,j=0;
87  int si=0;
88  LIGOTimeGPS injstart;
89  REAL8 SNR=0.0,NetworkSNR=0.0;// previous_snr=0.0;
90  memset(&injstart,0,sizeof(LIGOTimeGPS));
91  COMPLEX16FrequencySeries *injF=NULL;
92  // FILE *rawWaveform=NULL;
93  ProcessParamsTable *ppt=NULL;
94  REAL8 bufferLength = 2048.0; /* Default length of buffer for injections (seconds) */
95  LIGOTimeGPS bufferStart;
96 
97  LALInferenceIFOData *thisData=IFOdata->next;
98  REAL8 minFlow=IFOdata->fLow;
99  REAL8 MindeltaT=IFOdata->timeData->deltaT;
100  char SNRpath[FILENAME_MAX+10]="";
101  while(thisData){
102  minFlow = minFlow>thisData->fLow ? thisData->fLow : minFlow;
103  MindeltaT = MindeltaT>thisData->timeData->deltaT ? thisData->timeData->deltaT : MindeltaT;
104  thisData = thisData->next;
105  }
106 
107  thisData=IFOdata;
108 
109  if(!LALInferenceGetProcParamVal(commandLine,"--binj")) {fprintf(stdout,"No injection file specified, not injecting\n"); return;}
110  if(LALInferenceGetProcParamVal(commandLine,"--event")){
111  event= atoi(LALInferenceGetProcParamVal(commandLine,"--event")->value);
112  fprintf(stdout,"Injecting event %d\n",event);
113  }
114  else
115  fprintf(stdout,"WARNING: you did not give --event. Injecting event 0 of the xml table, which may not be what you want!\n");
116 
117  ppt = LALInferenceGetProcParamVal(commandLine,"--outfile");
118  if (ppt)
119  snprintf(SNRpath, sizeof(SNRpath), "%s_snr.txt", ppt->value);
120  else
121  snprintf(SNRpath, sizeof(SNRpath), "snr.txt");
122 
123  injTable=XLALSimBurstTableFromLIGOLw(LALInferenceGetProcParamVal(commandLine,"--binj")->value);
125  Ninj=-1;
126  while(injTable){Ninj++;injTable=injTable->next;}
127  if(Ninj < event){
128  fprintf(stderr,"Error reading event %d from %s\n",event,LALInferenceGetProcParamVal(commandLine,"--binj")->value);
129  exit(1);
130  }
131  injTable=XLALSimBurstTableFromLIGOLw(LALInferenceGetProcParamVal(commandLine,"--binj")->value);
132  while(si<event) {si++; injTable = injTable->next;} /* Select event */
133  injEvent = injTable;
134  injEvent->next = NULL;
135  tslide=XLALTimeSlideTableFromLIGOLw(LALInferenceGetProcParamVal(commandLine,"--binj")->value);
137 
138  /* If it is the case, inject burst in the FreqDomain */
139  int FDinj=0;
140  if (injTable)
142 
143 
144  if (FDinj)
145  {
146  InjectBurstFD(thisData, injEvent, commandLine);
147  return;
148  }
149 
150  /* Begin loop over interferometers */
151  while(thisData){
152 
153  memcpy(&bufferStart,&thisData->timeData->epoch,sizeof(LIGOTimeGPS));
154  XLALGPSAdd(&bufferStart,(REAL8) thisData->timeData->data->length * thisData->timeData->deltaT);
155  XLALGPSAdd(&bufferStart,-bufferLength);
156  char series_name[320];
157  sprintf(series_name,"%s:injection",thisData->name);
159  &thisData->timeData->epoch,
160  0.0,
161  thisData->timeData->deltaT,
162  &lalStrainUnit,
163  thisData->timeData->data->length);
164  if(!inj8Wave) XLAL_ERROR_VOID(XLAL_EFUNC);
165  for(i=0;i<inj8Wave->data->length;i++) inj8Wave->data->data[i]=0.0;
166 
167  REAL8 Q, centre_frequency;
168  Q=injEvent->q;
169  centre_frequency=injEvent->frequency;
170  /* Check that 2*width_gauss_envelope is inside frequency range */
171  if ((centre_frequency + 3.0*centre_frequency/Q)>= 1.0/(2.0*thisData->timeData->deltaT)){
172  XLALPrintWarning("WARNING: Your sample rate is too low to ensure a good analysis for a SG centered at f0=%lf and with Q=%lf. Consider increasing it to more than %lf. Exiting...\n",centre_frequency,Q,2.0*(centre_frequency + 3.0*centre_frequency/Q));
173  }
174  if ((centre_frequency -3.0*centre_frequency/Q)<= thisData->fLow){
176  "WARNING: The low frenquency tail of your SG centered at f0=%lf and with Q=%lf will lie below the low frequency cutoff. Whit your current settings and parameters the minimum f0 you can analyze without cuts is %lf.\n Continuing... \n",centre_frequency,Q,centre_frequency -3.0*centre_frequency/Q);
177  }
178  XLALBurstInjectSignals(inj8Wave,injEvent,tslide,NULL);
179  XLALResampleREAL8TimeSeries(inj8Wave,thisData->timeData->deltaT);
180 
182  &thisData->timeData->epoch,
183  0.0,
184  thisData->freqData->deltaF,
186  thisData->freqData->data->length);
187  if(!injF) {
188  XLALPrintError("Unable to allocate memory for injection buffer\n");
190  }
191 
192  /* Window the data */
193  //REAL4 WinNorm = sqrt(thisData->window->sumofsquares/thisData->window->data->length);
194  for(j=0;j<inj8Wave->data->length;j++){
195  inj8Wave->data->data[j]*=thisData->window->data->data[j]; /* /WinNorm; */ /* Window normalisation applied only in freq domain */
196  }
197 
198  XLALREAL8TimeFreqFFT(injF,inj8Wave,thisData->timeToFreqFFTPlan);
199 
200  if(thisData->oneSidedNoisePowerSpectrum){
201  UINT4 upper=thisData->fHigh/injF->deltaF;
202  for(SNR=0.0,j=thisData->fLow/injF->deltaF;j<upper;j++){
203  SNR+=pow(creal(injF->data->data[j]),2.0)/thisData->oneSidedNoisePowerSpectrum->data->data[j];
204  SNR+=pow(cimag(injF->data->data[j]),2.0)/thisData->oneSidedNoisePowerSpectrum->data->data[j];
205  }
206  SNR*=4.0*injF->deltaF;
207  }
208  thisData->SNR=sqrt(SNR);
209  NetworkSNR+=SNR;
210 
211  /* Actually inject the waveform */
212  for(j=0;j<inj8Wave->data->length;j++) thisData->timeData->data->data[j]+=inj8Wave->data->data[j];
213  fprintf(stdout,"Injected SNR in detector %s = %.1f\n",thisData->name,thisData->SNR);
214  char filename[320];
215  sprintf(filename,"%s_timeInjection.dat",thisData->name);
216  FILE* file=fopen(filename, "w");
217  for(j=0;j<inj8Wave->data->length;j++){
218  fprintf(file, "%.6f\t%lg\n", XLALGPSGetREAL8(&thisData->timeData->epoch) + thisData->timeData->deltaT*j, inj8Wave->data->data[j]);
219  }
220  fclose(file);
221  sprintf(filename,"%s_freqInjection.dat",thisData->name);
222  file=fopen(filename, "w");
223  /* NOTE: Here I (salvo) got rid of the division by WinNorm that was done in the CBC version of this routine. This is because burst signals are short and centered in the middle of the segment. Thus, the actual signal will be in the flat part of the Tuckey window. */
224  for(j=0;j<injF->data->length;j++){
225  thisData->freqData->data->data[j]+=(injF->data->data[j]);
226  fprintf(file, "%lg %lg \t %lg\n", thisData->freqData->deltaF*j, creal(injF->data->data[j]), cimag(injF->data->data[j]));
227  }
228  fclose(file);
229 
230  XLALDestroyREAL8TimeSeries(inj8Wave);
232  thisData=thisData->next;
233  }
234 
235  ppt=LALInferenceGetProcParamVal(commandLine,"--dont-dump-extras");
236  if (!ppt){
237  PrintSNRsToFile(IFOdata , SNRpath);
238  }
239 
240  NetworkSNR=sqrt(NetworkSNR);
241  fprintf(stdout,"Network SNR of event %d = %.1e\n",event,NetworkSNR);
242  thisData=IFOdata;
243 
244  return;
245 }
246 
247 /** Fill the variables passed in vars with the parameters of the injection passed in event
248  will over-write and destroy any existing parameters. Param vary type will be fixed */
250 {
251  if(!vars) {
252  XLALPrintError("Encountered NULL variables pointer");
254  }
255  /* Destroy existing parameters */
256  if(vars->head!=NULL) LALInferenceClearVariables(vars);
257  REAL8 q = theEventTable->q;
258  REAL8 psi = theEventTable->psi;
259  REAL8 injGPSTime = XLALGPSGetREAL8(&(theEventTable->time_geocent_gps));
260  REAL8 hrss = theEventTable->hrss;
261  REAL8 loghrss=log(hrss);
262  REAL8 f0 = theEventTable->frequency;
263  REAL8 pol_angle = theEventTable->pol_ellipse_angle;
264  REAL8 eccentricity = theEventTable->pol_ellipse_e;
265  REAL8 duration=theEventTable->duration;
266  REAL8 dec = theEventTable->dec;
267  REAL8 ra = theEventTable->ra;
268 
278  LALInferenceAddVariable(vars, "polar_angle", &pol_angle, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_FIXED);
279  LALInferenceAddVariable(vars, "polar_eccentricity", &eccentricity, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_FIXED);
280 }
281 
282 static void PrintSNRsToFile(LALInferenceIFOData *IFOdata , char SNRpath[] ){
283  REAL8 NetSNR=0.0;
284  LALInferenceIFOData *thisData=IFOdata;
285  int nIFO=0;
286 
287  while(thisData){
288  thisData=thisData->next;
289  nIFO++;
290  }
291  FILE * snrout = fopen(SNRpath,"w");
292  if(!snrout){
293  fprintf(stderr,"Unable to open the path %s for writing SNR files\n",SNRpath);
294  fprintf(stderr,"Error code %i: %s\n",errno,strerror(errno));
295  exit(errno);
296  }
297  thisData=IFOdata;
298  while(thisData){
299  fprintf(snrout,"%s:\t %4.2f\n",thisData->name,thisData->SNR);
300  nIFO++;
301  NetSNR+=(thisData->SNR*thisData->SNR);
302  thisData=thisData->next;
303  }
304  if (nIFO>1){
305  fprintf(snrout,"Network:\t");
306  fprintf(snrout,"%4.2f\n",sqrt(NetSNR));
307  }
308  fclose(snrout);
309 }
310 
311 void InjectBurstFD(LALInferenceIFOData *IFOdata, SimBurst *inj_table, ProcessParamsTable *commandLine)
312 ///*-------------- Inject in Frequency domain -----------------*/
313 {
314  /* Inject a gravitational wave into the data in the frequency domain */
316  memset(&status,0,sizeof(LALStatus));
317  INT4 errnum;
318  char SNRpath[FILENAME_MAX+16];
319  ProcessParamsTable *ppt=NULL;
320  ppt = NULL;
321  ppt = LALInferenceGetProcParamVal(commandLine,"--outfile");
322  if (ppt)
323  snprintf(SNRpath,sizeof(SNRpath), "%s_snr.txt", ppt->value);
324  else
325  snprintf(SNRpath,sizeof(SNRpath), "snr.txt");
326  //REAL8 WinNorm = sqrt(IFOdata->window->sumofsquares/IFOdata->window->data->length);
328 
329  if( (int) approx == XLAL_FAILURE)
330  ABORTXLAL(&status);
331 
332  REAL8 injtime=0.0;
333  injtime=inj_table->time_geocent_gps.gpsSeconds + 1e-9*inj_table->time_geocent_gps.gpsNanoSeconds;
334  REAL8 hrss_one=1.0;
335  REAL8 deltaT = IFOdata->timeData->deltaT;
336  REAL8 deltaF = IFOdata->freqData->deltaF;
337 
338  REAL8 f_min = IFOdata->fLow;
339  REAL8 f_max = 0.0;
340 
341  LALSimBurstExtraParam *extraParams = NULL;
342 
343  /* Print a line with information about approximant, amp_order, phaseorder, tide order and spin order */
344  fprintf(stdout,"\n\n---\t\t ---\n");
345  fprintf(stdout,"Injection will run using Approximant %d (%s) in the frequency domain.\n",approx,XLALGetStringFromBurstApproximant(approx));
346  fprintf(stdout,"---\t\t ---\n\n");
347 
348  COMPLEX16FrequencySeries *hptilde=NULL, *hctilde=NULL;
349 
350  XLALSimBurstChooseFDWaveform(&hptilde, &hctilde, deltaF,deltaT,inj_table->frequency,inj_table->q,inj_table->duration,f_min,f_max,hrss_one,inj_table->pol_ellipse_angle,inj_table->pol_ellipse_e,extraParams,approx);
351 
352  /* Fail if injection waveform generation was not successful */
353  errnum = *XLALGetErrnoPtr();
354  if (errnum != XLAL_SUCCESS) {
355  XLALPrintError(" ERROR in InjectFD(): error encountered when injecting waveform. errnum=%d\n",errnum);
356  exit(1);
357  }
358  LALInferenceIFOData *dataPtr;
359  REAL8 Fplus, Fcross;
360  REAL8 plainTemplateReal, plainTemplateImag;
361  REAL8 templateReal, templateImag;
362  LIGOTimeGPS GPSlal;
363  REAL8 gmst;
364  REAL8 chisquared;
365  REAL8 timedelay; /* time delay b/w iterferometer & geocenter w.r.t. sky location */
366  REAL8 timeshift; /* time shift (not necessarily same as above) */
367  REAL8 twopit, re, im, dre, dim, newRe, newIm;
368  UINT4 i, lower, upper;
369 
370  REAL8 temp=0.0;
371  REAL8 NetSNR=0.0;
372 
373  /* figure out GMST: */
374  XLALGPSSetREAL8(&GPSlal, injtime);
375  gmst=XLALGreenwichMeanSiderealTime(&GPSlal);
376 
377  /* loop over data (different interferometers): */
378  dataPtr = IFOdata;
379 
380  while (dataPtr != NULL) {
381  /*-- WF to inject is now in hptilde and hctilde. --*/
382  /* determine beam pattern response (Fplus and Fcross) for given Ifo: */
383  XLALComputeDetAMResponse(&Fplus, &Fcross,
384  (const REAL4(*)[3])dataPtr->detector->response,
385  inj_table->ra, inj_table->dec,
386  inj_table->psi, gmst);
387 
388  /* signal arrival time (relative to geocenter); */
389  timedelay = XLALTimeDelayFromEarthCenter(dataPtr->detector->location,
390  inj_table->ra, inj_table->dec,
391  &GPSlal);
392 
393  /* (negative timedelay means signal arrives earlier at Ifo than at geocenter, etc.) */
394  /* amount by which to time-shift template (not necessarily same as above "timedelay"): */
395  REAL8 instant = dataPtr->timeData->epoch.gpsSeconds + 1e-9*dataPtr->timeData->epoch.gpsNanoSeconds;
396 
397  timeshift = (injtime - instant) + timedelay;
398  twopit = LAL_TWOPI * (timeshift);
399  /* Restore hrss (template has been calculated for hrss=1) effect in Fplus/Fcross: */
400  Fplus*=inj_table->hrss;
401  Fcross*=inj_table->hrss;
402  dataPtr->fPlus = Fplus;
403  dataPtr->fCross = Fcross;
404  dataPtr->timeshift = timeshift;
405 
406  char InjFileName[320];
407  sprintf(InjFileName,"injection_%s.dat",dataPtr->name);
408  FILE *outInj=fopen(InjFileName,"w");
409 
410  /* determine frequency range & loop over frequency bins: */
411  lower = (UINT4)ceil(dataPtr->fLow / deltaF);
412  upper = (UINT4)floor(dataPtr->fHigh / deltaF);
413  chisquared = 0.0;
414 
415  re = cos(twopit * deltaF * lower);
416  im = -sin(twopit * deltaF * lower);
417  for (i=lower; i<=upper; ++i){
418  /* derive template (involving location/orientation parameters) from given plus/cross waveforms: */
419  if (i < hptilde->data->length) {
420  plainTemplateReal = Fplus * creal(hptilde->data->data[i])
421  + Fcross * creal(hctilde->data->data[i]);
422  plainTemplateImag = Fplus * cimag(hptilde->data->data[i])
423  + Fcross * cimag(hctilde->data->data[i]);
424  } else {
425  plainTemplateReal = 0.0;
426  plainTemplateImag = 0.0;
427  }
428 
429  /* do time-shifting... */
430  /* (also un-do 1/deltaT scaling): */
431  /* real & imag parts of exp(-2*pi*i*f*deltaT): */
432  templateReal = (plainTemplateReal*re - plainTemplateImag*im);
433  templateImag = (plainTemplateReal*im + plainTemplateImag*re);
434 
435  /* Incremental values, using cos(theta) - 1 = -2*sin(theta/2)^2 */
436  dim = -sin(twopit*deltaF);
437  dre = -2.0*sin(0.5*twopit*deltaF)*sin(0.5*twopit*deltaF);
438  newRe = re + re*dre - im * dim;
439  newIm = im + re*dim + im*dre;
440  re = newRe;
441  im = newIm;
442 
443  fprintf(outInj,"%lf %e %e %e\n",i*deltaF ,templateReal,templateImag,1.0/dataPtr->oneSidedNoisePowerSpectrum->data->data[i]);
444  dataPtr->freqData->data->data[i] += crect( templateReal, templateImag );
445 
446  temp = ((2.0/( deltaT*(double) dataPtr->timeData->data->length) * (templateReal*templateReal+templateImag*templateImag)) / dataPtr->oneSidedNoisePowerSpectrum->data->data[i]);
447  chisquared += temp;
448  }
449  printf("injected SNR %.1f in IFO %s\n",sqrt(2.0*chisquared),dataPtr->name);
450  NetSNR+=2.0*chisquared;
451  dataPtr->SNR=sqrt(2.0*chisquared);
452  dataPtr = dataPtr->next;
453 
454  fclose(outInj);
455  }
456  printf("injected Network SNR %.1f \n",sqrt(NetSNR));
457 
458  ppt=LALInferenceGetProcParamVal(commandLine,"--dont-dump-extras");
459  if (!ppt){
460  PrintSNRsToFile(IFOdata , SNRpath);
461  }
462 
465 }
void REPORTSTATUS(LALStatus *status)
int XLALSimBurstChooseFDWaveform(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 deltaF, REAL8 deltaT, REAL8 f0, REAL8 q, REAL8 tau, REAL8 f_min, REAL8 f_max, REAL8 hrss, REAL8 polar_angle, REAL8 polar_ecc, LALSimBurstExtraParam *extraParams, BurstApproximant approximant)
int XLALGetBurstApproximantFromString(const CHAR *inString)
XLAL function to determine burst approximant from a string.
char * XLALGetStringFromBurstApproximant(BurstApproximant bapproximant)
XLAL function to determine string from approximant enum.
int XLALSimBurstImplementedFDApproximants(BurstApproximant approximant)
Checks whether the given approximant is implemented in lalsimulation's XLALSimInspiralChooseFDWavefor...
BurstApproximant
Enum that specifies the PN approximant to be used in computing the waveform.
static void PrintSNRsToFile(LALInferenceIFOData *IFOdata, char SNRpath[])
void InjectBurstFD(LALInferenceIFOData *IFOdata, SimBurst *inj_table, ProcessParamsTable *commandLine)
-----------— Inject in Frequency domain --------------—‍/
ProcessParamsTable * ppt
int j
#define ABORTXLAL(sp)
SimBurst * XLALSimBurstTableFromLIGOLw(const char *filename)
TimeSlide * XLALTimeSlideTableFromLIGOLw(const char *filename)
#define fprintf
double e
double duration
const double Q
sigmaKerr data[0]
void XLALComputeDetAMResponse(double *fplus, double *fcross, const REAL4 D[3][3], const double ra, const double dec, const double psi, const double gmst)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void XLALDestroyCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series)
#define LAL_TWOPI
#define crect(re, im)
double REAL8
uint32_t UINT4
int32_t INT4
float REAL4
void LALInferenceAddVariable(LALInferenceVariables *vars, const char *name, const void *value, LALInferenceVariableType type, LALInferenceParamVaryType vary)
Add a variable named name to vars with initial value referenced by value.
Definition: LALInference.c:395
void LALInferenceClearVariables(LALInferenceVariables *vars)
Delete the variables in this structure.
Definition: LALInference.c:532
ProcessParamsTable * LALInferenceGetProcParamVal(ProcessParamsTable *procparams, const char *name)
Returns the element of the process params table with "name".
@ LALINFERENCE_PARAM_FIXED
A parameter that is cyclic, such as an angle between 0 and 2pi.
Definition: LALInference.h:130
@ LALINFERENCE_REAL8_t
Definition: LALInference.h:109
void LALInferenceBurstInjectionToVariables(SimBurst *theEventTable, LALInferenceVariables *vars)
Fill the variables passed in vars with the parameters of the injection passed in event will over-writ...
void LALInferenceInjectBurstSignal(LALInferenceIFOData *IFOdata, ProcessParamsTable *commandLine)
Read IFO data according to command line arguments.
static const INT4 q
int XLALResampleREAL8TimeSeries(REAL8TimeSeries *series, REAL8 dt)
REAL8 XLALTimeDelayFromEarthCenter(const double detector_earthfixed_xyz_metres[3], double source_right_ascension_radians, double source_declination_radians, const LIGOTimeGPS *gpstime)
int XLALREAL8TimeFreqFFT(COMPLEX16FrequencySeries *freq, const REAL8TimeSeries *tser, const REAL8FFTPlan *plan)
REAL8TimeSeries * XLALCreateREAL8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
const LALUnit lalStrainUnit
const LALUnit lalDimensionlessUnit
#define XLAL_ERROR_VOID(...)
int * XLALGetErrnoPtr(void)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EINVAL
XLAL_FAILURE
REAL8 XLALGreenwichMeanSiderealTime(const LIGOTimeGPS *gpstime)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
int XLALBurstInjectSignals(REAL8TimeSeries *h, const SimBurst *sim_burst, const TimeSlide *time_slide_table_head, const COMPLEX16FrequencySeries *response)
COMPLEX16Sequence * data
COMPLEX16 * data
REAL4 response[3][3]
REAL8 location[3]
Structure to contain IFO data.
Definition: LALInference.h:625
REAL8TimeSeries * timeData
Detector name.
Definition: LALInference.h:627
LALDetector * detector
integration limits for overlap integral in F-domain
Definition: LALInference.h:651
REAL8FrequencySeries * oneSidedNoisePowerSpectrum
Definition: LALInference.h:643
REAL8 timeshift
Detector responses.
Definition: LALInference.h:638
REAL8FFTPlan * timeToFreqFFTPlan
Padding for the above window.
Definition: LALInference.h:648
REAL8Window * window
(one-sided Noise Power Spectrum)^{-1/2}
Definition: LALInference.h:646
char name[DETNAMELEN]
Definition: LALInference.h:626
COMPLEX16FrequencySeries * freqData
What is this?
Definition: LALInference.h:639
REAL8 SNR
The epoch of this observation (the time of the first sample)
Definition: LALInference.h:653
struct tagLALInferenceIFOData * next
ROQ data.
Definition: LALInference.h:659
REAL8 fLow
FFT plan needed for time/time-and-phase marginalisation.
Definition: LALInference.h:650
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...
Definition: LALInference.h:170
LALInferenceVariableItem * head
Definition: LALInference.h:171
Linked list of any number of parameters for testing GR.
INT4 gpsNanoSeconds
CHAR value[LIGOMETA_VALUE_MAX]
REAL8Sequence * data
REAL8Sequence * data
LIGOTimeGPS epoch
REAL8 * data
REAL8Sequence * data
char waveform[LIGOMETA_WAVEFORM_MAX]
struct tagSimBurst * next
LIGOTimeGPS time_geocent_gps
REAL8 pol_ellipse_angle
REAL8 frequency
REAL8 psi
REAL8 duration
REAL8 ra
REAL8 pol_ellipse_e
REAL8 dec
REAL8 hrss
double hrss
double f_min
double f_max