SPINspiral
SPINspiral is a parameter-estimation code for gravitational-wave signals detected by LIGO/Virgo
|
Contains routines that handle reading and randomisation of parameters. More...
#include <getopt.h>
#include <lal/LIGOMetadataTables.h>
#include <lal/LIGOLwXMLInspiralRead.h>
#include <SPINspiral.h>
Defines | |
#define | UNUSED |
Functions | |
void | readCommandLineOptions (int argc, char *argv[], struct runPar *run) |
Read and parse command-line arguments/options. | |
void | parseCharacterOptionString (char *input, char **strings[], int *n) |
parse strings from "[one,two,three]" to {"one", "two", "three"} | |
void | readMainInputfile (struct runPar *run) |
Read the main input file. | |
void | readMCMCinputfile (struct runPar *run) |
Read the MCMC input file. | |
void | readDataInputfile (struct runPar *run, struct interferometer ifo[]) |
Read the data input file. | |
void | readInjectionInputfile (struct runPar *run) |
Read the injection input file. | |
void | readParameterInputfile (struct runPar *run) |
Read the (MCMC) parameter input file. | |
void | readSystemInputfile (struct runPar *run) |
Read the input file for system (system-dependent) variables, e.g. SPINspiral.input.system. | |
void | readInjectionXML (struct runPar *run) |
Read an XML injection file if specified. | |
void | readCachefile (struct runPar *run, int ifonr) |
Read a Cache file. Returns an array of what is in the cache file. | |
void | setRandomInjectionParameters (struct runPar *run) |
Get random values for the injection parameters. | |
void | setParameterNames (struct runPar *run) |
Set parameters names in the hardcoded parameter database. | |
void | copyRun2MCMC (struct runPar run, struct MCMCvariables *mcmc) |
Copy some of the elements of the struct runPar to the struct MCMCvariables. | |
void | setConstants () |
Set global variables. | |
void | getInjectionParameters (struct parSet *par, int nInjectionPar, double *injParVal) |
Returns the 'injection values' to the parameter set par. | |
void | getStartParameters (struct parSet *par, struct runPar run) |
Returns the 'best-guess values' to the parameter set par. | |
void | allocParset (struct parSet *par, int networkSize) |
Allocate memory for the vectors in the struct parSet. | |
void | freeParset (struct parSet *par) |
Deallocate memory for the vectors in the struct parSet. |
Contains routines that handle reading and randomisation of parameters.
#define UNUSED |
Referenced by readMainInputfile().
void readCommandLineOptions | ( | int | argc, |
char * | argv[], | ||
struct runPar * | run | ||
) |
Read and parse command-line arguments/options.
References runPar::cacheFilename, runPar::channelname, runPar::commandSettingsFlag, runPar::dataAfterTc, runPar::dataBeforeTc, runPar::downsampleFactor, runPar::highFrequencyCut, runPar::injXMLfilename, runPar::injXMLnr, runPar::lowFrequencyCut, runPar::mainFilename, runPar::mcmcFilename, runPar::MCMCseed, runPar::mcmcWaveform, runPar::networkSize, runPar::nIter, runPar::nMCMCpar, runPar::outputPath, parseCharacterOptionString(), runPar::PSDsegmentLength, runPar::PSDsegmentNumber, runPar::PSDstart, readCachefile(), runPar::selectifos, runPar::thinOutput, runPar::triggerDist, runPar::triggerEta, runPar::triggerMc, runPar::triggerTc, runPar::tukey1, runPar::tukey2, and USAGE.
Referenced by main().
void parseCharacterOptionString | ( | char * | input, |
char ** | strings[], | ||
int * | n | ||
) |
parse strings from "[one,two,three]" to {"one", "two", "three"}
Read and parse command-line arguments/options Parses a character string (passed as one of the options) and decomposes it into individual parameter character strings. Input is of the form input : "[one,two,three]" and the resulting output is strings : {"one", "two", "three"} length of parameter names is by now limited to 512 characters. (should 'theoretically' (untested) be able to digest white space as well. Irrelevant for command line options, though.)
Referenced by readCommandLineOptions().
void readMainInputfile | ( | struct runPar * | run | ) |
Read the main input file.
All parameters that are read here should be(come) members of the runvar struct and lose their global status
References runPar::beVerbose, runPar::dataFilename, runPar::doMatch, runPar::doMCMC, runPar::doSNR, runPar::injectionFilename, runPar::mainFilename, runPar::mcmcFilename, runPar::parameterFilename, runPar::systemFilename, UNUSED, and runPar::writeSignal.
Referenced by main().
void readMCMCinputfile | ( | struct runPar * | run | ) |
Read the MCMC input file.
All parameters that are read here should be(come) members of the runvar struct and lose their global status
References runPar::acceptRateTarget, runPar::adaptiveMCMC, runPar::annealNburn, runPar::annealNburn0, runPar::annealTemp0, runPar::blockFrac, runPar::commandSettingsFlag, runPar::correlatedUpdates, runPar::corrFrac, runPar::matAccFr, runPar::maxTemp, runPar::mcmcFilename, runPar::MCMCseed, runPar::minlogL, runPar::nCorr, runPar::nIter, runPar::nTemps, runPar::parallelTempering, runPar::prMatrixInfo, runPar::prParTempInfo, runPar::saveHotChains, runPar::tempLadder, runPar::thinOutput, and runPar::thinScreenOutput.
Referenced by main().
void readDataInputfile | ( | struct runPar * | run, |
struct interferometer | ifo[] | ||
) |
Read the data input file.
References interferometer::add2channels, interferometer::ch1doubleprecision, interferometer::ch1fileoffset, interferometer::ch1filesize, runPar::channelname, runPar::commandSettingsFlag, runPar::dataAfterTc, runPar::dataBeforeTc, runPar::dataDir, runPar::dataFilename, runPar::datasetName, runPar::downsampleFactor, runPar::highFrequencyCut, interferometer::lati, interferometer::leftArm, interferometer::longi, runPar::lowFrequencyCut, runPar::maxIFOdbaseSize, runPar::networkSize, interferometer::noisedoubleprecision, interferometer::noisefileoffset, interferometer::noisefilesize, interferometer::noiseGPSstart, pi, runPar::PSDsegmentLength, runPar::PSDsegmentNumber, interferometer::rightArm, runPar::selectifos, and runPar::tukeyWin.
Referenced by setIFOdata().
void readInjectionInputfile | ( | struct runPar * | run | ) |
Read the injection input file.
All parameters that are read in here should be(come) members of the runvar struct
References runPar::beVerbose, runPar::geocentricTc, runPar::injBoundLow, runPar::injBoundType, runPar::injBoundUp, runPar::injectionFilename, runPar::injectionPNorder, runPar::injectionSNR, runPar::injectionWaveform, runPar::injectSignal, runPar::injID, runPar::injNumber, runPar::injParUse, runPar::injParVal, runPar::injParValOrig, runPar::injRanPar, runPar::injRanSeed, runPar::injRevID, runPar::injSigma, runPar::nInjectPar, runPar::parAbrev, runPar::parDef, and setRandomInjectionParameters().
Referenced by main().
void readParameterInputfile | ( | struct runPar * | run | ) |
Read the (MCMC) parameter input file.
All parameters that are read in here should be(come) members of the runvar struct
References runPar::beVerbose, c3rd, runPar::commandSettingsFlag, runPar::geocentricTc, runPar::injectionFilename, runPar::injectSignal, runPar::injParVal, runPar::injRevID, runPar::mcmcFilename, runPar::mcmcParUse, runPar::mcmcPNorder, runPar::MCMCseed, runPar::mcmcWaveform, runPar::nMCMCpar, runPar::offsetMCMC, runPar::offsetX, runPar::parAbrev, runPar::parameterFilename, runPar::parBestVal, runPar::parDef, runPar::parFix, runPar::parID, runPar::parNumber, runPar::parRevID, runPar::parSigma, runPar::parStartMCMC, pi, runPar::priorBoundLow, runPar::priorBoundUp, runPar::priorSet, runPar::priorType, tpi, runPar::triggerDist, runPar::triggerEta, runPar::triggerMc, and runPar::triggerTc.
Referenced by main().
void readSystemInputfile | ( | struct runPar * | run | ) |
Read the input file for system (system-dependent) variables, e.g. SPINspiral.input.system.
References runPar::dataDir, runPar::parameterFilename, and runPar::systemFilename.
Referenced by main().
void readInjectionXML | ( | struct runPar * | run | ) |
Read an XML injection file if specified.
References runPar::geocentricTc, runPar::injID, runPar::injNumber, runPar::injParVal, runPar::injRevID, runPar::injXMLfilename, runPar::injXMLnr, runPar::lowFrequencyCutInj, runPar::nInjectPar, and runPar::parAbrev.
Referenced by main().
void readCachefile | ( | struct runPar * | run, |
int | ifonr | ||
) |
Read a Cache file. Returns an array of what is in the cache file.
References runPar::cacheFilename, runPar::FrameDetector, runPar::FrameGPSstart, runPar::FrameLength, runPar::FrameName, runPar::FramePrefix, and runPar::nFrame.
Referenced by readCommandLineOptions().
void setRandomInjectionParameters | ( | struct runPar * | run | ) |
Get random values for the injection parameters.
References runPar::injBoundLow, runPar::injBoundUp, runPar::injParVal, runPar::injParValOrig, runPar::injRanPar, runPar::injRanSeed, runPar::injSigma, max, min, runPar::nInjectPar, and setSeed().
Referenced by readInjectionInputfile().
void setParameterNames | ( | struct runPar * | run | ) |
Set parameters names in the hardcoded parameter database.
References runPar::parAbrev, runPar::parAbrv, and runPar::parDef.
Referenced by main().
void copyRun2MCMC | ( | struct runPar | run, |
struct MCMCvariables * | mcmc | ||
) |
Copy some of the elements of the struct runPar to the struct MCMCvariables.
References runPar::acceptRateTarget, MCMCvariables::acceptRateTarget, runPar::adaptiveMCMC, MCMCvariables::adaptiveMCMC, runPar::annealNburn, MCMCvariables::annealNburn, runPar::annealNburn0, MCMCvariables::annealNburn0, runPar::annealTemp0, MCMCvariables::annealTemp0, MCMCvariables::baseTime, runPar::beVerbose, MCMCvariables::beVerbose, runPar::blockFrac, MCMCvariables::blockFrac, MCMCvariables::chTemp, runPar::correlatedUpdates, MCMCvariables::correlatedUpdates, runPar::corrFrac, MCMCvariables::corrFrac, runPar::geocentricTc, MCMCvariables::geocentricTc, runPar::injectionPNorder, MCMCvariables::injectionPNorder, runPar::injectionWaveform, MCMCvariables::injectionWaveform, runPar::injectSignal, MCMCvariables::injectSignal, runPar::injID, MCMCvariables::injID, runPar::injParUse, MCMCvariables::injParUse, runPar::injParVal, MCMCvariables::injParVal, runPar::injRevID, MCMCvariables::injRevID, runPar::matAccFr, MCMCvariables::matAccFr, max, runPar::maxnPar, MCMCvariables::maxnPar, runPar::maxTemp, MCMCvariables::maxTemp, runPar::mcmcParUse, MCMCvariables::mcmcParUse, runPar::mcmcPNorder, MCMCvariables::mcmcPNorder, runPar::MCMCseed, runPar::mcmcWaveform, MCMCvariables::mcmcWaveform, runPar::minlogL, MCMCvariables::minlogL, runPar::nCorr, MCMCvariables::nCorr, runPar::networkSize, MCMCvariables::networkSize, runPar::nInjectPar, MCMCvariables::nInjectPar, runPar::nIter, MCMCvariables::nIter, runPar::nMCMCpar, MCMCvariables::nMCMCpar, runPar::nTemps, MCMCvariables::nTemps, runPar::offsetMCMC, MCMCvariables::offsetMCMC, runPar::offsetX, MCMCvariables::offsetX, runPar::parAbrev, MCMCvariables::parAbrev, runPar::parAbrv, MCMCvariables::parAbrv, runPar::parallelTempering, MCMCvariables::parallelTempering, runPar::parBestVal, MCMCvariables::parBestVal, runPar::parDBn, MCMCvariables::parDBn, runPar::parFix, MCMCvariables::parFix, runPar::parID, MCMCvariables::parID, runPar::parName, MCMCvariables::parName, runPar::parNumber, MCMCvariables::parNumber, runPar::parRevID, MCMCvariables::parRevID, runPar::parSigma, MCMCvariables::parSigma, runPar::parStartMCMC, MCMCvariables::parStartMCMC, runPar::priorBoundLow, MCMCvariables::priorBoundLow, runPar::priorBoundUp, MCMCvariables::priorBoundUp, runPar::priorType, MCMCvariables::priorType, runPar::prMatrixInfo, MCMCvariables::prMatrixInfo, runPar::prParTempInfo, MCMCvariables::prParTempInfo, runPar::saveHotChains, MCMCvariables::saveHotChains, MCMCvariables::seed, runPar::tempLadder, MCMCvariables::tempLadder, runPar::thinOutput, MCMCvariables::thinOutput, runPar::thinScreenOutput, and MCMCvariables::thinScreenOutput.
Referenced by MCMC().
void setConstants | ( | void | ) |
void getInjectionParameters | ( | struct parSet * | par, |
int | nInjectionPar, | ||
double * | injParVal | ||
) |
Returns the 'injection values' to the parameter set par.
References parSet::nPar, and parSet::par.
Referenced by dataFT(), main(), matchBetweenParameterArrayAndTrueParameters(), MCMC(), and writeSignalsToFiles().
void getStartParameters | ( | struct parSet * | par, |
struct runPar | run | ||
) |
Returns the 'best-guess values' to the parameter set par.
References runPar::nMCMCpar, parSet::nPar, parSet::par, and runPar::parBestVal.
void allocParset | ( | struct parSet * | par, |
int | networkSize | ||
) |
Allocate memory for the vectors in the struct parSet.
References parSet::localti, parSet::locazi, and parSet::loctc.
Referenced by dataFT(), main(), matchBetweenParameterArrayAndTrueParameters(), MCMC(), and writeSignalsToFiles().
void freeParset | ( | struct parSet * | par | ) |
Deallocate memory for the vectors in the struct parSet.
References parSet::localti, parSet::locazi, and parSet::loctc.
Referenced by dataFT(), main(), matchBetweenParameterArrayAndTrueParameters(), MCMC(), and writeSignalsToFiles().