25 #ifndef LALInference_h
26 #define LALInference_h
47 #include <gsl/gsl_errno.h>
48 #include <gsl/gsl_spline.h>
50 #define VARNAME_MAX 40
51 #define VARVALSTRINGSIZE_MAX 128
53 #include <lal/LALStdlib.h>
54 #include <lal/LALConstants.h>
55 #include <lal/SimulateCoherentGW.h>
56 #include <lal/GeneratePPNInspiral.h>
57 #include <lal/LIGOMetadataTables.h>
58 #include <lal/LALDatatypes.h>
59 #include <lal/FindChirp.h>
60 #include <lal/Window.h>
61 #include <lal/LALString.h>
62 #include <lal/StringInput.h>
63 #include <lal/StringVector.h>
64 #include <lal/LALSimInspiral.h>
65 #include <lal/LALSimInspiralWaveformCache.h>
66 #include <lal/LALSimNeutronStar.h>
67 #include <lal/LALHashTbl.h>
68 #include <lal/RealFFT.h>
69 #include <lal/LALDetectors.h>
71 #include <gsl/gsl_linalg.h>
72 #include <gsl/gsl_errno.h>
73 #include <gsl/gsl_math.h>
74 #include <gsl/gsl_min.h>
75 #include <gsl/gsl_vector.h>
76 #include <gsl/gsl_matrix.h>
77 #include <gsl/gsl_blas.h>
78 #include <gsl/gsl_linalg.h>
79 #include <gsl/gsl_eigen.h>
80 #include <gsl/gsl_rng.h>
81 #include <gsl/gsl_randist.h>
82 #include <gsl/gsl_statistics.h>
83 #include <gsl/gsl_complex_math.h>
84 #include <gsl/gsl_cdf.h>
89 #include <lal/LALInferenceBurstRoutines.h>
93 struct tagLALInferenceRunState;
94 struct tagLALInferenceThreadState;
95 struct tagLALInferenceIFOData;
96 struct tagLALInferenceModel;
104 typedef enum tagLALInferenceVariableType {
127 typedef enum tagLALInferenceParamVaryType {
169 tagLALInferenceVariables
180 typedef enum tagLALInferenceMCMCRunPhase {
416 tagLALInferenceIFOModel
429 struct tagLALInferenceIFOModel *
next;
435 typedef struct tagLALInferenceModel
463 struct tagLALInferenceROQModel *
roq;
475 typedef LALInferenceModel* (*LALInferenceInitModelFunction) (
struct tagLALInferenceRunState *runState);
511 tagLALInferenceProposal
525 tagLALInferenceProposalCycle
540 tagLALInferenceThreadState
591 tagLALInferenceRunState
601 struct tagLALInferenceIFOData *
data;
624 tagLALInferenceIFOData
657 struct tagLALInferenceROQData *
roq;
659 struct tagLALInferenceIFOData *
next;
663 tagLALInferenceROQData
690 tagLALInferenceROQSplineWeightsLinear
704 tagLALInferenceROQModel
915 typedef struct tagLALInferenceKDTree {
933 struct tagLALInferenceKDTree *
left;
936 struct tagLALInferenceKDTree *
right;
1013 REAL8 *proposed,
size_t Npts);
1170 SWIGLAL(OWNS_THIS_ARG(
const CHAR*, value));
1180 SWIGLAL_CLEAR(OWNS_THIS_ARG(
const CHAR*, value));
LALInferenceVariables currentParams
struct tagLALSimNeutronStarFamily LALSimNeutronStarFamily
void LALInferenceMcQ2Masses(double mc, double q, double *m1, double *m2)
Convert from Mc, q space to m1, m2 space (q = m2/m1, with m1 > m2).
REAL8 LALInferenceAngularDistance(REAL8 a1, REAL8 a2)
Calculate shortest angular distance between a1 and a2 (modulo 2PI)
INT4 LALInferenceBufferToArray(LALInferenceThreadState *thread, REAL8 **DEarray)
LALInferenceThreadState * LALInferenceInitThreads(INT4 nthreads)
int LALInferenceKDAddPoint(LALInferenceKDTree *tree, REAL8 *pt)
Adds a point to the kD-tree, returns 0 on successful exit.
INT4 LALInferenceThinnedBufferToArray(LALInferenceThreadState *thread, REAL8 **DEarray, INT4 step)
LALInferenceVariable buffer to array and vica versa.
void LALInferencePrintSampleNonFixed(FILE *fp, LALInferenceVariables *sample)
Output only non-fixed parameters.
void LALInferenceReadAsciiHeader(FILE *input, char params[][VARNAME_MAX], INT4 *nCols)
Read column names from an ASCII file.
void LALInferenceAddINT8Variable(LALInferenceVariables *vars, const char *name, INT8 value, LALInferenceParamVaryType vary)
int LALInferenceReadVariablesArrayBinary(FILE *file, LALInferenceVariables **vars, UINT4 N)
Read N LALInferenceVariables from the binary FILE *file, previously written with LALInferenceWriteVar...
INT4 LALInferenceGetVariableDimensionNonFixedChooseVectors(LALInferenceVariables *vars, INT4 count_vectors)
Get number of dimensions in vars which are not fixed to a certain value, with a flag for skipping cou...
REAL8 * LALInferenceParseDelimitedAscii(FILE *input, INT4 nCols, INT4 *wantedCols, INT4 *nLines)
Utility for readling in delimited ASCII files.
void LALInferenceSetstringVariable(LALInferenceVariables *vars, const char *name, const CHAR *value)
void(* LALInferenceAlgorithm)(struct tagLALInferenceRunState *runState)
Type declaration for an algorithm function which is called by the driver code The user must initialis...
void LALInferencedQuadMonSdQuadMonA(REAL8 dQuadMonS, REAL8 dQuadMonA, REAL8 *dQuadMon1, REAL8 *dQuadMon2)
Convert from dQuadMonS, dQuadMonA to dQuadMon1, dQuadMon2.
LALInferenceMCMCRunPhase * LALInferenceGetMCMCrunphase_ptrVariable(LALInferenceVariables *vars, const char *name)
LALInferenceVariableType LALInferenceGetVariableType(const LALInferenceVariables *vars, const char *name)
Get the LALInferenceVariableType of the parameter named name in vars.
void LALInferenceDiscardPTMCMCHeader(FILE *filestream)
Discard the standard header of a PTMCMC chain file.
REAL8(* LALInferencePriorFunction)(struct tagLALInferenceRunState *runState, LALInferenceVariables *params, struct tagLALInferenceModel *model)
Type declaration for prior function which returns p(params) Can depend on runState ->priorArgs.
void LALInferenceQ2Eta(double q, double *eta)
Convert from q to eta (q = m2/m1, with m1 > m2).
void(* LALInferenceLogFunction)(LALInferenceVariables *algorithmParams, LALInferenceVariables *vars)
Type declaration for output logging function, can be user-declared.
UINT4(* LALInferenceCubeToPriorFunction)(struct tagLALInferenceRunState *runState, LALInferenceVariables *params, struct tagLALInferenceModel *model, double *cube, void *context)
Type declaration for CubeToPrior function which converts parameters in unit hypercube to their corres...
INT4 LALInferenceFprintParameterNonFixedHeaders(FILE *out, LALInferenceVariables *params)
Print the parameters which do not vary to a file as a tab-separated ASCII line.
UINT4 LALInferenceGetUINT4Variable(LALInferenceVariables *vars, const char *name)
void LALInferencePrintSample(FILE *fp, LALInferenceVariables *sample)
Output the sample to file *fp, in ASCII format.
INT4 LALInferenceGetVariableDimensionNonFixed(LALInferenceVariables *vars)
Get number of dimensions in vars which are not fixed to a certain value.
char ** LALInferenceGetHeaderLine(FILE *inp)
Returns an array of header strings (terminated by NULL) from a common-format output file.
gsl_matrix * LALInferenceGetgslMatrixVariable(LALInferenceVariables *vars, const char *name)
int LALInferenceFprintParameterHeaders(FILE *out, LALInferenceVariables *params)
Print the parameter names to a file as a tab-separated ASCII line.
double AdiabaticIndex(double gamma[], double x, int size)
Specral decomposition of eos's adiabatic index.
REAL8Vector * LALInferenceGetREAL8VectorVariable(LALInferenceVariables *vars, const char *name)
int LALInferenceSplineCalibrationFactorROQ(REAL8Vector *logfreqs, REAL8Vector *deltaAmps, REAL8Vector *deltaPhases, REAL8Sequence *freqNodesLin, COMPLEX16Sequence **calFactorROQLin, REAL8Sequence *freqNodesQuad, COMPLEX16Sequence **calFactorROQQuad)
Modified version of LALInferenceSplineCalibrationFactor to compute the calibration factors for the sp...
void LALInferenceAddREAL8VectorVariable(LALInferenceVariables *vars, const char *name, REAL8Vector *value, LALInferenceParamVaryType vary)
void LALInferencePrintSplineCalibration(FILE *fp, LALInferenceThreadState *thread)
Output spline calibration parameters.
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.
REAL4 LALInferenceGetREAL4Variable(LALInferenceVariables *vars, const char *name)
double LALInferenceKDLogCellVolume(LALInferenceKDTree *cell)
Returns the log of the volume of the given cell, which is part of the given tree.
int LALInferenceWriteVariablesArrayBinary(FILE *file, LALInferenceVariables **vars, UINT4 N)
Write an array N of LALInferenceVariables to the given FILE * using LALInferenceWriteVariablesBinary(...
void LALInferenceKDVariablesToREAL8(LALInferenceVariables *params, REAL8 *pt, LALInferenceVariables *templt)
Fills in the given REAL8 array with the parameter values from params; the ordering of the variables i...
LALInferenceThreadState * LALInferenceInitThread(LALInferenceThreadState *thread)
Structure to contain data-related Reduced Order Quadrature quantities.
void LALInferenceAddINT4VectorVariable(LALInferenceVariables *vars, const char *name, INT4Vector *value, LALInferenceParamVaryType vary)
int LALInferenceWriteRunStateBinary(FILE *file, LALInferenceRunState *state)
Write the LALInferenceVariables contents of runState to a file in binary format.
void LALInferenceLogSampleToFile(LALInferenceVariables *algorithmParams, LALInferenceVariables *vars)
Append the sample to a file.
UINT4 LALInferencePrintNVariableItem(char *out, UINT4 N, const LALInferenceVariableItem *const ptr)
Prints a variable item to a string.
void LALInferenceLogp1GammasMasses2Lambdas(REAL8 logp1, REAL8 gamma1, REAL8 gamma2, REAL8 gamma3, REAL8 mass1, REAL8 mass2, REAL8 *lambda1, REAL8 *lambda2)
Calculate lambda1,2(m1,2|eos(logp1,gamma1,gamma2,gamma3))
REAL8 LALInferenceGetREAL8Variable(LALInferenceVariables *vars, const char *name)
void LALInferenceEquatorialToDetFrame(LALDetector *det0, LALDetector *det1, REAL8 tg, REAL8 ra, REAL8 dec, REAL8 *t0, REAL8 *alpha, REAL8 *theta)
REAL8 LALInferenceKDLogProposalRatio(LALInferenceKDTree *tree, REAL8 *current, REAL8 *proposed, size_t Npts)
Returns the log of the jump proposal probability ratio for the LALInferenceKDDrawEigenFrame() proposa...
REAL8 ** LALInferenceSelectColsFromArray(REAL8 **inarray, INT4 nRows, INT4 nCols, INT4 nSelCols, INT4 *selCols)
Utility for selecting columns from an array, in the specified order.
COMPLEX8 LALInferenceGetCOMPLEX8Variable(LALInferenceVariables *vars, const char *name)
void LALInferenceSetREAL8Variable(LALInferenceVariables *vars, const char *name, REAL8 value)
void LALInferenceExecuteFT(LALInferenceModel *model)
Execute FFT for data in IFOdata.
size_t LALInferenceTypeSize[15]
double LALInferenceKDLogCellEigenVolume(LALInferenceKDTree *cell)
Returns the log of the volume of the box aligned with the principal axes of the points in the given c...
int LALInferenceCompareVariables(LALInferenceVariables *var1, LALInferenceVariables *var2)
Check for equality in two variables.
int LALInferenceEOSPhysicalCheck(LALInferenceVariables *params, ProcessParamsTable *commandLine)
Check for causality violation and mass conflict given masses and eos.
char * LALInferenceGetVariableName(LALInferenceVariables *vars, int idx)
Get the name of the idx-th variable Indexing starts at 1.
void LALInferenceRemoveVariable(LALInferenceVariables *vars, const char *name)
Remove name from vars Frees the memory for the name structure and its contents.
LALInferenceKDTree * LALInferenceKDFindCell(LALInferenceKDTree *tree, REAL8 *pt, size_t Npts)
Returns the first cell that contains the given point that also contains fewer than Npts points,...
void LALInferenceAddstringVariable(LALInferenceVariables *vars, const char *name, const CHAR *value, LALInferenceParamVaryType vary)
void(* LALInferenceSwapRoutine)(struct tagLALInferenceRunState *runState, FILE *)
Propose a swap between chain locations.
void LALInferenceLambdaTsEta2Lambdas(REAL8 lambdaT, REAL8 dLambdaT, REAL8 eta, REAL8 *lambda1, REAL8 *lambda2)
Convert from lambdaT, dLambdaT, and eta to lambda1 and lambda2.
INT4 LALInferenceGetVariableTypeByIndex(LALInferenceVariables *vars, int idx)
Get the LALInferenceVariableType of the idx -th item in the vars Indexing starts at 1.
int LALInferenceSDGammaCheck(double gamma[], int size)
Determine if the Adiabatic index is within 'prior' range.
LALInferenceParamVaryType
An enumerated type for denoting the topology of a parameter.
void LALInferenceReadSampleNonFixed(FILE *fp, LALInferenceVariables *sample)
Read in the non-fixed parameters from the given file (position in the file must be arranged properly ...
void LALInferenceSetCOMPLEX16Variable(LALInferenceVariables *vars, const char *name, COMPLEX16 value)
void LALInferenceSetUINT4VectorVariable(LALInferenceVariables *vars, const char *name, UINT4Vector *value)
void LALInferenceAddCOMPLEX16VectorVariable(LALInferenceVariables *vars, const char *name, COMPLEX16Vector *value, LALInferenceParamVaryType vary)
void LALInferenceDumpWaveforms(LALInferenceModel *model, const char *basefilename)
Dump all waveforms from the ifodata structure.
void LALInferenceSetCOMPLEX16VectorVariable(LALInferenceVariables *vars, const char *name, COMPLEX16Vector *value)
void LALInferenceCopyVariables(LALInferenceVariables *origin, LALInferenceVariables *target)
Deep copy the variables from one to another LALInferenceVariables structure.
void LALInferenceBurninStream(FILE *filestream, INT4 burnin)
Burn-in a generic ASCII stream.
void LALInferenceAddREAL8Variable(LALInferenceVariables *vars, const char *name, REAL8 value, LALInferenceParamVaryType vary)
INT4 LALInferenceGetINT4Variable(LALInferenceVariables *vars, const char *name)
ProcessParamsTable * LALInferenceParseStringVector(LALStringVector *arglist)
Return a ProcessParamsTrable from a string vector.
void LALInferenceAddUINT4Variable(LALInferenceVariables *vars, const char *name, UINT4 value, LALInferenceParamVaryType vary)
REAL8 LALInferenceAngularVariance(LALInferenceVariables **list, const char *pname, int N)
Calculate the variance of a distribution on an angle (modulo 2PI)
int LALInferencePrintProposalStatsHeader(FILE *fp, LALInferenceProposalCycle *cycle)
Output proposal statistics header to file *fp.
void LALInferenceKDDrawEigenFrame(gsl_rng *rng, LALInferenceKDTree *tree, REAL8 *pt, size_t Npts)
Draws a pt uniformly from a randomly chosen cell of tree.
void LALInferencePrintProposalStats(FILE *fp, LALInferenceProposalCycle *cycle)
Output proposal statistics to file *fp.
void LALInferenceProcessParamLine(FILE *inp, char **headers, LALInferenceVariables *vars)
Reads one line from the given file and stores the values there into the variable structure,...
COMPLEX16Vector * LALInferenceGetCOMPLEX16VectorVariable(LALInferenceVariables *vars, const char *name)
void LALInferenceAddCOMPLEX16Variable(LALInferenceVariables *vars, const char *name, COMPLEX16 value, LALInferenceParamVaryType vary)
void LALInferenceAddINT4Variable(LALInferenceVariables *vars, const char *name, INT4 value, LALInferenceParamVaryType vary)
LALInferenceKDTree * LALInferenceKDEmpty(REAL8 *lowerLeft, REAL8 *upperRight, size_t ndim)
Constructs a fresh, empty kD tree.
INT4Vector * LALInferenceGetINT4VectorVariable(LALInferenceVariables *vars, const char *name)
void LALInferenceFprintSplineCalibrationHeader(FILE *output, LALInferenceThreadState *thread)
Print spline calibration parameter names as tab-separated ASCII.
LALInferenceMCMCRunPhase
Phase of MCMC run (depending on burn-in status, different actions are performed during the run,...
ProcessParamsTable * LALInferenceParseCommandLineStringVector(LALStringVector *args)
Return a ProcessParamsTable from the command line arguments (SWIG version)
void LALInferenceCopyArrayToVariables(REAL8 *origin, LALInferenceVariables *target)
void LALInferenceKDTreeDelete(LALInferenceKDTree *tree)
Delete a kD-tree.
void LALInferenceSetParamVaryType(LALInferenceVariables *vars, const char *name, LALInferenceParamVaryType vary)
Set the LALInferenceParamVaryType of the parameter named name in vars, see the declaration of LALInfe...
UINT4Vector * LALInferenceGetUINT4VectorVariable(LALInferenceVariables *vars, const char *name)
void LALInferenceSetUINT4Variable(LALInferenceVariables *vars, const char *name, UINT4 value)
void LALInferenceBurninPTMCMC(FILE *filestream, INT4 logl_idx, INT4 nPar)
Determine burnin cycle from delta-logl criteria.
INT4 LALInferenceGetVariableDimension(LALInferenceVariables *vars)
Get number of dimensions in variable vars.
void LALInferenceAddMCMCrunphase_ptrVariable(LALInferenceVariables *vars, const char *name, LALInferenceMCMCRunPhase *value, LALInferenceParamVaryType vary)
void LALInferenceSetINT4Variable(LALInferenceVariables *vars, const char *name, INT4 value)
void(* LALInferenceTemplateFunction)(struct tagLALInferenceModel *model)
Type declaration for template function, which operates on a LALInferenceIFOData structure *data.
int LALInferenceCheckVariableToPrint(LALInferenceVariables *vars, const char *name)
LALInferenceModel *(* LALInferenceInitModelFunction)(struct tagLALInferenceRunState *runState)
Type declaration for variables init function, can be user-declared.
REAL8(* LALInferenceProposalFunction)(struct tagLALInferenceThreadState *thread, LALInferenceVariables *currentParams, LALInferenceVariables *proposedParams)
Jump proposal distribution Computes proposedParams based on currentParams and additional variables st...
UINT4 LALInferenceCheckPositiveDefinite(gsl_matrix *matrix, UINT4 dim)
Check matrix is positive definite.
void LALInferenceSDGammasMasses2Lambdas(REAL8 gamma[], REAL8 mass1, REAL8 mass2, REAL8 *lambda1, REAL8 *lambda2, int size)
Convert from spectral parameters to lambda1, lambda2.
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.
LALInferenceVariableItem * LALInferencePopVariableItem(LALInferenceVariables *vars, const char *name)
Pop the list node for "name".
void LALInferenceSortVariablesByName(LALInferenceVariables *vars)
Sorts the variable structure by name.
void XLALMultiStudentDeviates(REAL4Vector *vector, gsl_matrix *matrix, UINT4 dim, UINT4 n, RandomParams *randParam)
Draw a random multivariate vector from student-t distr given covariance matrix.
void LALInferenceSetINT4VectorVariable(LALInferenceVariables *vars, const char *name, INT4Vector *value)
void LALInferenceAddgslMatrixVariable(LALInferenceVariables *vars, const char *name, gsl_matrix *value, LALInferenceParamVaryType vary)
void parseLine(char *record, const char *delim, char arr[][VARNAME_MAX], INT4 *cnt)
Parse a single line of delimited ASCII.
void LALInferenceBinaryLove(LALInferenceVariables *vars, REAL8 *lambda1, REAL8 *lambda2)
Compute Tidal deformabilities following BinaryLove Universal relations.
void LALInferenceCopyVariablesToArray(LALInferenceVariables *origin, REAL8 *target)
LALInference variables to an array, and vica versa.
void LALInferenceMcEta2Masses(double mc, double eta, double *m1, double *m2)
Convert from Mc, eta space to m1, m2 space (note m1 > m2).
ProcessParamsTable * LALInferenceGetProcParamVal(ProcessParamsTable *procparams, const char *name)
Returns the element of the process params table with "name".
INT4 LALInferenceFprintParameterNonFixedHeadersWithSuffix(FILE *out, LALInferenceVariables *params, const char *suffix)
Print the parameters which do not vary to a file as a tab-separated ASCII line, adding the given suff...
int LALInferenceWriteVariablesBinary(FILE *file, LALInferenceVariables *vars)
Write a LALInferenceVariables as binary to a given FILE pointer, returns the number of items written ...
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 XLALMultiNormalDeviates(REAL4Vector *vector, gsl_matrix *matrix, UINT4 dim, RandomParams *randParam)
Draw a random multivariate vector from Gaussian distr given covariance matrix.
int LALInferenceSplineCalibrationFactor(REAL8Vector *freqs, REAL8Vector *deltaAmps, REAL8Vector *deltaPhases, COMPLEX16FrequencySeries *calFactor)
Computes the factor relating the physical waveform to a measured waveform for a spline-fit calibratio...
INT4 LALInferenceSanityCheck(LALInferenceRunState *state)
Sanity check the structures in the given state.
INT4(* LALInferenceEvolveOneStepFunction)(struct tagLALInferenceRunState *runState)
Perform one step of an algorithm, replaces runState ->currentParams.
void LALInferenceLogSampleToArray(LALInferenceVariables *algorithmParams, LALInferenceVariables *vars)
Append the sample to an array which can be later processed by the user.
void LALInferencePrintVariables(LALInferenceVariables *var)
Print variables to stdout.
ProcessParamsTable * LALInferenceParseCommandLine(int argc, char **argv)
Return a ProcessParamsTable from the command line arguments.
void LALInferenceExecuteInvFT(LALInferenceModel *model)
Execute Inverse FFT for data in IFOdata.
const CHAR * LALInferenceGetstringVariable(LALInferenceVariables *vars, const char *name)
REAL8(* LALInferenceLikelihoodFunction)(LALInferenceVariables *currentParams, struct tagLALInferenceIFOData *data, LALInferenceModel *model)
Type declaration for likelihood function Computes p(data | currentParams, templt ) templt is a LALInf...
LALInferenceVariables * LALInferenceReadVariablesBinary(FILE *stream)
Read from the given FILE * a LALInferenceVariables, which was previously written with LALInferenceWri...
void LALInferenceDetFrameToEquatorial(LALDetector *det0, LALDetector *det1, REAL8 t0, REAL8 alpha, REAL8 theta, REAL8 *tg, REAL8 *ra, REAL8 *dec)
Conversion routines between Equatorial (RA,DEC) and detector-based coordinate systems,...
void LALInferenceSetINT8Variable(LALInferenceVariables *vars, const char *name, INT8 value)
void LALInferenceSetREAL4Variable(LALInferenceVariables *vars, const char *name, REAL4 value)
int LALInferenceCheckVariable(LALInferenceVariables *vars, const char *name)
Checks for name being present in vars returns 1(==true) or 0.
void LALInferenceSetgslMatrixVariable(LALInferenceVariables *vars, const char *name, gsl_matrix *value)
void LALInferenceCopyUnsetREAL8Variables(LALInferenceVariables *origin, LALInferenceVariables *target, ProcessParamsTable *commandLine)
LALInferenceVariableItem * LALInferenceGetItemNr(LALInferenceVariables *vars, int idx)
Return the list node for the idx-th item - do not rely on this Indexing starts at 1.
void LALInferenceSetMCMCrunphase_ptrVariable(LALInferenceVariables *vars, const char *name, LALInferenceMCMCRunPhase *value)
void LALInferenceAddUINT4VectorVariable(LALInferenceVariables *vars, const char *name, UINT4Vector *value, LALInferenceParamVaryType vary)
void LALInferenceTranslateExternalToInternalParamName(char *outName, const char *inName)
Converts between externally used parameter names and those internal.
INT8 LALInferenceGetINT8Variable(LALInferenceVariables *vars, const char *name)
void LALInferenceSetCOMPLEX8Variable(LALInferenceVariables *vars, const char *name, COMPLEX8 value)
COMPLEX16 LALInferenceGetCOMPLEX16Variable(LALInferenceVariables *vars, const char *name)
LALInferenceVariableType
An enumerated type for denoting the type of a variable.
LALInferenceParamVaryType LALInferenceGetVariableVaryType(LALInferenceVariables *vars, const char *name)
Get the LALInferenceParamVaryType of the parameter named name in vars see the declaration of LALInfer...
char * LALInferencePrintCommandLine(ProcessParamsTable *procparams)
Output the command line based on the ProcessParamsTable procparams.
LALInferenceVariableItem * LALInferenceGetItem(const LALInferenceVariables *vars, const char *name)
Return the list node for "name" - do not rely on this.
void LALInferenceAddREAL4Variable(LALInferenceVariables *vars, const char *name, REAL4 value, LALInferenceParamVaryType vary)
void LALInferenceSetVariable(LALInferenceVariables *vars, const char *name, const void *value)
Set a variable named name in vars with a value.
void LALInferenceSetREAL8VectorVariable(LALInferenceVariables *vars, const char *name, REAL8Vector *value)
int LALInferenceCheckVariableNonFixed(LALInferenceVariables *vars, const char *name)
Checks for name being present in vars and having type LINEAR or CIRCULAR.
int LALInferenceReadRunStateBinary(FILE *file, LALInferenceRunState *state)
Reads the file and populates LALInferenceVariables in the runState that were saved with LALInferenceR...
const char * LALInferenceTranslateInternalToExternalParamName(const char *inName)
Converts between internally used parameter names and those external (e.g.
void LALInferenceKDREAL8ToVariables(LALInferenceVariables *params, REAL8 *pt, LALInferenceVariables *templt)
Fills in the non-fixed variables in params from the given REAL8 array.
void LALInferenceAddCOMPLEX8Variable(LALInferenceVariables *vars, const char *name, COMPLEX8 value, LALInferenceParamVaryType vary)
@ 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_LADDER_UPDATE
In the single-chain sampling phase of an annealed run.
@ LALINFERENCE_ANNEALING
In the parallel tempering phase of an annealed run.
@ LALINFERENCE_SINGLE_CHAIN
In the annealing phase of an annealed run.
@ LALINFERENCE_TEMP_PT
Run only parallel tempers.
@ LALINFERENCE_COMPLEX16_t
@ LALINFERENCE_MCMCrunphase_ptr_t
@ LALINFERENCE_INT4Vector_t
@ LALINFERENCE_REAL8Vector_t
@ LALINFERENCE_void_ptr_t
@ LALINFERENCE_UINT4Vector_t
@ LALINFERENCE_gslMatrix_t
@ LALINFERENCE_COMPLEX8_t
@ LALINFERENCE_COMPLEX16Vector_t
Structure to contain IFO data.
REAL8TimeSeries * timeData
Detector name.
REAL8TimeSeries * varTimeData
white is not really white, but over-white.
LALDetector * detector
integration limits for overlap integral in F-domain
REAL8FFTPlan * margFFTPlan
Pre-calculated FFT plans for forward and reverse FFTs.
REAL8FrequencySeries * oneSidedNoisePowerSpectrum
REAL8 timeshift
Detector responses.
UINT4 templa_counter
counts how many time the likelihood has been calculated
struct tagLALInferenceROQData * roq
counts how many time the template has been calculated
REAL8FrequencySeries * noiseASD
one-sided Noise Power Spectrum
REAL8Window * window
(one-sided Noise Power Spectrum)^{-1/2}
COMPLEX16FrequencySeries * freqData
What is this?
COMPLEX16FrequencySeries * whiteFreqData
Buffer for frequency domain data.
UINT4 likeli_counter
Degrees of freedom for IFO to be used in Student-T Likelihood.
REAL8 SNR
The epoch of this observation (the time of the first sample)
REAL8 nullloglikelihood
A time series of the data noise variance.
struct tagLALInferenceIFOData * next
ROQ data.
LIGOTimeGPS epoch
LALDetector structure for where this data came from.
REAL8FFTPlan * freqToTimeFFTPlan
LALInferenceVariables * dataParams
Complex time series data buffers.
REAL8 STDOF
IF INJECTION ONLY, E(SNR) of the injection in the detector.
REAL8TimeSeries * whiteTimeData
A time series from the detector.
COMPLEX16TimeSeries * compTimeData
Detector-dependent buffers and parameters A linked list meant for parameters and buffers that are sep...
COMPLEX16FrequencySeries * freqhCross
REAL8TimeSeries * timeData
Complex time series signal buffer.
struct tagLALInferenceIFOModel * next
Time series model buffer.
REAL8TimeSeries * timehCross
LALDetector * detector
Parameters used when filling the buffers - template functions should copy to here.
void * extraData
LALDetector structure for where this data came from.
LALInferenceVariables * params
COMPLEX16TimeSeries * compTimeSignal
Freq series model buffers.
The kD trees in LALInference are composed of cells.
struct tagLALInferenceKDTree * right
Left (i.e.
int eigenFrameStale
Maximum coordinates of points in the eigen-frame.
REAL8 * eigenMax
Minimum coordinates of points in the eigen-frame.
REAL8 * upperRight
Lower left (i.e.
REAL8 ** ptsCovEigenVects
dim-by-dim covariance matrix.
size_t ptsSize
Stores the number of tree points that lie in the cell.
size_t dim
Size of the pts buffer.
REAL8 * lowerLeft
Mean of pts.
REAL8 ** pts
Dimension of the system.
struct tagLALInferenceKDTree * left
== 1 when the mean, covariance, and eigenvectors are out of date (i.e.
REAL8 * eigenMin
Eigenvectors of the covariance matrix: [i][j] is the jth component of the ith eigenvector.
REAL8 ** ptsCov
Upper right (i.e.
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
LALSimNeutronStarFamily * eos_fam
Is ROQ enabled.
REAL8 fHigh
Start frequency for waveform generation.
REAL8TimeSeries * timehCross
REAL8 logprior
The template generation function.
LALSimBurstWaveformCache * burstWaveformCache
Waveform cache.
LALSimInspiralWaveformCache * waveformCache
REAL8 loglikelihood
Prior value at params
REAL8 SNR
Likelihood value at params
LALInferenceVariables * params
COMPLEX16FrequencySeries ** freqhs
Freq series model buffers.
COMPLEX16FrequencySeries * freqhCross
LALDict * LALpars
Projected freq series model buffers.
REAL8FFTPlan * freqToTimeFFTPlan
INT4 freqLength
Sampling rate information.
REAL8Window * window
Pre-calculated FFT plans for forward and reverse FFTs.
REAL8 fLow
Array of single-IFO SNRs at params
LALInferenceIFOModel * ifo
Parameters used when filling the buffers - template functions should copy to here.
struct tagLALInferenceROQModel * roq
The padding of the above window.
LALInferenceTemplateFunction templt
Domain of model.
LALSimulationDomain domain
IFO-dependent parameters and buffers.
Structure for holding a proposal cycle.
LALInferenceProposal ** proposals
INT4 * order
Array of proposals (one per proposal function)
INT4 nProposals
Length of cycle.
LALInferenceVariables * proposalArgs
Name of current proposal.
Structure for holding a LALInference proposal, along with name and stats.
LALInferenceVariables * args
LALInferenceProposalFunction func
REAL8 time_weights_width
weights for calculating <h|h>
double int_f_7_over_3
weights for calculating <h|h> if not using analytical formula
FILE * weightsFileQuadratic
struct tagLALInferenceROQSplineWeightsLinear * weights_linear
REAL8 * weightsQuadratic
weights for <d|h>: NOTE: needs to be stored from data read from command line
gsl_matrix_complex * mmweights
weights for the likelihood: NOTE: needs to be stored from data read from command line
gsl_matrix_complex * weights
COMPLEX16 * weightsLinear
COMPLEX16Sequence * calFactorLinear
COMPLEX16FrequencySeries * hctildeQuadratic
COMPLEX16FrequencySeries * hctildeLinear
REAL8Sequence * frequencyNodesQuadratic
empirical frequency nodes for the likelihood.
gsl_vector * frequencyNodes
REAL8Sequence * frequencyNodesLinear
gsl_vector_complex * hcross
waveform at frequency nodes.
REAL8 * amp_squared
empirical frequency nodes for the likelihood.
COMPLEX16Sequence * calFactorQuadratic
FILE * nodesFileQuadratic
gsl_vector_complex * hstrain
gsl_vector_complex * hplus
COMPLEX16FrequencySeries * hptildeQuadratic
COMPLEX16FrequencySeries * hptildeLinear
gsl_interp_accel * acc_real_weight_linear
gsl_spline * spline_real_weight_linear
gsl_interp_accel * acc_imag_weight_linear
gsl_spline * spline_imag_weight_linear
Structure containing inference run state This includes pointers to the function types required to run...
ProcessParamsTable * commandLine
LALInferenceVariables * proposalArgs
The data from the interferometers.
LALInferenceVariables * algorithmParams
Any special arguments for the prior function.
LALInferenceCubeToPriorFunction CubeToPrior
The prior for the parameters.
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
LALInferenceAlgorithm algorithm
A function that returns a new set of variables for the model.
LALInferenceEvolveOneStepFunction evolve
The algorithm function.
LALInferencePriorFunction prior
The algorithm's single iteration function.
LALInferenceLogFunction logsample
The likelihood function.
char * resumeOutFileName
Name for thread's output file.
LALInferenceInitModelFunction initModel
A ProcessParamsTable with command line arguments.
LALInferenceVariables ** livePoints
Parameters which control the running of the algorithm.
LALInferenceSwapRoutine parallelSwap
Number of threads stored in threads.
LALInferenceLikelihoodFunction likelihood
MultiNest prior for the parameters.
Structure containing chain-specific variables.
LALInferenceVariables * proposedParams
Current location going into jump proposal.
REAL8 currentSNR
Array storing single-IFO likelihoods of current sample.
INT4 effective_sample_size
Step counter for this thread.
LALInferenceVariables * algorithmParams
Arguments needed by proposals.
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.
REAL8 currentPropDensity
Stucture containing model buffers and parameters.
LALInferenceModel * model
Cycle of proposals to call.
REAL8 * currentIFOSNRs
When the DE buffer gets too long, start storing only every n-th output point; this counter stores n.
INT4 accepted
This should be removed, can be given as an algorithmParams entry.
size_t differentialPointsLength
Array of points for differential evolution.
LALInferenceProposalFunction proposal
Step counter for this thread.
LALInferenceProposalCycle * cycle
The proposal cycle.
REAL8 * currentIFOLikelihoods
Array storing single-IFO SNRs of current sample.
LALInferenceVariables * proposalArgs
REAL8 temperature
Array containing multiple proposal densities.
INT4 * temp_swap_accepts
Pointer to the parent RunState of the thread.
size_t differentialPointsSize
Length of the current differential points stored in differentialPoints.
size_t differentialPointsSkip
Size of the differentialPoints memory block (must be >= length of differential points).
LALInferenceVariables ** differentialPoints
Parameters proposed.
LALInferenceVariables * preProposalParams
The current parameters.
REAL8 nullLikelihood
Array storing network SNR of current sample.
The LALInferenceVariableItem list node structure This should only be accessed using the accessor func...
LALInferenceVariableType type
struct tagVariableItem * next
LALInferenceParamVaryType vary
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...
LALInferenceVariableItem * head