26#include <lal/GenerateInspiral.h>
27#include <lal/LALInference.h>
28#include <lal/FrequencySeries.h>
30#include <lal/StringInput.h>
31#include <lal/LIGOLwXMLRead.h>
32#include <lal/TimeSeries.h>
33#include <lal/LALInferencePrior.h>
34#include <lal/LALInferenceTemplate.h>
35#include <lal/LALInferenceProposal.h>
36#include <lal/LALInferenceLikelihood.h>
37#include <lal/LALInferenceReadData.h>
38#include <lal/LALInferenceInit.h>
39#include <lal/LALInferenceCalibrationErrors.h>
40#include <lal/LALSimNeutronStar.h>
46 char *post=NULL,*
pos=NULL;
47 if (list==NULL)
return 0;
48 if (param==NULL)
return 0;
50 if(!(
pos=strstr(list,param)))
return 0;
58 post=&(
pos[strlen(param)]);
85 run_state->commandLine = command_line;
94 if (run_state->data == NULL)
99 run_state->GSLrandom = gsl_rng_alloc(gsl_rng_mt19937);
106 if ((devrandom = fopen(
"/dev/urandom",
"r")) == NULL) {
107 gettimeofday(&tv, 0);
108 randomseed = tv.tv_sec + tv.tv_usec;
110 fread(&randomseed,
sizeof(randomseed), 1, devrandom);
114 gsl_rng_set(run_state->GSLrandom, randomseed);
125 if (run_state == NULL)
128 if (run_state->
threads == NULL) {
129 XLALPrintError(
"Error: LALInferenceDrawThreads expects initialized run_state->threads\n");
138 REAL8 dist_low, dist_high;
139 REAL8 restricted_dist_low = log(10.0);
140 REAL8 restricted_dist_high = log(100.0);
141 INT4 changed_dist = 0;
155 #pragma omp parallel for private(thread)
156 for (t = 0; t < run_state->
nthreads; t++) {
159 thread = &(run_state->
threads[t]);
167 while(isinf(run_state->
prior(run_state,
204 if (run_state == NULL){
218 for (t = 0; t < nthreads; t++) {
219 thread = &(run_state->
threads[t]);
222 thread->
parent = run_state;
231 while (
data != NULL) {
241 fprintf(stderr,
"done LALInferenceSetupROQmodel\n");
254 thread->
GSLrandom = gsl_rng_alloc(gsl_rng_mt19937);
255 randomseed = gsl_rng_get(run_state->
GSLrandom);
256 gsl_rng_set(thread->
GSLrandom, randomseed);
267 char help[]=
"(--template [LAL,PhenSpin,LALGenerateInspiral,LALSim,multiband]\tSpecify template (default LAL)\n";
286 else if(!strcmp(
"multiband",
ppt->
value)){
288 fprintf(stdout,
"Template function called is \"LALInferenceTemplateXLALSimInspiralChooseWaveformPhaseInterpolated\"\n");
297 fprintf(stderr,
"Warning: --LALSimulation is deprecated, the LALSimulation package is now the default. To use LALInspiral specify:\n\
298 --template LALGenerateInspiral (for time-domain templates)\n\
299 --template LAL (for frequency-domain templates)\n");
303 fprintf(stderr,
"template is \"LALInferenceROQWrapperForXLALSimInspiralChooseFDWaveformSequence\"\n");
306 fprintf(stdout,
"Template function called is \"LALInferenceTemplateXLALSimInspiralChooseWaveform\"\n");
331 dataPtr = runState->
data;
332 while (dataPtr != NULL)
334 dataPtr = dataPtr->
next;
337 dataPtr = runState->
data;
343 gsl_matrix *mAmp = gsl_matrix_alloc(nifo,(
int)(gmax));
344 gsl_matrix *mf0 = gsl_matrix_alloc(nifo,(
int)(gmax));
345 gsl_matrix *mQ = gsl_matrix_alloc(nifo,(
int)(gmax));
346 gsl_matrix *mt0 = gsl_matrix_alloc(nifo,(
int)(gmax));
347 gsl_matrix *mphi = gsl_matrix_alloc(nifo,(
int)(gmax));
358 Anorm = sqrt(TwoDeltaToverN);
360 Amax = 10000.0/Anorm;
371 gsl_matrix_set_all(mAmp, Amin);
372 gsl_matrix_set_all(mf0,
f_min);
373 gsl_matrix_set_all(mQ, Qmin);
374 gsl_matrix_set_all(mt0, tmin);
375 gsl_matrix_set_all(mphi, pmin);
377 gsl_matrix *gFD = gsl_matrix_alloc(nifo,(
int)
n);
379 for(
i=0;
i<nifo;
i++) gsize->
data[
i]=0;
414#define CAL_ENV_FORMAT "%lf %lf %lf %lf %lf %lf %lf\n"
422 if(!
fp) {
fprintf(stderr,
"Unable to open %s: Error %i %s\n",
filename,errno,strerror(errno)); exit(1);}
424 REAL8 freq, *logfreq=NULL, *mag_med=NULL, mag_low, mag_hi, *mag_std=NULL, *phase_med=NULL, phase_low, phase_hi, *
phase_std=NULL;
425 for(Nlines=0;fgets(tmpline,1024,
fp); )
428 if(tmpline[0]==
'#')
continue;
430 logfreq=realloc(logfreq,
sizeof(*logfreq)*(Nlines+1));
431 mag_med=realloc(mag_med,
sizeof(*mag_med)*(Nlines+1));
432 mag_std=realloc(mag_std,
sizeof(*mag_std)*(Nlines+1));
433 phase_med=realloc(phase_med,
sizeof(*phase_med)*(Nlines+1));
436 if((7!=sscanf(tmpline,
CAL_ENV_FORMAT, &freq, &(mag_med[Nlines]), &(phase_med[Nlines]), &mag_low, &phase_low, &mag_hi, &phase_hi)))
438 fprintf(stderr,
"Malformed input line in file %s: %s\n",
filename,tmpline);
441 mag_med[Nlines]-=1.0;
442 logfreq[Nlines]=log(freq);
443 mag_std[Nlines]=(mag_hi - mag_low ) /2.0;
444 phase_std[Nlines]=(phase_hi - phase_low) /2.0;
447 fprintf(stdout,
"Read %i lines from calibration envelope %s\n",Nlines,
filename);
451 env->
amp_median = gsl_spline_alloc ( gsl_interp_cspline, Nlines);
452 env->
amp_std = gsl_spline_alloc ( gsl_interp_cspline, Nlines);
453 env->
phase_median = gsl_spline_alloc ( gsl_interp_cspline, Nlines);
454 env->
phase_std = gsl_spline_alloc ( gsl_interp_cspline, Nlines);
456 gsl_spline_init(env->
amp_median, logfreq, mag_med, Nlines);
457 gsl_spline_init(env->
amp_std, logfreq, mag_std, Nlines);
458 gsl_spline_init(env->
phase_median, logfreq, phase_med, Nlines);
463 free(logfreq); free(mag_med); free(mag_std); free(phase_med); free(
phase_std);
489 REAL8 ampUncertaintyPrior = 0.1;
490 REAL8 phaseUncertaintyPrior = 5*M_PI/180.0;
494 fprintf(stderr,
"ERROR: given '--spcal-nodes %d', but cannot spline with fewer than 3\n", ncal);
502 for(ifo=runState->
data;ifo;ifo=ifo->
next) {
511 REAL8 logFMin = log(fMin);
512 REAL8 logFMax = log(fMax);
523 fprintf(stderr,
"variable name too long\n"); exit(1);
536 ampUncertaintyPrior = atof(
ppt->
value);
539 fprintf(stderr,
"Error, missing %s or %s\n",amp_uncert_op, env_uncert_op);
544 phaseUncertaintyPrior = M_PI/180.0*atof(
ppt->
value);
547 fprintf(stderr,
"Error, missing %s or %s\n",pha_uncert_op,env_uncert_op);
551 REAL8 dLogF = (logFMax - logFMin)/(ncal-1);
559 fprintf(stderr,
"Variable name too long\n"); exit(1);
563 REAL8 logFreq = logFMin +
i*dLogF;
568 amp_mean = gsl_spline_eval(env->
amp_median, logFreq, NULL);
570 phase_mean = gsl_spline_eval(env->
phase_median, logFreq, NULL);
583 REAL8 camp_max_A=0.25;
584 REAL8 camp_min_A=-0.25;
586 dataPtr = runState->
data;
587 while (dataPtr != NULL){
589 sprintf(CA_A,
"%s_%s",
"calamp",dataPtr->
name);
591 dataPtr = dataPtr->
next;
596 REAL8 ampUncertaintyPrior=-1.0;
599 ampUncertaintyPrior = atof(
ppt->
value);
605 REAL8 cpha_max_A=0.349;
606 REAL8 cpha_min_A=-0.349;
608 dataPtr = runState->
data;
609 while (dataPtr != NULL)
612 sprintf(CP_A,
"%s_%s",
"calpha",dataPtr->
name);
614 dataPtr = dataPtr->
next;
619 REAL8 phaseUncertaintyPrior=-1.0;
622 phaseUncertaintyPrior = M_PI/180.0*atof(
ppt->
value);
642 sprintf(meanopt,
"--%s-mean",
name);
643 sprintf(sigmaopt,
"--%s-sigma",
name);
644 sprintf(valopt,
"--%s",
name);
645 sprintf(fixopt,
"--fix-%s",
name);
670 sprintf(minopt,
"--%s-min",
name);
671 sprintf(maxopt,
"--%s-max",
name);
672 sprintf(valopt,
"--%s",
name);
673 sprintf(fixopt,
"--fix-%s",
name);
686 fprintf(stderr,
"ERROR: Prior for %s has min(%lf) > max(%lf)\n",
name,min,
max);
689 if(startval<min || startval>
max){
690 fprintf(stderr,
"ERROR: Initial value %lf for %s lies outwith prior (%lf,%lf)\n",startval,
name,min,
max);
694 if (!strcmp(
name,
"eta"))
696 fprintf(stderr,
"ERROR: maximum of eta cannot be larger than 0.25. Check --eta-max\n");
699 if (!strcmp(
name,
"q")){
703 if (qMin <= 0.0 || qMin > 1.0)
705 fprintf(stderr,
"ERROR: qMin must be between 0 and 1, got value qMin=%f\n",qMin);
708 if (qMax > 1.0 || qMax <0.0 || qMax < qMin)
710 fprintf(stderr,
"ERROR: qMax must be between 0 and 1, and qMax > qMin. Got value qMax=%f, qMin=%f\n",qMax,qMin);
727 ----------------------------------------------\n\
728 --- Injection Arguments ----------------------\n\
729 ----------------------------------------------\n\
730 (--inj injections.xml) Injection XML file to use\n\
731 (--event N) Event number from Injection XML file to use\n\
733 ----------------------------------------------\n\
734 --- Template Arguments -----------------------\n\
735 ----------------------------------------------\n\
736 (--use-eta) Jump in symmetric mass ratio eta, instead of q=m1/m2 (m1>m2)\n\
737 (--approx) Specify a template approximant and phase order to use\n\
738 (default TaylorF2threePointFivePN). Available approximants:\n\
739 default modeldomain=\"time\": GeneratePPN, TaylorT1, TaylorT2,\n\
740 TaylorT3, TaylorT4, EOB, EOBNR,\n\
741 EOBNRv2, EOBNRv2HM, SEOBNRv1,\n\
742 SpinTaylor, SpinQuadTaylor, \n\
743 SpinTaylorFrameless, SpinTaylorT4,\n\
744 PhenSpinTaylorRD, NumRel.\n\
745 default modeldomain=\"frequency\": TaylorF1, TaylorF2, TaylorF2RedSpin,\n\
746 TaylorF2RedSpinTidal, IMRPhenomA,\n\
747 IMRPhenomB, IMRPhenomP, IMRPhenomPv2.\n\
748 (--amporder PNorder) Specify a PN order in amplitude to use (defaults: LALSimulation: max available; LALInspiral: newtownian).\n\
749 (--fref f_ref) Specify a reference frequency at which parameters are defined (default 100).\n\
750 (--tidal) Enables tidal corrections, only with LALSimulation.\n\
751 (--tidalT) Enables reparmeterized tidal corrections, only with LALSimulation.\n\
752 (--4PolyEOS) Enables 4-piece polytropic EOS parmeterization, only with LALSimulation.\n\
753 (--4SpectralDecomp) Enables 4-coeff. spectral decomposition EOS parmeterization, only with LALSimulation.\n\
754 (--eos EOS) Fix the neutron star EOS. Use \"--eos help\" for allowed names\n\
755 (--BinaryLove) Enable the Binary Neutron Star common EoS tidal model, expressed through EOS-insensitive relations\n\
756 (--spinOrder PNorder) Specify twice the PN order (e.g. 5 <==> 2.5PN) of spin effects to use, only for LALSimulation (default: -1 <==> Use all spin effects).\n\
757 (--tidalOrder PNorder) Specify twice the PN order (e.g. 10 <==> 5PN) of tidal effects to use, only for LALSimulation (default: -1 <==> Use all tidal effects).\n\
758 (--numreldata FileName) Location of NR data file for NR waveforms (with NR_hdf5 approx).\n\
759 (--modeldomain) domain the waveform template will be computed in (\"time\" or \"frequency\"). If not given will use LALSim to decide\n\
760 (--spinAligned or --aligned-spin) template will assume spins aligned with the orbital angular momentum.\n\
761 (--singleSpin) template will assume only the spin of the most massive binary component exists.\n\
762 (--noSpin, --disable-spin) template will assume no spins (giving this will void spinOrder!=0) \n\
763 (--no-detector-frame) model will NOT use detector-centred coordinates and instead RA,dec\n\
764 (--nonGR_alpha value) this is a LIV parameter which should only be passed when log10lambda_eff/lambda_eff is passed as a grtest-parameter for LIV test\n\
765 (--LIV_A_sign) this is a LIV parameter determining if +A or -A is being tested; A occurs in the modified dispersion relation. LIV_A_sign has to be either +1 or -1 \n\
766 (--liv) this flag is now needed for launching a LIV run\n\
767 (--grtest-parameters dchi0,..,dxi1,..,dalpha1,..) template will assume deformations in the corresponding phase coefficients.\n\
768 (--generic-fd-correction) enables the generic frequency domain corrections to the template phase. \n\
769 (--generic-fd-correction-hm) apply generic frequency domain corrections to higher-modes waveform. \n\
770 (--generic-fd-correction-window) sets the fraction of the peak frequency up to which the generic phase corrections are applied (default=1). \n\
771 (--generic-fd-correction-ncycles) sets the number of cycles for the tapering of the generic phase corrections (default=1). \n\
772 (--ppe-parameters aPPE1,.... template will assume the presence of an arbitrary number of PPE parameters. They must be paired correctly.\n\
773 (--modeList lm,l-m...,lm,l-m) List of modes to be used by the model. The chosen modes ('lm') should be passed as a ',' seperated list.\n\
774 (--phenomXHMMband float) Threshold parameter for the Multibanding of the non-precessing hlm modes in IMRPhenomXHM and IMRPhenomXPHM. If set to 0 then do not use multibanding.\n\
775 Options and default values can be found in https://lscsoft.docs.ligo.org/lalsuite/lalsimulation/group___l_a_l_sim_i_m_r_phenom_x__c.html\n\
776 (--phenomXPHMMband float) Threshold parameter for the Multibanding of the Euler angles in IMRPhenomXPHM. If set to 0 then do not use multibanding.\n\
777 Options and default values can be found in https://lscsoft.docs.ligo.org/lalsuite/lalsimulation/group___l_a_l_sim_i_m_r_phenom_x__c.html\n\
778 (--phenomXPFinalSpinMod int) Change version for the final spin model used in IMRPhenomXP/IMRPhenomXPHM.\n\
779 Options and default values can be found in https://lscsoft.docs.ligo.org/lalsuite/lalsimulation/group___l_a_l_sim_i_m_r_phenom_x__c.html\n\
780 (--phenomXPrecVersion int) Change version of the Euler angles for the twisting-up of IMRPhenomXP/IMRPhenomXPHM.\n\
781 Options and default values can be found in https://lscsoft.docs.ligo.org/lalsuite/lalsimulation/group___l_a_l_sim_i_m_r_phenom_x__c.html\n\
783 ----------------------------------------------\n\
784 --- Starting Parameters ----------------------\n\
785 ----------------------------------------------\n\
786 You can generally have MCMC chains to start from a given parameter value by using --parname VALUE. Names currently known to the code are:\n\
787 time Waveform time (overrides random about trigtime).\n\
788 chirpmass Chirpmass\n\
789 eta Symmetric massratio (needs --use-eta)\n\
790 q Asymmetric massratio (a.k.a. q=m2/m1 with m1>m2)\n\
791 phase Coalescence phase.\n\
792 costheta_jn Cosine of angle between J and line of sight [rads]\n\
793 logdistance Log Distance (requires --use-logdistance)\n\
794 rightascension Rightascensions\n\
795 declination Declination.\n\
796 polarisation Polarisation angle.\n\
797 * Spin Parameters:\n\
798 a_spin1 Spin1 magnitude\n\
799 a_spin2 Spin2 magnitude\n\
800 tilt_spin1 Angle between spin1 and orbital angular momentum\n\
801 tilt_spin2 Angle between spin2 and orbital angular momentum \n\
802 phi_12 Difference between spins' azimuthal angles \n\
803 phi_jl Difference between total and orbital angular momentum azimuthal angles\n\
804 * Equation of State parameters:\n\
805 (requires --tidal)\n\
808 (requires --tidalT)\n\
810 dLambdaT dLambdaT.\n\
811 (requires --4PolyEOS)\n\
816 (requires --BinaryLove)\n\
817 lambdaS Symmetric tidal deformability.\n\
818 (requires --4SpectralDecomp):\n\
819 SDgamma0 SDgamma0.\n\
820 SDgamma1 SDgamma1.\n\
821 SDgamma2 SDgamma2.\n\
822 SDgamma3 SDgamma3.\n\
824 * Spin-induced quadrupole moment test parameters:\n\
825 (requires --dQuadMon12)\n\
826 dQuadMon1 dQuadMon1.\n\
827 dQuadMon2 dQuadMon2.\n\
828 (requires --dQuadMonSA) \n\
829 dQuadMonS dQuadMonS.\n\
830 dQuadMonA dQuadMonA.\n\
831 (dQuadMonS and dQuadMonA are the symmetric and antisymmetric combinations of dQuadMon1 and dQuadMon2).\n\
832 ----------------------------------------------\n\
833 --- Prior Ranges -----------------------------\n\
834 ----------------------------------------------\n\
835 You can generally use --paramname-min MIN --paramname-max MAX to set the prior range for the parameter paramname\n\
836 The names known to the code are listed below.\n\
837 Component masses, total mass and time have dedicated options listed here:\n\n\
838 (--trigtime time) Center of the prior for the time variable.\n\
839 (--comp-min min) Minimum component mass (1.0).\n\
840 (--comp-max max) Maximum component mass (100.0).\n\
841 (--mass1-min min, --mass1-max max) Min and max for mass1 (default: same as comp-min,comp-max, will over-ride these.\n\
842 (--mass2-min min, --mass2-max max) Min and max for mass2 (default: same as comp-min,comp-max, will over-ride these.\n\
843 (--mtotal-min min) Minimum total mass (2.0).\n\
844 (--mtotal-max max) Maximum total mass (200.0).\n\
845 (--dt time) Width of time prior, centred around trigger (0.2s).\n\
847 (--ns-max-mass) Maximum observed NS mass used for EOS prior (none).\n\
848 (--varyFlow, --flowMin, --flowMax) Allow the lower frequency bound of integration to vary in given range.\n\
849 (--pinparams) List of parameters to set to injected values [mchirp,asym_massratio,etc].\n\
850 ----------------------------------------------\n\
851 --- Fix Parameters ---------------------------\n\
852 ----------------------------------------------\n\
853 You can generally fix a parameter to be fixed to a given values by using --fix-paramname VALUE\n\
854 where the known names have been listed above.\n\
890 REAL8 Dinitial = (Dmax + Dmin)/2.0;
901 REAL8 costhetaJNmin=-1.0 , costhetaJNmax=1.0;
903 REAL8 lambda1Min=0.0;
904 REAL8 lambda1Max=3000.0;
905 REAL8 lambda2Min=0.0;
906 REAL8 lambda2Max=3000.0;
907 REAL8 lambdaTMin=0.0;
908 REAL8 lambdaTMax=3000.0;
909 REAL8 dLambdaTMin=-500.0;
910 REAL8 dLambdaTMax=500.0;
911 REAL8 dQuadMonMin=-200.0;
912 REAL8 dQuadMonMax=200.0;
921 REAL8 lambdaSMin=0.0;
922 REAL8 lambdaSMax=5000.0;
923 REAL8 SDgamma0Min=0.2;
924 REAL8 SDgamma0Max=2.0;
925 REAL8 SDgamma1Min=-1.6;
926 REAL8 SDgamma1Max=1.7;
927 REAL8 SDgamma2Min=-0.6;
928 REAL8 SDgamma2Max=0.6;
929 REAL8 SDgamma3Min=-0.02;
930 REAL8 SDgamma3Max=0.02;
932 REAL8 endtime=0.0, timeParam=0.0;
933 REAL8 timeMin=endtime-
dt,timeMax=endtime+
dt;
957 if(
ppt)signal_flag=0;
981 memset(&tempParams,0,
sizeof(tempParams));
989 char *
name=strings[
N];
993 else {
fprintf(stderr,
"Error: Cannot pin parameter %s. No such parameter found in injection!\n",
name);}
1030 fprintf(stderr,
"ERROR. Unknown approximant number %i. Unable to choose time or frequency domain model.",
approx);
1039 if ( ! strcmp(
"time",
ppt->
value ) )
1043 else if ( ! strcmp(
"frequency",
ppt->
value ) )
1049 fprintf( stderr,
"invalid argument to --modeldomain:\n"
1050 "unknown domain specified: "
1051 "domain must be one of: time, frequency\n");
1064 qMin = m2_min / m1_max;
1065 mcMin =mtot_min*pow(qMin/pow(1.+qMin,2.),3./5.);
1066 mcMax =mtot_max*pow(0.25,3./5.);
1073 fprintf(stdout,
"Using end time from injection file: %lf\n", endtime);
1079 printf(
"Read end time %f\n",endtime);
1085 timeMin=endtime-
dt; timeMax=endtime+
dt;
1086 timeParam = timeMin + (timeMax-timeMin)*gsl_rng_uniform(GSLrandom);
1098 dataPtr = state->
data;
1099 while (dataPtr != NULL)
1106 dataPtr = dataPtr->
next;
1116 REAL8 fLow_max = 200.0;
1119 if (f_ref > 0.0 && fLow_max > f_ref) {
1120 fprintf(stdout,
"WARNING: flow can't go higher than the reference frequency. Setting flow-max to %f\n",f_ref);
1147 else nscale_block = 8;
1158 model->
deltaT = state->
data->timeData->deltaT;
1159 model->
deltaF = state->
data->freqData->deltaF;
1163 dataPtr = state->
data;
1164 while (dataPtr != NULL)
1179 fprintf(stderr,
"Warning: Different IFO's have different minimum frequencies -- bad for noise fitting\n");
1184 fprintf(stderr,
"Warning: Different IFO's have different minimum frequencies -- bad for noise fitting\n");
1189 dataPtr = dataPtr->
next;
1199 printf(
"WARNING: --psdFit has been deprecated in favor of --psd-fit\n");
1206 printf(
"Setting up PSD fitting for %i ifos...\n",nifo);
1208 dataPtr = state->
data;
1210 gsl_matrix *bands_min = gsl_matrix_alloc(nifo,nscale_block);
1211 gsl_matrix *bands_max = gsl_matrix_alloc(nifo,nscale_block);
1214 while (dataPtr != NULL)
1216 printf(
"ifo=%i %s\n",
i,dataPtr->
name);fflush(stdout);
1218 nscale_bin = (imax+1-imin)/nscale_block;
1219 nscale_dflog = log( (
double)(imax+1)/(
double)imin )/(double)nscale_block;
1223 for (
j = 0;
j < nscale_block;
j++)
1226 freq_min = (
int) exp(log((
double)imin ) + nscale_dflog*
j);
1227 freq_max = (
int) exp(log((
double)imin ) + nscale_dflog*(
j+1));
1234 dataPtr = dataPtr->
next;
1239 printf(
"Running PSD fitting with bands (Hz)...\n");
1240 dataPtr = state->
data;
1242 while (dataPtr != NULL)
1244 printf(
"%s:",dataPtr->
name);
1245 for (
j = 0;
j < nscale_block;
j++)
1247 printf(
" %f-%f ",gsl_matrix_get(bands_min,
i,
j)*
df,gsl_matrix_get(bands_max,
i,
j)*
df);
1250 dataPtr = dataPtr->
next;
1255 nscale_dflog = log( (
double)(
f_max+1)/(
double)
f_min )/(double)nscale_block;
1257 nscale_min = 1.0e-1;
1258 nscale_max = 1.0e+1;
1259 nscale_dim = nscale_block*nifo;
1265 for(
i=0;
i<nscale_block;
i++)
1267 nscale_prior->
data[
i] = 1.0/sqrt( gsl_matrix_get(bands_max,0,
i)-gsl_matrix_get(bands_min,0,
i) );
1268 nscale_sigma->
data[
i] = nscale_prior->
data[
i]/sqrt((
double)(nifo*nscale_block));
1271 gsl_matrix *nscale = gsl_matrix_alloc(nifo,nscale_block);
1272 gsl_matrix_set_all(nscale, 1.0);
1295 UINT4 psdGaussianPrior=1;
1297 if(
ppt)psdGaussianPrior=0;
1302 printf(
"WARNING: --glitchFit has been deprecated in favor of --glitch-fit\n");
1346 REAL8 a = log(Dmin), b=log(Dmax);
1363 printf(
"Using detector-based sky frame\n");
1428 XLALPrintError(
"Error: cannot use more than one of --tidalT, --tidal, --4PolyEOS, --4SpectralDecomp, --eos and --BinaryLove.\n");
1481 XLALPrintError(
"Error: cannot use more than one of --dQuadMon12 and --dQuadMonSA.\n");
1518 char substring[] =
"-";
1520 char* tempstr = calloc(strlen(
ppt->
value)+1,
sizeof(
char));
1522 char *modes = strtok_r(tempstr,
",", &end_str);
1532 fprintf(stdout,
"Template will use a custom mode array.\n");
1533 while (modes != NULL) {
1536 if (strstr(modes, substring) != NULL) {
1538 char *token = strtok_r(modes,
"-", &end_token);
1539 while (token != NULL) {
1541 modes_l=realloc(modes_l,
sizeof(*modes_l)*l_size);
1543 modes_l[ii++]= atoi(token);
1545 modes_m=realloc(modes_m,
sizeof(*modes_m)*m_size);
1547 modes_m[jj++]= -1 * atoi(token);
1550 token = strtok_r(NULL,
"-", &end_token);
1555 int value = atoi(modes);
1556 for (
k=2;
k>=0;
k--) {
1558 modes_m=realloc(modes_m,
sizeof(*modes_m)*m_size);
1560 modes_m[jj++] = value % 10;
1561 }
else if (
k == 1) {
1562 modes_l=realloc(modes_l,
sizeof(*modes_l)*l_size);
1564 modes_l[ii++]= value % 10;
1569 modes = strtok_r(NULL,
",", &end_str);
1574 for (
int idx_i=0; idx_i<ii; idx_i+=1){
1575 fprintf(stdout,
"Template will use the l=%d m=%d mode \n", modes_l[idx_i], modes_m[idx_i]);
1600 fprintf(stdout,
"Template will use PhenomXPFinalSpinMod %s.\n",
ppt->
value);
1607 fprintf(stdout,
"Template will use PhenomXPrecVersion %s.\n",
ppt->
value);
1613 fprintf(stdout,
"\n\n---\t\t ---\n");
1622 fprintf(stdout,
"Templates will run using Approximant %i (%s), phase order %i, amp order %i, spin order %i tidal order %i in the %s domain.\n",
approx,
XLALSimInspiralGetStringFromApproximant(
approx),PhaseOrder,AmpOrder,(
int)
spinO, (
int)
tideO, model->
domain==
LAL_SIM_DOMAIN_TIME?
"time":
"frequency");
1623 fprintf(stdout,
"---\t\t ---\n\n");
1628 fprintf(stdout,
"\n\n------\n");
1629 fprintf(stdout,
"Noise only run\n");
1635 &(state->
data->timeData->epoch),
1639 state->
data->timeData->data->length);
1641 &(state->
data->timeData->epoch),
1645 state->
data->timeData->data->length);
1647 &(state->
data->freqData->epoch),
1651 state->
data->freqData->data->length);
1653 &(state->
data->freqData->epoch),
1657 state->
data->freqData->data->length);
1660 for (
i=0;
i<nifo;
i++)
1662 &(state->
data->freqData->epoch),
1666 state->
data->freqData->data->length);
1697 char **strings=NULL;
1698 char *pinned_params=NULL;
1703 memset(&tempParams,0,
sizeof(tempParams));
1710 dataPtr = state->
data;
1711 while (dataPtr != NULL) {
1713 dataPtr = dataPtr->
next;
1723 fprintf(stdout,
"Setting up priors\n");
1743 char **strings=NULL;
1744 char *pinned_params=NULL;
1749 memset(&tempParams,0,
sizeof(tempParams));
1756 dataPtr = state->
data;
1757 while (dataPtr != NULL) {
1759 dataPtr = dataPtr->
next;
1770 fprintf(stdout,
"Setting up priors\n");
1788 char **strings=NULL;
1789 char *pinned_params=NULL;
1794 memset(&tempParams,0,
sizeof(tempParams));
1801 dataPtr = state->
data;
1802 while (dataPtr != NULL) {
1804 dataPtr = dataPtr->
next;
1813 struct varSettings {
const char *
name;
REAL8 val, min,
max;};
1815 struct varSettings setup[]=
1817 {.name=
"time", .val=0.0, .min=-2., .max=2.},
1818 {.name=
"mass1", .val=16., .min=14., .max=18.},
1819 {.name=
"mass2", .val=7., .min=5., .max=9.},
1820 {.name=
"logdistance", .val=log(50.), .min=log(45.), .max=log(55.)},
1821 {.name=
"costheta_jn", .val=cos(
LAL_PI/2.), .min=cos(3.570796327), .max=cos(-0.429203673)},
1822 {.name=
"phase", .val=
LAL_PI, .min=1.141592654, .max=5.141592654},
1823 {.name=
"polarisation", .val=
LAL_PI/2., .min=-0.429203673, .max=3.570796327},
1824 {.name=
"rightascension", .val=
LAL_PI, .min=1.141592654, .max=5.141592654},
1825 {.name=
"declination", .val=0., .min=-2., .max=2.},
1826 {.name=
"a_spin1", .val=0.5, .min=-1.5, .max=2.5},
1827 {.name=
"a_spin2", .val=0.5, .min=-1.5, .max=2.5},
1828 {.name=
"tilt_spin1", .val=
LAL_PI/2., .min=-0.429203673, .max=3.570796327},
1829 {.name=
"tilt_spin2", .val=
LAL_PI/2., .min=-0.429203673, .max=3.570796327},
1830 {.name=
"phi12", .val=
LAL_PI, .min=1.141592654, .max=5.141592654},
1831 {.name=
"phi_jl", .val=
LAL_PI, .min=1.141592654, .max=5.141592654},
1832 {.name=
"END", .val=0., .min=0., .max=0.}
1835 while(strcmp(
"END",setup[
i].
name))
1874 XLALPrintWarning(
"WARNING: No phase order given. Using maximum available order for the template.\n");
1890 XLALPrintWarning(
"WARNING: Injection specified amplitude order %i. Template will use %i\n",
1895 XLALPrintWarning(
"WARNING: Injection specified phase order %i. Template will use %i\n",\
1901 if (
ppt && ppt_order){
1905 else if (
ppt || ppt_order){
1907 XLALPrintWarning(
"WARNING: You set the spin order only for the template (%i). Injection will use default value (%i). You can change that with --inj-spinOrder. \n",atoi(
ppt->
value),default_spinO);
1909 XLALPrintWarning(
"WARNING: You set the spin order only for the injection (%i). Template will use default value (%i). You can change that with --spinOrder. \n",atoi(ppt_order->
value),default_spinO); }
1911 XLALPrintWarning(
"WARNING: You did not set the spin order. Injection and template will use default values (%i). You change that using --inj-spinOrder (set injection value) and --spinOrder (set template value).\n",default_spinO);
1915 if (
ppt && ppt_order){
1919 else if (
ppt || ppt_order){
1921 XLALPrintWarning(
"WARNING: You set the tidal order only for the template (%d). Injection will use default value (%i). You can change that with --inj-tidalOrder. \n",atoi(
ppt->
value),default_tideO);
1923 XLALPrintWarning(
"WARNING: You set the tidal order only for the injection (%i). Template will use default value (%i). You can change that with --tidalOrder\n",atoi(ppt_order->
value),default_tideO);
1926 XLALPrintWarning(
"WARNING: You did not set the tidal order. Injection and template will use default values (%i). You change that using --inj-tidalOrder (set injection value) and --tidalOrder (set template value).\n",default_tideO);
1950 fprintf(stderr,
"ERROR: PSD length must be positive. Exiting...\n");
1959 XLALPrintError(
"Must provide segment length with --seglen. Exiting...");
1966 fprintf(stderr,
"ERROR: seglen must be positive. Exiting...\n");
1969 REAL8 timeSkipStart=0.;
1970 REAL8 timeSkipEnd=0.;
1975 if(timeSkipStart+timeSkipEnd >
seglen)
1977 fprintf(stderr,
"ERROR: --time-pad-start + --time-pad-end is greater than --seglen!");
1987 itmp=atoi(ppt2->value);
1988 if (itmp>0 || itmp==-1)
1989 XLALPrintWarning(
"--spinO > 0 or -1 will be ignored due to --disable-spin. If you want to include spin terms in the template, remove --disable-spin\n");
1993 XLALPrintWarning(
"--spinO defaulted to -1. This will be ignored due to --disable-spin. If you want to include spin terms in the template, remove --disable-spin\n");
1998 fprintf(stderr,
"--aligned-spin and --disable-spin are incompatible options. Exiting\n");
2003 fprintf(stderr,
"--singleSpin and --disable-spin are incompatible options. Exiting\n");
2014 fprintf(stderr,
"ERROR: nlive must be positive. Exiting...\n");
2018 XLALPrintWarning(
"WARNING: Using %d live points. This is very little and may lead to unreliable results. Consider increasing.\n",itmp);
2021 XLALPrintWarning(
"WARNING: Using %d live points. This is a very large number and may lead to very long runs. Consider decreasing.\n",itmp);
2029 fprintf(stderr,
"ERROR: nmcmc must be positive (or omitted). Exiting...\n");
2033 XLALPrintWarning(
"WARNING: Using %d nmcmc. This is very little and may lead to unreliable results. Consider increasing.\n",itmp);
2040 fprintf(stderr,
"ERROR: trying to separately marginalise in time and phase. Use '--margtimephi' instead");
2045 fprintf(stderr,
"ERROR: cannot marginalise in time and phi and separately time. Pick either '--margtimephi' OR '--margtime'");
2050 fprintf(stderr,
"ERROR: cannot marginalise in time and phi and separately in phi. Pick either '--margtimephi' OR '--margtime'");
2061 XLALPrintWarning(
"WARNING: you have chosen to marginalise in time with a sample rate of %d, but this typically gives incorrect results for CBCs; use at least 4096 Hz to be safe",
srate);
2080 REAL8 a1min=0.0,a1max=1.0;
2081 REAL8 a2min=0.0,a2max=1.0;
2088 UINT4 spinAligned=0;
2136 XLALPrintWarning(
"WARNING: IMRPhenomP only supports spin magnitude up to 0.9. Changing the a1max=a2max=0.9.\n");
2148 XLALPrintWarning(
"WARNING: IMRPhenomPv2 preliminary only supports spin magnitude up to 0.99. Changing the a1max=a2max=0.99.\n");
2182 fprintf(stdout,
"Templates will run without spins\n");
2184 if (spinAligned && singleSpin)
2185 fprintf(stdout,
"Templates will run with spin 1 aligned to L \n");
2186 if (spinAligned && !singleSpin)
2187 fprintf(stdout,
"Templates will run with spins aligned to L \n");
2188 if (!spinAligned && singleSpin)
2189 fprintf(stdout,
"Templates will run with precessing spin 1 \n");
2190 if (!spinAligned && !singleSpin)
2191 fprintf(stdout,
"Templates will run with precessing spins \n");
2204 REAL8 m1_min=1.0,m2_min=1.0;
2205 REAL8 m1_max=100.0,m2_max=100.0;
2206 REAL8 MTotMax=200.0;
2239 MTotMin=m1_min + m2_min;
2240 MTotMax=m1_max + m2_max;
2267 REAL8 a1min,a1max,a2min,a2max;
2282 fprintf(stdout,
"WARNING: IMRPhenomP only supports mass ratios up to 10 ( suggested max: 4). Changing the min prior for q to 1/10\n");
2288 fprintf(stdout,
"WARNING: IMRPhenomP only supports mass ratios up to 10 ( suggested max: 4). Changing the min prior for eta to 0.083\n");
2297 if (
q==1 && min<1./10 && ((a1max==1.0 || a2max==1.0) || (a1min==-1.0 || a2min==-1.0))){
2298 fprintf(stdout,
"WARNING: Based on the allowed prior volume (q < 1/10 for maximal spins), please consult\n");
2299 fprintf(stdout,
"IMRPhenomD review wiki for further discussion on reliable parameter spaces\n");
2300 fprintf(stdout,
"https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/WaveformsReview/IMRPhenomDCodeReview/PhenD_LargeNegativeSpins\n");
2302 if (
q==0 && min<0.082644628 && ((a1max==1.0 || a2max==1.0) || (a1min==-1.0 || a2min==-1.0))){
2303 fprintf(stdout,
"WARNING: Based on the allowed prior volume (q < 1/10 for maximal spins), please consult\n");
2304 fprintf(stdout,
"IMRPhenomD review wiki for further discussion on reliable parameter spaces\n");
2305 fprintf(stdout,
"https://www.lsc-group.phys.uwm.edu/ligovirgo/cbcnote/WaveformsReview/IMRPhenomDCodeReview/PhenD_LargeNegativeSpins\n");
2316 fprintf(stdout,
"WARNING: IMRPhenomPv2 preliminary only supports mass ratios up to 20 ( suggested max: 18). Changing the min prior for q to 1/20\n");
2322 fprintf(stdout,
"WARNING: IMRPhenomPv2 preliminary only supports mass ratios up to 20 ( suggested max: 20). Changing the min prior for eta to 0.045\n");
2341 INT4 generic_fd_correction = 0;
2342 INT4 generic_fd_correction_hm = 0;
2343 REAL8 correction_window = 1.0;
2344 REAL8 correction_ncycles_taper = 1.0;
2347 UINT2 check_grtest_params = 0;
2348 UINT2 check_ppe_params = 0;
2349 UINT2 check_qnmtest_params = 0;
2352 check_grtest_params = 1;
2356 check_ppe_params = 1;
2360 check_qnmtest_params = 1;
2363 if (check_grtest_params + check_ppe_params + check_qnmtest_params >= 2) {
2364 fprintf(stderr,
"--grtest-parameters, --ppe-parameters and --qnmtest-parameters are not simultaneously supported. Please choose one. Aborting\n");
2376 REAL8 dalpha_max=1.;
2377 REAL8 dalpha_min=-1.;
2379 REAL8 dbeta_min=-1.;
2380 REAL8 dsigma_max=1.;
2381 REAL8 dsigma_min=-1.;
2389 LIV_A_sign = atof(pptb->
value);
2390 if ((LIV_A_sign != -1) && (LIV_A_sign != 1)) {
2398 nonGR_alpha = atof(ppta->
value);
2399 if (nonGR_alpha==2.0) {
2400 XLALPrintError(
"nonGR_alpha=2 is degenerate with p^2c^2 term in dispersion relation and cannot be tested. Please choose a different value.\n");
2473 XLALPrintError(
"A value for nonGR_alpha has to be passed with lambda_eff.\n");
2476 else if (pptb==NULL) {
2477 XLALPrintError(
"A value of +1 or -1 for LIV_A_sign has to be passed with lambda_eff, respectively determing if +A or -A in the MDR is being tested.\n");
2481 REAL8 lambda_eff_min = 1E-6;
2482 REAL8 lambda_eff_max = 1E13;
2488 XLALPrintError(
"A value for nonGR_alpha has to be passed with log10lambda_eff. A value for LIV_A_sign also has to be passed!\n");
2491 else if (pptb==NULL) {
2492 XLALPrintError(
"A value of +1 or -1 for LIV_A_sign has to be passed with log10lambda_eff, respectively determing if +A or -A in the MDR is being tested.\n");
2496 REAL8 log10lambda_eff_min = -6.0;
2497 REAL8 log10lambda_eff_max = 13.0;
2506 generic_fd_correction = 1;
2511 generic_fd_correction_hm = 1;
2518 if (
ppt) correction_ncycles_taper = atof(
ppt->
value);
2526 REAL8 appe_min = -5.0,appe_max=5.0;
2527 REAL8 alphappe_min = -1000.0,alphappe_max=1000.0;
2528 REAL8 bppe_min = -5.0,bppe_max=5.0;
2529 REAL8 betappe_min = -1000.0,betappe_max=1000.0;
2530 char aPPEparam[64]=
"";
2531 char alphaPPEparam[64]=
"";
2533 char bPPEparam[64]=
"";
2534 char betaPPEparam[64]=
"";
2535 int counters[4]={0};
2538 sprintf(aPPEparam,
"%s%d",
"aPPE",++counters[0]);
2540 sprintf(alphaPPEparam,
"%s%d",
"alphaPPE",++counters[1]);
2542 sprintf(bPPEparam,
"%s%d",
"bPPE",++counters[2]);
2544 sprintf(betaPPEparam,
"%s%d",
"betaPPE",++counters[3]);
2548 if ((counters[0]!=counters[1])||(counters[2]!=counters[3])) {
fprintf(stderr,
"Unequal number of PPE parameters detected! Check your command line!\n"); exit(-1);}
2553 REAL8 domega_max=1.;
2554 REAL8 domega_min=-1.;
LALDict * XLALCreateDict(void)
const char * LALInferenceAnalyticNamesCBC[]
const REAL8 LALInferenceAnalyticMeansCBC[]
LALInferenceModel * LALInferenceInitCBCModel(LALInferenceRunState *state)
Initialise state variables needed for LALInferenceNest or LALInferenceMCMC to run on a CBC signal.
void LALInferenceCheckOptionsConsistency(ProcessParamsTable *commandLine)
Check options consistency.
void LALInferenceRegisterUniformVariableREAL8(LALInferenceRunState *state, LALInferenceVariables *var, const char *name, REAL8 startval, REAL8 min, REAL8 max, LALInferenceParamVaryType varytype)
Register a variable in vars for the model with given name, and a uniform prior.
LALInferenceTemplateFunction LALInferenceInitCBCTemplate(LALInferenceRunState *runState)
Initialise the template for a standard CBC signal.
static void LALInferenceInitSpinVariables(LALInferenceRunState *state, LALInferenceModel *model)
LALInferenceModel * LALInferenceInitModelReviewEvidence_banana(LALInferenceRunState *state)
static int checkParamInList(const char *list, const char *param)
LALInferenceRunState * LALInferenceInitRunState(ProcessParamsTable *command_line)
static void print_flags_orders_warning(SimInspiralTable *injt, ProcessParamsTable *commline)
static void LALInferenceInitMassVariables(LALInferenceRunState *state)
void LALInferenceInitCBCThreads(LALInferenceRunState *run_state, INT4 nthreads)
static void LALInferenceCheckApproximantNeeds(LALInferenceRunState *state, Approximant approx)
void LALInferenceDrawThreads(LALInferenceRunState *run_state)
LALInferenceModel * LALInferenceInitModelReviewEvidence(LALInferenceRunState *state)
Review functions.
void LALInferenceInitGlitchVariables(LALInferenceRunState *runState, LALInferenceVariables *currentParams)
Initialise the glitch fitting parameters.
void LALInferenceRegisterGaussianVariableREAL8(LALInferenceRunState *state, LALInferenceVariables *var, const char *name, REAL8 startval, REAL8 mean, REAL8 stdev, LALInferenceParamVaryType varytype)
void LALInferenceInitCalibrationVariables(LALInferenceRunState *runState, LALInferenceVariables *currentParams)
static int destroyCalibrationEnvelope(struct spcal_envelope *env)
static void LALInferenceInitNonGRParams(LALInferenceRunState *state, LALInferenceModel *model)
static struct spcal_envelope * initCalibrationEnvelope(char *filename)
LALInferenceModel * LALInferenceInitModelReviewEvidence_bimod(LALInferenceRunState *state)
static REAL8 mean(REAL8 *array, int N)
LALInferenceVariables currentParams
int XLALGetOrderFromString(const char *waveform)
int XLALGetApproximantFromString(const char *waveform)
int XLALSimInspiralImplementedFDApproximants(Approximant approximant)
const char * XLALSimInspiralGetStringFromApproximant(Approximant approximant)
int XLALSimInspiralImplementedTDApproximants(Approximant approximant)
int XLALSimInspiralGetSpinSupportFromApproximant(Approximant approx)
struct tagLALSimNeutronStarEOS LALSimNeutronStarEOS
void XLALDestroyValue(LALValue *value)
SimInspiralTable * XLALSimInspiralTableFromLIGOLw(const char *fileName)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
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.
LALInferenceThreadState * LALInferenceInitThreads(INT4 nthreads)
REAL8 LALInferenceGetREAL8Variable(LALInferenceVariables *vars, const char *name)
void LALInferenceRemoveVariable(LALInferenceVariables *vars, const char *name)
Remove name from vars Frees the memory for the name structure and its contents.
LALInferenceParamVaryType
An enumerated type for denoting the topology of a parameter.
void LALInferenceCopyVariables(LALInferenceVariables *origin, LALInferenceVariables *target)
Deep copy the variables from one to another LALInferenceVariables structure.
void * LALInferenceGetVariable(const LALInferenceVariables *vars, const char *name)
Return a pointer to the memory the variable vars is stored in specified by name User must cast this p...
void LALInferenceAddREAL8Variable(LALInferenceVariables *vars, const char *name, REAL8 value, LALInferenceParamVaryType vary)
ProcessParamsTable * LALInferenceGetProcParamVal(ProcessParamsTable *procparams, const char *name)
Returns the element of the process params table with "name".
void LALInferenceAddINT4Variable(LALInferenceVariables *vars, const char *name, INT4 value, LALInferenceParamVaryType vary)
LALInferenceVariableItem * LALInferenceGetItem(const LALInferenceVariables *vars, const char *name)
Return the list node for "name" - do not rely on this.
void(* LALInferenceTemplateFunction)(struct tagLALInferenceModel *model)
Type declaration for template function, which operates on a LALInferenceIFOData structure *data.
void LALInferenceParseCharacterOptionString(char *input, char **strings[], UINT4 *n)
parses a character string (passed as one of the options) and decomposes it into individual parameter ...
void LALInferenceClearVariables(LALInferenceVariables *vars)
Delete the variables in this structure.
int LALInferenceCheckVariable(LALInferenceVariables *vars, const char *name)
Checks for name being present in vars returns 1(==true) or 0.
void LALInferenceCopyUnsetREAL8Variables(LALInferenceVariables *origin, LALInferenceVariables *target, ProcessParamsTable *commandLine)
int LALInferenceCheckVariableNonFixed(LALInferenceVariables *vars, const char *name)
Checks for name being present in vars and having type LINEAR or CIRCULAR.
@ LALINFERENCE_PARAM_OUTPUT
A parameter that never changes, functions should respect this.
@ LALINFERENCE_PARAM_FIXED
A parameter that is cyclic, such as an angle between 0 and 2pi.
@ LALINFERENCE_PARAM_CIRCULAR
A parameter that simply has a maximum and a minimum.
@ LALINFERENCE_PARAM_LINEAR
@ LALINFERENCE_REAL8Vector_t
@ LALINFERENCE_UINT4Vector_t
@ LALINFERENCE_gslMatrix_t
void LALInferenceAddGaussianPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 *mu, REAL8 *sigma, LALInferenceVariableType type)
Function to add the mu and sigma values for the Gaussian prior onto the priorArgs.
int LALInferenceCheckMinMaxPrior(LALInferenceVariables *priorArgs, const char *name)
Check for types of standard prior.
void LALInferenceAddMinMaxPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 *min, REAL8 *max, LALInferenceVariableType type)
Function to add the minimum and maximum values for the uniform prior onto the priorArgs.
void LALInferenceRemoveMinMaxPrior(LALInferenceVariables *priorArgs, const char *name)
Function to remove the minimum and maximum values for the uniform prior onto the priorArgs.
void LALInferenceCyclicReflectiveBound(LALInferenceVariables *parameter, LALInferenceVariables *priorArgs)
Apply cyclic and reflective boundaries to parameter to bring it back within the allowed prior ranges ...
void LALInferenceGetMinMaxPrior(LALInferenceVariables *priorArgs, const char *name, REAL8 *min, REAL8 *max)
Get the minimum and maximum values of the uniform prior from the priorArgs list, given a name.
REAL8 LALInferenceDrawApproxPrior(LALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Draws from an approximation to the true prior.
void LALInferenceInjectionToVariables(SimInspiralTable *theEventTable, LALInferenceVariables *vars)
Fill the variables passed in vars with the parameters of the injection passed in event will over-writ...
void LALInferenceSetupROQmodel(LALInferenceModel *model, ProcessParamsTable *commandLine)
LALInferenceIFOData * LALInferenceReadData(ProcessParamsTable *commandLine)
Read IFO data according to command line arguments.
void LALInferenceROQWrapperForXLALSimInspiralChooseFDWaveformSequence(LALInferenceModel *model)
void LALInferenceTemplateNullFreqdomain(LALInferenceModel *model)
Returns a frequency-domain 'null' template (all zeroes, implying no signal present).
void LALInferenceTemplateXLALSimInspiralChooseWaveformPhaseInterpolated(LALInferenceModel *model)
void LALInferenceTemplateXLALSimInspiralChooseWaveform(LALInferenceModel *model)
"XLALSimInspiralChooseWaveform{TD,FD}" wrapper.
void * XLALMalloc(size_t n)
void * XLALCalloc(size_t m, size_t n)
#define LAL_SIM_INSPIRAL_FRAME_AXIS_DEFAULT
LAL_SIM_INSPIRAL_SINGLESPIN
LAL_SIM_INSPIRAL_SPINLESS
LAL_SIM_INSPIRAL_ALIGNEDSPIN
LAL_SIM_INSPIRAL_SPIN_ORDER_ALL
LAL_SIM_INSPIRAL_TIDAL_ORDER_ALL
LALSimNeutronStarEOS * XLALSimNeutronStarEOSByName(const char *name)
LALSimNeutronStarFamily * XLALCreateSimNeutronStarFamily(LALSimNeutronStarEOS *eos)
REAL8TimeSeries * XLALCreateREAL8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
const LALUnit lalDimensionlessUnit
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
UINT4Vector * XLALCreateUINT4Vector(UINT4 length)
#define XLAL_ERROR_VOID(...)
const char * XLALErrorString(int errnum)
#define XLAL_ERROR_NULL(...)
#define XLAL_CHECK_ABORT(assertion)
#define XLAL_TRY(statement, errnum)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
Structure to contain IFO data.
REAL8TimeSeries * timeData
Detector name.
struct tagLALInferenceIFOData * next
ROQ data.
REAL8 fLow
FFT plan needed for time/time-and-phase marginalisation.
Structure to constain a model and its parameters.
REAL8 * ifo_loglikelihoods
Network SNR at params
REAL8 * ifo_SNRs
Array of single-IFO likelihoods at params
REAL8FFTPlan * timeToFreqFFTPlan
Burst Waveform cache for LIB.
COMPLEX16FrequencySeries * freqhPlus
Time series model buffers.
LALSimNeutronStarFamily * eos_fam
Is ROQ enabled.
REAL8 fHigh
Start frequency for waveform generation.
REAL8TimeSeries * timehCross
LALSimInspiralWaveformCache * waveformCache
REAL8TimeSeries * timehPlus
LALInferenceVariables * params
COMPLEX16FrequencySeries ** freqhs
Freq series model buffers.
REAL8 deltaT
End frequency for waveform generation.
COMPLEX16FrequencySeries * freqhCross
LALDict * LALpars
Projected freq series model buffers.
REAL8FFTPlan * freqToTimeFFTPlan
REAL8Window * window
Pre-calculated FFT plans for forward and reverse FFTs.
REAL8 fLow
Array of single-IFO SNRs at params
LALInferenceTemplateFunction templt
Domain of model.
LALSimulationDomain domain
IFO-dependent parameters and buffers.
Structure containing inference run state This includes pointers to the function types required to run...
ProcessParamsTable * commandLine
LALInferenceVariables * proposalArgs
The data from the interferometers.
INT4 nthreads
Array of live points for Nested Sampling.
struct tagLALInferenceIFOData * data
Log sample, i.e.
LALInferenceVariables * priorArgs
Common arguments needed by proposals, to be copied to thread->cycle.
LALInferenceThreadState * threads
LALInferencePriorFunction prior
The algorithm's single iteration function.
LALInferenceLikelihoodFunction likelihood
MultiNest prior for the parameters.
Structure containing chain-specific variables.
REAL8 currentPrior
This should be removed, can be given as an algorithmParams or proposalParams entry.
LALInferenceVariables * currentParams
Prior boundaries, etc.
struct tagLALInferenceRunState * parent
LALInferenceVariables * priorArgs
Stope things such as output arrays.
LALInferenceModel * model
Cycle of proposals to call.
REAL8 * currentIFOLikelihoods
Array storing single-IFO SNRs of current sample.
LALInferenceVariables * proposalArgs
The LALInferenceVariableItem list node structure This should only be accessed using the accessor func...
LALInferenceVariableType type
LALInferenceParamVaryType vary
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...
CHAR value[LIGOMETA_VALUE_MAX]
LIGOTimeGPS geocent_end_time
struct tagSimInspiralTable * next
CHAR waveform[LIGOMETA_WAVEFORM_MAX]
gsl_spline * phase_median