Commit 76952f1a authored by Carl-Johan Haster's avatar Carl-Johan Haster

Add ThermoIntEvidence (combine HDF5 files) into lalinference pipeline, one mergescript

Original: ac90314706884c5b3fd7b84c12e6f29dfe2ea996
parent d947fdca
......@@ -317,6 +317,10 @@ INT4 init_ptmcmc(LALInferenceRunState *runState) {
/* Establish the random state across MPI threads */
init_mpi_randomstate(runState);
/* Add common fixed parameters to output */
LALInferenceAddPTMCMCMetaInfo(runState);
/* Give a new set of proposal args to each thread */
for (i=0; i<runState->nthreads; i++) {
thread = runState->threads[i];
......
......@@ -456,6 +456,8 @@ void record_likelihoods(LALInferenceThreadState *thread) {
LALInferenceAddVariable(thread->currentParams, "logprior", &(thread->currentPrior), LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_OUTPUT);
LALInferenceAddVariable(thread->currentParams, "logl", &(thread->currentLikelihood), LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_OUTPUT);
LALInferenceAddVariable(thread->currentParams, "deltalogl", &deltalogl, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_OUTPUT);
LALInferenceAddVariable(thread->currentParams, "temperature", &(thread->temperature), LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_OUTPUT);
LALInferenceAddVariable(thread->currentParams, "nullLogL", &(thread->nullLikelihood), LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_OUTPUT);
LALInferenceIFOData *headIFO = thread->parent->data;
char name[256];
......@@ -1884,3 +1886,44 @@ void LALInferenceMCMCResumeRead(LALInferenceThreadState *thread, FILE *resumeFil
return;
}
void LALInferenceAddPTMCMCMetaInfo(LALInferenceRunState *runState) {
UINT4 nIFO = 0;
INT4 i, MPIsize, n_local_threads, ntemps, randomseed;
REAL8 seglen, epoch;
LALInferenceIFOData *ifodata1;
LALInferenceThreadState *thread;
MPI_Comm_size(MPI_COMM_WORLD, &MPIsize);
n_local_threads = runState->nthreads;
ntemps = MPIsize*n_local_threads;
randomseed = LALInferenceGetINT4Variable(runState->algorithmParams, "random_seed");
ifodata1 = runState->data;
while(ifodata1){
nIFO++;
ifodata1 = ifodata1->next;
}
REAL8 SampleRate = 4096.0; //default value of the sample rate from LALInferenceReadData()
if(LALInferenceGetProcParamVal(runState->commandLine, "--srate"))
SampleRate = atof(LALInferenceGetProcParamVal(runState->commandLine, "--srate")->value);
seglen = atof(LALInferenceGetProcParamVal(runState->commandLine,"--seglen")->value);
epoch = XLALGPSGetREAL8(&(runState->data->epoch));
for (i=0; i<runState->nthreads; i++) {
thread = runState->threads[i];
LALInferenceAddVariable(thread->currentParams, "nIFO", &nIFO, LALINFERENCE_UINT4_t, LALINFERENCE_PARAM_FIXED);
LALInferenceAddVariable(thread->currentParams, "nLocalTemps", &n_local_threads, LALINFERENCE_UINT4_t, LALINFERENCE_PARAM_FIXED);
LALInferenceAddVariable(thread->currentParams, "nTemps", &ntemps, LALINFERENCE_UINT4_t, LALINFERENCE_PARAM_FIXED);
LALInferenceAddVariable(thread->currentParams, "randomSeed", &randomseed, LALINFERENCE_UINT4_t, LALINFERENCE_PARAM_FIXED);
LALInferenceAddVariable(thread->currentParams, "sampleRate", &SampleRate, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_FIXED);
LALInferenceAddVariable(thread->currentParams, "segmentLength", &seglen, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_FIXED);
LALInferenceAddVariable(thread->currentParams, "segmentStart", &epoch, LALINFERENCE_REAL8_t, LALINFERENCE_PARAM_FIXED);
}
}
......@@ -89,6 +89,7 @@ void LALInferenceNameOutputs(LALInferenceRunState *runState);
void LALInferenceCheckpointMCMC(LALInferenceRunState *runState);
void LALInferenceResumeMCMC(LALInferenceRunState *runState);
void LALInferenceReadMCMCCheckpoint(LALInferenceRunState *runState);
void LALInferenceAddPTMCMCMetaInfo(LALInferenceRunState *runState);
/** Reads final parameter values from the given output file, and
stores them in the current params to try to continue the run. */
......
......@@ -124,7 +124,9 @@ ignore-science-segments=True
# Replace with your own executable locations
datafind=/home/albert.einstein/bin/gw_data_find
mergescript=/home/albert.einstein/bin/lalapps_nest2pos
mergeNSscript=/home/albert.einstein/bin/lalapps_nest2pos
mergeMCMCscript=/home/albert.einstein/bin/cbcBayesMCMC2pos.py
combinePTMCMCh5script=/home/albert.einstein/bin/cbcBayesCombinePTMCMCh5s.py
resultspage=/home/albert.einstein/bin/cbcBayesPostProc.py
segfind=/home/albert.einstein/bin/ligolw_segment_query
ligolw_print=/home/albert.einstein/bin/ligolw_print
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment