#include <ctype.h>#include <errno.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "getopt.h"#include <lal/LALStdlib.h>#include <lal/LALConstants.h>#include <lal/Date.h>#include "getdate.h"#include "lalapps.h"Include dependency graph for tconvert.c:

Go to the source code of this file.
Defines | |
| #define | _GNU_SOURCE |
| #define | MAX_DATE_STRING_LENGTH 256 |
| #define | LHO_LONGITUDE_RAD_E (LAL_PI*(-119.0+(24.0+27.5657/60.0)/60.0)/180.0) |
| #define | LLO_LONGITUDE_RAD_E (LAL_PI*(-90.0+(46.0+27.2654/60.0)/60.0)/180.0) |
| #define | MAX_ENV_SIZE 1024 |
Enumerations | |
| enum | { GPS_EPOCH, UNIX_EPOCH } |
| enum | { SIDEREAL_HMS, SIDEREAL_RAD } |
| enum | { OUTPUT_DEFAULT, OUTPUT_DATE, OUTPUT_SECS, OUTPUT_JD, OUTPUT_MJD, OUTPUT_LEAPS, OUTPUT_GMST } |
| enum | { SITE_UNSPECIFIED, SITE_LHO, SITE_LLO } |
Functions | |
| const char * | skip_space (const char *s) |
| void | output (int gps_sec, int output_type) |
| void | usage (const char *program, int exitcode) |
| char * | parse_options (char *buf, int buflen, int argc, char **argv) |
| int | unix_to_gps (time_t unix_sec) |
| time_t | gps_to_unix (int gps_sec, int *leap) |
| void | set_zone (const char *zone) |
| void | reset_zone (void) |
| void | set_zone_lho (void) |
| void | set_zone_llo (void) |
| 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. | |
| void | output_secs (int gps_sec) |
| void | output_date (int gps_sec) |
| void | output_date_utc (int gps_sec) |
| void | output_date_local (int gps_sec) |
| void | output_lho_date (int gps_sec) |
| void | output_llo_date (int gps_sec) |
| void | output_date_site (int gps_sec) |
| void | output_jd (int gps_sec) |
| void | output_mjd (int gps_sec) |
| void | output_leaps (int gps_sec) |
| void | output_sidereal_time (double sidereal_time_rad) |
| void | output_gmst (int gps_sec) |
| void | output_local_sidereal_time_lho (int gps_sec) |
| void | output_local_sidereal_time_llo (int gps_sec) |
| void | output_sidereal_time_site (int gps_sec) |
Variables | |
| const char * | rcsid = "$Id: tconvert.c,v 1.5 2007/06/08 15:29:50 bema Exp $" |
| const char * | iso_8601_format = "%Y-%m-%dT%H:%M:%S%z" |
| const char * | rfc_822_format = "%a, %d %b %Y %H:%M:%S %z" |
| const char * | unix_date_format = "%a %b %d %H:%M:%S %Z %Y" |
| const char * | output_date_format = NULL |
| const char * | tz = NULL |
| enum { ... } | epoch |
| enum { ... } | sidereal_format |
| enum { ... } | output_type |
| enum { ... } | site |
| int | utc_flag = 1 |
| int | verbose = 0 |
| FILE * | fp = NULL |
| int | lalDebugLevel = 7 |
| DECLARE AND SET GLOBAL DEBUG LEVEL. | |
| #define _GNU_SOURCE |
Definition at line 28 of file tconvert.c.
| #define MAX_DATE_STRING_LENGTH 256 |
Definition at line 37 of file tconvert.c.
| #define LHO_LONGITUDE_RAD_E (LAL_PI*(-119.0+(24.0+27.5657/60.0)/60.0)/180.0) |
Definition at line 40 of file tconvert.c.
| #define LLO_LONGITUDE_RAD_E (LAL_PI*(-90.0+(46.0+27.2654/60.0)/60.0)/180.0) |
Definition at line 41 of file tconvert.c.
| #define MAX_ENV_SIZE 1024 |
Definition at line 530 of file tconvert.c.
| anonymous enum |
| anonymous enum |
| anonymous enum |
Definition at line 90 of file tconvert.c.
| anonymous enum |
| const char* skip_space | ( | const char * | s | ) |
Definition at line 43 of file tconvert.c.
| void output | ( | int | gps_sec, | |
| int | output_type | |||
| ) |
| void usage | ( | const char * | program, | |
| int | exitcode | |||
| ) |
| char * parse_options | ( | char * | buf, | |
| int | buflen, | |||
| int | argc, | |||
| char ** | argv | |||
| ) |
Definition at line 703 of file tconvert.c.
| int unix_to_gps | ( | time_t | unix_sec | ) |
Definition at line 514 of file tconvert.c.
| time_t gps_to_unix | ( | int | gps_sec, | |
| int * | leap | |||
| ) |
Definition at line 489 of file tconvert.c.
| void set_zone | ( | const char * | zone | ) |
Definition at line 531 of file tconvert.c.
| void reset_zone | ( | void | ) |
Definition at line 592 of file tconvert.c.
| void set_zone_lho | ( | void | ) |
Definition at line 598 of file tconvert.c.
| void set_zone_llo | ( | void | ) |
Definition at line 604 of file tconvert.c.
| 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" );
Definition at line 100 of file tconvert.c.
| void output_secs | ( | int | gps_sec | ) |
Definition at line 186 of file tconvert.c.
| void output_date | ( | int | gps_sec | ) |
Definition at line 218 of file tconvert.c.
| void output_date_utc | ( | int | gps_sec | ) |
Definition at line 241 of file tconvert.c.
| void output_date_local | ( | int | gps_sec | ) |
Definition at line 252 of file tconvert.c.
| void output_lho_date | ( | int | gps_sec | ) |
Definition at line 263 of file tconvert.c.
| void output_llo_date | ( | int | gps_sec | ) |
Definition at line 272 of file tconvert.c.
| void output_date_site | ( | int | gps_sec | ) |
Definition at line 281 of file tconvert.c.
| void output_jd | ( | int | gps_sec | ) |
Definition at line 301 of file tconvert.c.
| void output_mjd | ( | int | gps_sec | ) |
Definition at line 313 of file tconvert.c.
| void output_leaps | ( | int | gps_sec | ) |
Definition at line 327 of file tconvert.c.
| void output_sidereal_time | ( | double | sidereal_time_rad | ) |
Definition at line 337 of file tconvert.c.
| void output_gmst | ( | int | gps_sec | ) |
Definition at line 369 of file tconvert.c.
| void output_local_sidereal_time_lho | ( | int | gps_sec | ) |
Definition at line 382 of file tconvert.c.
| void output_local_sidereal_time_llo | ( | int | gps_sec | ) |
Definition at line 395 of file tconvert.c.
| void output_sidereal_time_site | ( | int | gps_sec | ) |
Definition at line 408 of file tconvert.c.
| const char* rcsid = "$Id: tconvert.c,v 1.5 2007/06/08 15:29:50 bema Exp $" |
Definition at line 69 of file tconvert.c.
| const char* iso_8601_format = "%Y-%m-%dT%H:%M:%S%z" |
Definition at line 82 of file tconvert.c.
| const char* rfc_822_format = "%a, %d %b %Y %H:%M:%S %z" |
Definition at line 83 of file tconvert.c.
| const char* unix_date_format = "%a %b %d %H:%M:%S %Z %Y" |
Definition at line 84 of file tconvert.c.
| const char* output_date_format = NULL |
Definition at line 85 of file tconvert.c.
| const char* tz = NULL |
Definition at line 86 of file tconvert.c.
| enum { ... } epoch |
| enum { ... } sidereal_format |
| enum { ... } output_type |
| enum { ... } site |
| int utc_flag = 1 |
Definition at line 92 of file tconvert.c.
| int verbose = 0 |
Definition at line 94 of file tconvert.c.
| FILE* fp = NULL |
Definition at line 96 of file tconvert.c.
| int lalDebugLevel = 7 |
DECLARE AND SET GLOBAL DEBUG LEVEL.
see the section (currently 7.4.1) of the LSD on "Status-reporting objects" for a list of predefined debug levels
Definition at line 98 of file tconvert.c.
1.5.2