26#include <lal/GenerateInspiral.h>
27#include <lal/LALInference.h>
28#include <lal/FrequencySeries.h>
30#include <lal/StringInput.h>
31#include <lal/TimeSeries.h>
32#include <lal/LALInferenceNestedSampler.h>
33#include <lal/LALInferencePrior.h>
34#include <lal/LALInferenceReadData.h>
35#include <lal/LALInferenceLikelihood.h>
36#include <lal/LALInferenceTemplate.h>
37#include <lal/LALInferenceProposal.h>
38#include <lal/LALInferenceInit.h>
39#include <lal/LALInferenceCalibrationErrors.h>
40#include <lal/LALInferenceVCSInfo.h>
45int main(
int argc,
char *argv[]){
49 Bayesian analysis tool using Nested Sampling algorithm\n\
50 for CBC analysis. Uses LALInference library for back-end.\n\n\
51 Arguments for each section follow:\n\n";
65 fprintf(stdout,
"\n\nLALInference version:%s,%s,%s,%s,%s\n\n",
lalInferenceVCSInfo.
vcsId,
lalInferenceVCSInfo.
vcsDate,
lalInferenceVCSInfo.
vcsBranch,
lalInferenceVCSInfo.
vcsAuthor,
lalInferenceVCSInfo.
vcsStatus);
73 if (state!=NULL && !helpflag){
79 fprintf(stderr,
"Must specify --outfile <filename.dat> or --outhdf <filename.h5>\n");
84 char headerfile[FILENAME_MAX+100];
86 snprintf(headerfile,
sizeof(headerfile),
"%s_header.txt",
outfile);
87 fpout=fopen(headerfile,
"w");
88 fprintf(fpout,
"LALInference version:%s,%s,%s,%s,%s\n",
lalInferenceVCSInfo.
vcsId,
lalInferenceVCSInfo.
vcsDate,
lalInferenceVCSInfo.
vcsBranch,
lalInferenceVCSInfo.
vcsAuthor,
lalInferenceVCSInfo.
vcsStatus);
94 fprintf(stderr,
"run state not allocated (%s, line %d).\n",
102 if (state&&!helpflag){
122 fprintf(stderr,
"done LALInferenceSetupROQdata\n");
ProcessParamsTable * LALInferenceParseCommandLine(int argc, char *argv[])
void LALInferenceApplyCalibrationErrors(LALInferenceIFOData *IFOdata, ProcessParamsTable *commandLine)
LALInferenceRunState * LALInferenceInitRunState(ProcessParamsTable *command_line)
void LALInferenceInitCBCThreads(LALInferenceRunState *run_state, INT4 nthreads)
int main(int argc, char *argv[])
void LALInferenceInjectInspiralSignal(LALInferenceIFOData *IFOdata, ProcessParamsTable *commandLine)
const LALVCSInfo lalInferenceVCSInfo
VCS and build information for LALInference.
char * LALInferencePrintCommandLine(ProcessParamsTable *procparams)
Output the command line based on the ProcessParamsTable procparams.
ProcessParamsTable * LALInferenceGetProcParamVal(ProcessParamsTable *procparams, const char *name)
Returns the element of the process params table with "name".
void LALInferenceInitLikelihood(LALInferenceRunState *runState)
Initialisation function which reads runState->commaneLine and sets up the likelihood function accordi...
void LALInferenceNestedSamplingAlgorithm(LALInferenceRunState *runState)
NestedSamplingAlgorithm implements the nested sampling algorithm, see e.g.
INT4 LALInferenceNestedSamplingOneStep(LALInferenceRunState *runState)
A single iteration of the NS algorithm.
void LALInferenceSetupLivePointsArray(LALInferenceRunState *runState)
Setup the live points by calling runState->initVariables on each of them if it is specified.
void LALInferenceNestedSamplingAlgorithmInit(LALInferenceRunState *runState)
Initialise the nested sampling algorithm by reading from the commandLine and setting up algorithmPara...
void LALInferenceInitCBCPrior(LALInferenceRunState *runState)
Initialize the prior based on command line arguments.
LALInferenceProposalCycle * LALInferenceSetupDefaultInspiralProposalCycle(LALInferenceVariables *propArgs)
A reasonable default proposal.
LALInferenceVariables * LALInferenceParseProposalArgs(LALInferenceRunState *runState)
Go through all logic for deciding proposals to use.
void LALInferenceRandomizeProposalCycle(LALInferenceProposalCycle *cycle, gsl_rng *rng)
Randomizes the order of the proposals in the proposal cycle.
void LALInferenceSetupROQdata(LALInferenceIFOData *IFOdata, ProcessParamsTable *commandLine)
LALInferenceVariables * LALInferencePrintInjectionSample(LALInferenceRunState *runState)
Function to output a sample with logL values etc for the injection, if one is made.
Structure to contain IFO data.
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.
LALInferenceThreadState * threads
LALInferenceAlgorithm algorithm
A function that returns a new set of variables for the model.
LALInferenceEvolveOneStepFunction evolve
The algorithm function.
LALInferenceProposalCycle * cycle
The proposal cycle.
LALInferenceVariables * proposalArgs
const char *const vcsDate
const char *const vcsStatus
const char *const vcsAuthor
const char *const vcsBranch
CHAR value[LIGOMETA_VALUE_MAX]