SPINspiral
SPINspiral is a parameter-estimation code for gravitational-wave signals detected by LIGO/Virgo
Defines | Functions
src/SPINspiral_parameters.c File Reference

(SPINspiral version 0.5.1, revision 275)

Contains routines that handle reading and randomisation of parameters. More...

#include <getopt.h>
#include <lal/LIGOMetadataTables.h>
#include <lal/LIGOLwXMLInspiralRead.h>
#include <SPINspiral.h>
Include dependency graph for SPINspiral_parameters.c:

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.

Detailed Description

Contains routines that handle reading and randomisation of parameters.


Define Documentation

#define UNUSED

Referenced by readMainInputfile().


Function Documentation

void readCommandLineOptions ( int  argc,
char *  argv[],
struct runPar run 
)
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)
void readDataInputfile ( struct runPar run,
struct interferometer  ifo[] 
)
void readInjectionInputfile ( struct runPar run)
void readParameterInputfile ( struct runPar run)
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)
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)
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  )

Set global variables.

Todo:
This routine should eventually contain mathematical and (astro)physical constants only.

References c, G, Mpc, Mpcs, Ms, mtpi, pi, and tpi.

Referenced by main().

void getInjectionParameters ( struct parSet par,
int  nInjectionPar,
double *  injParVal 
)

Returns the 'injection values' to the parameter set par.

Todo:
Remove par->mc etc. struct elements

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.

Referenced by main(), and MCMC().

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().

 All Data Structures Files Functions Variables Defines