#include <ctype.h>#include <getopt.h>#include <lalapps.h>#include <lal/Date.h>#include <lal/LIGOMetadataTables.h>#include <lal/LIGOMetadataUtils.h>#include <lal/LIGOLwXMLRead.h>#include <lal/LIGOLwXML.h>#include <lal/Random.h>#include <lal/AVFactories.h>#include <lal/InspiralInjectionParams.h>#include <processtable.h>Include dependency graph for inspinj.c:

Go to the source code of this file.
Defines | |
| #define | CVS_REVISION "$Revision: 1.70 $" |
| #define | CVS_ID_STRING "$Id: inspinj.c,v 1.70 2008/07/25 16:26:14 ram Exp $" |
| #define | CVS_SOURCE "$Source: /usr/local/cvs/lscsoft/lalapps/src/inspiral/inspinj.c,v $" |
| #define | CVS_DATE "$Date: 2008/07/25 16:26:14 $" |
| #define | CVS_NAME_STRING "$Name: $" |
| #define | PROGRAM_NAME "inspinj" |
| #define | ADD_PROCESS_PARAM(pptype, format, ppvalue) |
Functions | |
| RCSID ("$Id: inspinj.c,v 1.70 2008/07/25 16:26:14 ram Exp $") | |
| ProcessParamsTable * | next_process_param (const char *name, const char *type, const char *fmt,...) |
| void | read_mass_data (char *filename) |
| void | read_nr_data (char *filename) |
| void | read_source_data (char *filename) |
| void | drawFromSource (REAL8 *rightAscension, REAL8 *declination, REAL8 *distance, CHAR name[LIGOMETA_SOURCE_MAX]) |
| void | drawLocationFromExttrig (SimInspiralTable *table) |
| void | drawMassFromSource (SimInspiralTable *table) |
| void | drawMassSpinFromNR (SimInspiralTable *table) |
| int | main (int argc, char *argv[]) |
| MAIN function of SideBandMCMC code Compute the posterior pdfs of the orbital and nuisance parameters of a binary signal in Fstat form. | |
Variables | |
| DistanceDistribution | dDistr |
| SkyLocationDistribution | lDistr |
| MassDistribution | mDistr |
| InclDistribution | iDistr |
| SimInspiralTable * | simTable |
| char * | massFileName = NULL |
| char * | nrFileName = NULL |
| char * | sourceFileName = NULL |
| char * | outputFileName = NULL |
| char * | exttrigFileName = NULL |
| INT4 | outCompress = 0 |
| float | mwLuminosity = -1 |
| REAL4 | dmin = -1 |
| REAL4 | dmax = -1 |
| REAL4 | minMass1 = -1 |
| REAL4 | maxMass1 = -1 |
| REAL4 | minMass2 = -1 |
| REAL4 | maxMass2 = -1 |
| REAL4 | minMtotal = -1 |
| REAL4 | maxMtotal = -1 |
| REAL4 | meanMass1 = -1.0 |
| REAL4 | meanMass2 = -1.0 |
| REAL4 | massStdev1 = -1.0 |
| REAL4 | massStdev2 = -1.0 |
| REAL4 | minMassRatio = -1.0 |
| REAL4 | maxMassRatio = -1.0 |
| REAL4 | inclStd = -1.0 |
| REAL4 | fixed_inc = 0.0 |
| REAL4 | psi = 0.0 |
| REAL4 | longitude = 0.0 |
| REAL4 | latitude = 0.0 |
| int | spinInjections = -1 |
| REAL4 | minSpin1 = -1.0 |
| REAL4 | maxSpin1 = -1.0 |
| REAL4 | minSpin2 = -1.0 |
| REAL4 | maxSpin2 = -1.0 |
| REAL4 | minKappa1 = -1.0 |
| REAL4 | maxKappa1 = 1.0 |
| REAL4 | minabsKappa1 = 0.0 |
| REAL4 | maxabsKappa1 = 1.0 |
| INT4 | numExtTriggers = 0 |
| ExtTriggerTable * | exttrigHead = NULL |
| int | num_source |
| struct { | |
| char name [LIGOMETA_SOURCE_MAX] | |
| REAL8 ra | |
| REAL8 dec | |
| REAL8 dist | |
| REAL8 lum | |
| REAL8 fudge | |
| } | source_data |
| char | MW_name [LIGOMETA_SOURCE_MAX] = "MW" |
| REAL8 * | fracVec = NULL |
| REAL8 * | ratioVec = NULL |
| REAL8 | norm = 0 |
| int | num_mass |
| struct { | |
| REAL8 mass1 | |
| REAL8 mass2 | |
| } | mass_data |
| int | num_nr = 0 |
| int | i = 0 |
| SimInspiralTable ** | nrSimArray = NULL |
| #define ADD_PROCESS_PARAM | ( | pptype, | |||
| format, | |||||
| ppvalue | ) |
Value:
this_proc_param = this_proc_param->next = (ProcessParamsTable *) calloc( 1, sizeof(ProcessParamsTable) ); LALSnprintf( this_proc_param->program, LIGOMETA_PROGRAM_MAX, "%s", PROGRAM_NAME ); LALSnprintf( this_proc_param->param, LIGOMETA_PARAM_MAX, "--%s", long_options[option_index].name ); LALSnprintf( this_proc_param->type, LIGOMETA_TYPE_MAX, "%s", pptype ); LALSnprintf( this_proc_param->value, LIGOMETA_VALUE_MAX, format, ppvalue );
| RCSID | ( | "$Id: inspinj. | c, | |
| v 1.70 2008/07/25 16:26:14 ram Exp $" | ||||
| ) |
| ProcessParamsTable * next_process_param | ( | const char * | name, | |
| const char * | type, | |||
| const char * | fmt, | |||
| ... | ||||
| ) |
| void drawLocationFromExttrig | ( | SimInspiralTable * | table | ) |
| void drawMassFromSource | ( | SimInspiralTable * | table | ) |
| void drawMassSpinFromNR | ( | SimInspiralTable * | table | ) |
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
MAIN function of SideBandMCMC code Compute the posterior pdfs of the orbital and nuisance parameters of a binary signal in Fstat form.
..
variable declarations
the status must be initially blank; this can be done by making it static:
static LALStatus status;
other variables:
ExampleOutput output; ExampleInput input; ExampleParams params;
parse arguments, if desired
for example:
program = *argv; while ( --argc > 0 ) { ++argv; if ( ! strcmp( *argv, "-d" ) ) { --argc; ++argv; lalDebugLevel = atoi( *argv ); continue; } if ( ! strcmp( *argv, "-v" ) ) { verbose = 1; continue; } if ( ! strcmp( *argv, "-h" ) ) { fprintf( stderr, usage, program ); return 0; } fprintf( stderr, "no such option %s\n", *argv ); fprintf( stderr, usage, program ); return FAIL_ARGS; }
/** test response to invalid data
these tests must be wrapped so they are not done when debugging is disabled:
ifndef LAL_NDEBUG if ( ! lalNoDebug ) { LALExample( &status, NULL, &input, ¶ms ); if ( status.statusCode != EXAMPLEH_ENULL || strcmp( status.statusDescription, EXAMPLEH_MSGENULL ) ) { fprintf( stderr, "incorrect error code %d and message %s\n", status.statusCode, status.statusDescription ); fprintf( stderr, "expecting error code %d and message %s\n", EXAMPLEH_ENULL, EXAMPLEH_MSGENULL ); return FAIL_CODE; }
fputs( "PASS: Test response to invalid data\n", stderr ); } endif
test response to valid data
for example:
LALExample( &status, &output, &input, ¶m ); if ( status.statusCode ) { fprintf( stderr, "received error code %d and message %s\n", status.statusCode, status.statusDescription ); return FAIL_ESUB; }
(perform checks on the contents of output too!)
during default operation, output to the screen should be minimal:
for ( i = 0; i < 1048576; ++i ) printf( "%d\n", i ); !!! BAD !!!
but it is OK to indicate that tests have passed:
fputs( "PASS: Test response to valid data\n", stderr );
check for memory leaks and return success:
LALCheckMemoryLeaks(); fputs( "PASS: All tests\n" );
| char* massFileName = NULL |
| char* nrFileName = NULL |
| char* sourceFileName = NULL |
| char* outputFileName = NULL |
| char* exttrigFileName = NULL |
| INT4 outCompress = 0 |
| float mwLuminosity = -1 |
| REAL4 massStdev1 = -1.0 |
| REAL4 massStdev2 = -1.0 |
| REAL4 minMassRatio = -1.0 |
| REAL4 maxMassRatio = -1.0 |
| int spinInjections = -1 |
| REAL4 minabsKappa1 = 0.0 |
| REAL4 maxabsKappa1 = 1.0 |
| INT4 numExtTriggers = 0 |
| ExtTriggerTable* exttrigHead = NULL |
| int num_source |
| struct { ... } * source_data |
| struct { ... } * mass_data |
| SimInspiralTable** nrSimArray = NULL |
1.5.2