binj.c File Reference

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <unistd.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
#include <lal/Date.h>
#include <lal/GenerateBurst.h>
#include <lal/LALConstants.h>
#include <lal/LALSimBurst.h>
#include <lal/LALStdio.h>
#include <lal/LALStdlib.h>
#include <lal/LIGOLwXML.h>
#include <lal/LIGOMetadataTables.h>
#include <lal/LIGOMetadataUtils.h>
#include <lal/TimeDelay.h>
#include <lal/TimeSeries.h>
#include <lal/XLALError.h>
#include <lalapps.h>
#include <processtable.h>

Include dependency graph for binj.c:

Go to the source code of this file.

Data Structures

struct  options

Defines

#define CVS_REVISION   "$Revision: 1.71 $"
#define CVS_SOURCE   "$Source: /usr/local/cvs/lscsoft/lalapps/src/power/binj.c,v $"
#define CVS_DATE   "$Date: 2008/09/22 20:45:43 $"
#define PROGRAM_NAME   "lalapps_binj"
#define ADD_PROCESS_PARAM(process, type)   do { paramaddpoint = add_process_param(paramaddpoint, process, type, long_options[option_index].name, optarg); } while(0)

Enumerations

enum  population { POPULATION_TARGETED, POPULATION_ALL_SKY_SINEGAUSSIAN, POPULATION_STRING_CUSP }

Functions

int snprintf (char *str, size_t size, const char *format,...)
 RCSID ("$Id: binj.c,v 1.71 2008/09/22 20:45:43 kipp Exp $")
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.


Define Documentation

#define CVS_REVISION   "$Revision: 1.71 $"

Definition at line 68 of file binj.c.

#define CVS_SOURCE   "$Source: /usr/local/cvs/lscsoft/lalapps/src/power/binj.c,v $"

Definition at line 69 of file binj.c.

#define CVS_DATE   "$Date: 2008/09/22 20:45:43 $"

Definition at line 70 of file binj.c.

#define PROGRAM_NAME   "lalapps_binj"

Definition at line 71 of file binj.c.

#define ADD_PROCESS_PARAM ( process,
type   )     do { paramaddpoint = add_process_param(paramaddpoint, process, type, long_options[option_index].name, optarg); } while(0)

Definition at line 235 of file binj.c.


Enumeration Type Documentation

enum population

Enumerator:
POPULATION_TARGETED 
POPULATION_ALL_SKY_SINEGAUSSIAN 
POPULATION_STRING_CUSP 

Definition at line 83 of file binj.c.


Function Documentation

int snprintf ( char *  str,
size_t  size,
const char *  format,
  ... 
)

RCSID ( "$Id: binj.  c,
v 1.71 2008/09/22 20:45:43 kipp Exp $"   
)

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, &params ); 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, &param ); 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" );

Definition at line 863 of file binj.c.


Generated on Sat Oct 11 02:32:28 2008 for LAL by  doxygen 1.5.2