309#include <sys/types.h>
318#ifdef LALAPPS_CUDA_ENABLED
319#include <cuda_runtime_api.h>
322#include <lal/LALConfig.h>
323#include <lal/LALgetopt.h>
324#include <lal/LALStdio.h>
325#include <lal/LALStdlib.h>
326#include <lal/LALError.h>
327#include <lal/LALDatatypes.h>
328#include <lal/AVFactories.h>
329#include <lal/LALConstants.h>
330#include <lal/PrintFTSeries.h>
331#include <lal/LALFrStream.h>
332#include <lal/Window.h>
333#include <lal/TimeFreqFFT.h>
334#include <lal/IIRFilter.h>
335#include <lal/ResampleTimeSeries.h>
336#include <lal/BandPassTimeSeries.h>
337#include <lal/LIGOLwXML.h>
338#include <lal/LIGOLwXMLRead.h>
339#include <lal/LIGOMetadataTables.h>
340#include <lal/LIGOMetadataUtils.h>
341#include <lal/LIGOMetadataInspiralUtils.h>
343#include <lal/Units.h>
344#include <lal/LALInspiral.h>
345#include <lal/LALInspiralBank.h>
346#include <lal/LALSimNoise.h>
352#define CVS_ID_STRING "$Id$"
353#define CVS_NAME_STRING "$Name$"
354#define CVS_REVISION "$Revision$"
355#define CVS_SOURCE "$Source$"
356#define CVS_DATE "$Date$"
357#define PROGRAM_NAME "tmpltbank"
478int main (
int argc,
char *argv[] )
490 struct FrFile *frOutFile = NULL;
491 struct FrameH *outFrame = NULL;
517 const LALUnit strainPerCount = {0,{0,0,0,0,0,1,-1},{0,0,0,0,0,0,0}};
519 REAL8 respRe, respIm;
522 UINT4 numInputPoints;
524 UINT4 resampleChan = 0;
585 fprintf( stdout,
"We are doing a TD follow-up\n" );
592 if ( !*thisTdFollow )
598 while ( (*thisTdFollow)->next )
600 thisTdFollow = &(*thisTdFollow)->
next;
610 if ( !tdFollowUp )
goto cleanExit;
655 CHAR ifoRegExPattern[6];
657 if (
vrbflg )
fprintf( stdout,
"globbing for *.gwf frame files from %c "
666 if ( ! frGlobCache->
length )
668 fprintf( stderr,
"error: no frame files of type %s found\n",
674 snprintf( ifoRegExPattern,
681 if ( ! frInCache->
length )
683 fprintf( stderr,
"error: no frame files of type %s globbed as input\n",
693 "reading frame file locations from cache file: %s\n",
frInCacheName );
722 chan.
f0 = strainChan.
f0;
735 fprintf( stdout,
"resampleParams.deltaT = %e\n", resampleParams.
deltaT );
742 fprintf( stdout,
"input channel will be resampled\n" );
768 if (
vrbflg )
fprintf( stdout,
"input channel %s has sample interval "
769 "(deltaT) = %e\nreading %d points from frame stream\n",
fqChanName,
770 chan.
deltaT / 1.0e9, numInputPoints );
779 if (
vrbflg )
fprintf( stdout,
"reading REAL8 h(t) data from frames... " );
788 strainHighpassParam.
f1 = -1.0;
790 strainHighpassParam.
a1 = -1.0;
793 "applying %d order high pass to REAL8 h(t) data: "
794 "%3.2f of signal passes at %4.2f Hz\n",
795 strainHighpassParam.
nMax, strainHighpassParam.
a2,
796 strainHighpassParam.
f2 );
799 &strainHighpassParam ), &
status );
803 for (
j = 0 ;
j < numInputPoints ; ++
j )
812 chan.
f0 = strainChan.
f0;
817 strainChan.
data = NULL;
828 for (
j = 0 ;
j < numInputPoints ; ++
j )
852 &chan,
"ct",
"RAW" );
854 if (
vrbflg )
fprintf( stdout,
"read channel %s from frame stream\n"
855 "got %d points with deltaT %e\nstarting at GPS time %d sec %d ns\n",
862 if (
vrbflg)
fprintf( stdout,
"resampling input data from %e to %e\n",
869 "%d points with deltaT %e\nstarting at GPS time %d sec %d ns\n",
875 &chan,
"ct",
"RAW_RESAMP" );
901 highpassParam.
f1 = -1.0;
903 highpassParam.
a1 = -1.0;
906 if (
vrbflg )
fprintf( stdout,
"applying %d order high pass: "
907 "%3.2f of signal passes at %4.2f Hz\n",
908 highpassParam.
nMax, highpassParam.
a2, highpassParam.
f2 );
922 if (
vrbflg )
fprintf( stdout,
"after removal of %d second padding at "
923 "start and end:\ndata channel sample interval (deltaT) = %e\n"
924 "data channel length = %d\nstarting at %d sec %d ns\n",
953 fprintf( stderr,
"This should never happen! Exiting..." );
989 &spec,
"ct/sqrtHz",
"PSD" );
1001 if (
vrbflg )
fprintf( stdout,
"generating unity response function\n" );
1009 fprintf( stderr,
"uncalibrated data no longer supported" );
1018 &resp,
"strain/ct",
"RESPONSE" );
1041 for (
k = 1;
k < cut ; ++
k )
1050 ( respRe * respRe + respIm * respIm );
1059 &(bankIn.
shf),
"strain/sqrtHz",
"STRAIN_PSD" );
1061 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK-%d-%d.strainspec.txt",
1078 if (
vrbflg )
fprintf( stdout,
"maximum distance for (%3.2f,%3.2f) "
1152 fprintf( stdout,
"generating template bank parameters... " );
1176 fprintf( stdout,
"done. Got %d templates\n", numCoarse );
1182 templateBank = tmplt;
1187 while( (tmplt = tmplt->
next) )
1222 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK-%d-%d.gwf",
1225 frOutFile = FrFileONew(
fname, 0 );
1226 FrameWrite( outFrame, frOutFile );
1227 FrFileOEnd( frOutFile );
1234 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK_%s_%s-%d-%d.xml",
1240 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK_%s-%d-%d.xml",
1246 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK_%s-%d-%d.xml",
1252 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK_%s_%s-%d-%d.xml.gz",
1258 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK_%s-%d-%d.xml.gz",
1264 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK_%s-%d-%d.xml.gz",
1270 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK-%d-%d.xml.gz",
1276 snprintf(
fname,
sizeof(
fname),
"%s-TMPLTBANK-%d-%d.xml",
1291 procparams = procparams->
next;
1292 free( emptyPPtable );
1305 while ( templateBank )
1307 tmplt = templateBank;
1308 templateBank = templateBank->
next;
1324#ifdef LALAPPS_CUDA_ENABLED
1333#define ADD_PROCESS_PARAM( pptype, format, ppvalue ) \
1334this_proc_param = this_proc_param->next = (ProcessParamsTable *) \
1335 calloc( 1, sizeof(ProcessParamsTable) );\
1336 snprintf( this_proc_param->program, LIGOMETA_PROGRAM_MAX, "%s", \
1338 snprintf( this_proc_param->param, LIGOMETA_PARAM_MAX, "--%s", \
1339 long_options[option_index].name );\
1340 snprintf( this_proc_param->type, LIGOMETA_TYPE_MAX, "%s", pptype );\
1341 snprintf( this_proc_param->value, LIGOMETA_VALUE_MAX, format, ppvalue );
1344fprintf(a, " --help display this message\n");\
1345fprintf(a, " --verbose print progress information\n");\
1346fprintf(a, " --version print version information and exit\n");\
1347fprintf(a, " --user-tag STRING set the process_params usertag to STRING\n");\
1348fprintf(a, " --ifo-tag STRING set the ifotag to STRING - for file naming\n");\
1349fprintf(a, " --comment STRING set the process table comment to STRING\n");\
1350fprintf(a, " --write-compress write a compressed xml file\n");\
1352fprintf(a, " NOTE: Data-related options not required when using a simulated PSD are labelled @\n");\
1354fprintf(a, " --gps-start-time SEC GPS second of data start time\n");\
1355fprintf(a, " --gps-end-time SEC GPS second of data end time\n");\
1356fprintf(a, "@ --pad-data T pad the data start and end time by T seconds\n");\
1358fprintf(a, "@ --glob-frame-data glob *.gwf files in the pwd to obtain frame data\n");\
1359fprintf(a, "@ --frame-type TAG input data is contained in frames of type TAG\n");\
1360fprintf(a, "@ --frame-cache obtain frame data from LAL frame cache FILE\n");\
1361fprintf(a, "@ --calibration-cache FILE obtain calibration from LAL frame cache FILE\n");\
1362fprintf(a, "@ --glob-calibration-data obtain calibration by globbing in working dir\n");\
1364fprintf(a, "@ --channel-name CHAN read data from interferometer channel CHAN\n");\
1365fprintf(a, "@ --calibrated-data TYPE calibrated data of TYPE real_4 or real_8\n");\
1366fprintf(a, "@ --strain-high-pass-freq F high pass REAL8 h(t) data above F Hz\n");\
1367fprintf(a, "@ --strain-high-pass-order O set the order of the h(t) high pass filter to O\n");\
1368fprintf(a, "@ --strain-high-pass-atten A set the attenuation of the high pass filter to A\n");\
1369fprintf(a, "@ --point-calibration use the first point in the chunk to calibrate\n");\
1371fprintf(a, " --sample-rate F filter data at F Hz, downsampling if necessary\n");\
1372fprintf(a, "@ --resample-filter TYPE set resample filter to TYPE [ldas|butterworth]\n");\
1374fprintf(a, " --disable-high-pass turn off the IIR highpass filter\n");\
1375fprintf(a, "@ --enable-high-pass F high pass data above F Hz using an IIR filter\n");\
1376fprintf(a, "@ --high-pass-order O set the order of the high pass filter to O\n");\
1377fprintf(a, "@ --high-pass-attenuation A set the attenuation of the high pass filter to A\n");\
1378fprintf(a, " --spectrum-type TYPE use PSD estimator TYPE \n");\
1379fprintf(a, " (mean|median|iLIGOSRD|eLIGOModel|GEOModel|\n");\
1380fprintf(a, " |aLIGONoSRMLoP|aLIGONoSRMHiP|aLIGOZDLoP|aLIGOZDHiP|\n");\
1381fprintf(a, " |iVirgoModel|aVirgoModel|KAGRAModel)\n");\
1382fprintf(a, " --dynamic-range-exponent X set dynamic range scaling to 2^X (eg X=69.0)\n");\
1384fprintf(a, " --segment-length N set data segment length to N points\n");\
1385fprintf(a, "@ --number-of-segments N set number of data segments to N\n");\
1387fprintf(a, " --td-follow-up FILE follow up BCV events contained in FILE\n");\
1389fprintf(a, " --standard-candle compute a standard candle from the PSD\n");\
1390fprintf(a, " --candle-snr SNR signal-to-noise ratio of standard candle\n");\
1391fprintf(a, " --candle-minmass M minimum component mass for (equal-mass) candle binary\n");\
1392fprintf(a, " --candle-maxmass M maximum component mass for candle binary, default=50\n");\
1394fprintf(a, " --low-frequency-cutoff F do not filter below F Hz\n");\
1395fprintf(a, " --high-frequency-cutoff F upper frequency cutoff in Hz\n");\
1396fprintf(a, " --disable-compute-moments do not recompute the moments stored in the template bank. \n");\
1398fprintf(a, " --minimum-mass MASS set minimum component mass of bank to MASS: required\n");\
1399fprintf(a, " --maximum-mass MASS set maximum component mass of bank to MASS\n");\
1400fprintf(a, " --max-total-mass MASS set maximum total mass of the bank to MASS. Will override --maximum-mass option\n");\
1401fprintf(a, " --min-total-mass MASS set minimum total mass of the bank to MASS: --max-total-mass must also be given\n");\
1402fprintf(a, " --chirp-mass-cutoff MASS set chirp mass cutoff to MASS\n");\
1403fprintf(a, " --max-eta ETA set maximum symmetric mass ratio of the bank to ETA\n");\
1404fprintf(a, " --min-eta ETA set minimum symmetric mass ratio of the bank to ETA\n");\
1406fprintf(a, " --minimum-psi0 PSI0 set minimum range of BCV parameter psi0 to PSI0\n");\
1407fprintf(a, " --maximum-psi0 PSI0 set maximum range of BCV parameter psi0 to PSI0\n");\
1408fprintf(a, " --minimum-psi3 PSI3 set minimum range of BCV parameter psi3 to PSI3\n");\
1409fprintf(a, " --maximum-psi3 PSI3 set maximum range of BCV parameter psi3 to PSI3\n");\
1410fprintf(a, " --maximum-fcut-tmplts N maximum number of tmplts in fcut direction is N\n");\
1411fprintf(a, " --disable-polygon-fit disable the polygon fitting for BCV bank\n");\
1412fprintf(a, " --alpha ALPHA set alpha for the BCV bank generation\n");\
1413fprintf(a, " --minimum-beta BETA set minimum BCV spin parameter beta to BETA\n");\
1414fprintf(a, " --maximum-beta BETA set maximum BCV spin parameter beta to BETA\n");\
1416fprintf(a, " --minimum-spin1 SPIN1_MIN set minimum value of chi for PTF to SPIN1_MIN (0.0)\n");\
1417fprintf(a, " --maximum-spin1 SPIN1_MAX set maximum value of chi for PTF to SPIN1_MAX (1.0)\n");\
1418fprintf(a, " --minimum-kappa1 KAPPA1_MIN set minimum value of kappa for PTF to KAPPA1_MIN (-1.0)\n");\
1419fprintf(a, " --maximum-kappa1 KAPPA1_MAX set maximum value of kappa for PTF to KAPPA1_MAX (1.0)\n");\
1420fprintf(a, " --npoints-chi N-CHI set number of points in the Chi direction for PTF template bank to N-CHI (3)\n");\
1421fprintf(a, " --npoints-kappa N-KAPPA set number of points in the Kappa direction for PTF template bank to N-KAPPA (5)\n");\
1423fprintf(a, " --minimal-match M generate bank with minimal match M\n");\
1425fprintf(a, " --order ORDER set post-Newtonian order of the waveform to ORDER\n");\
1426fprintf(a, " (newtonian|oneHalfPN|onePN|onePointFivePN|\n");\
1427fprintf(a, " twoPN|twoPointFive|threePN|threePointFivePN)\n");\
1428fprintf(a, " --approximant APPROX set approximant of the waveform to APPROX\n");\
1429fprintf(a, " (TaylorT1|TaylorT2|TaylorT3|TaylorF1|TaylorF2|\n");\
1430fprintf(a, " PadeT1|PadeT2|EOB|EOBNR|BCV|SpinTaylorT3|BCVSpin)\n");\
1431fprintf(a, " --num-freq-cutoffs Ncut create a template bank with Ncut different upper \n");\
1432fprintf(a, " frequency cutoffs (must be a positive integer) \n");\
1433fprintf(a, " --max-high-freq-cutoff MAX formula to compute the largest high freq. cutoff\n");\
1434fprintf(a, " possible choices in ascending order: (SchwarzISCO|BKLISCO|LightRing|FRD|ERD|LRD)\n");\
1435fprintf(a, " --min-high-freq-cutoff MIN formula to compute the smallest high freq. cutoff\n");\
1436fprintf(a, " possible choices in ascending order: (SchwarzISCO|BKLISCO|LightRing|FRD|ERD|LRD)\n");\
1437fprintf(a, " --space SPACE grid up template bank with mass parameters SPACE\n");\
1438fprintf(a, " (Tau0Tau2|Tau0Tau3|Psi0Psi3)\n");\
1439fprintf(a, " --grid-spacing GRIDSPACING grid up template bank with GRIDSPACING\n");\
1440fprintf(a, " (Hexagonal|SquareNotOriented)\n");\
1442fprintf(a, " --write-response write the computed response function to a frame\n");\
1443fprintf(a, " --write-spectrum write the uncalibrated psd to a frame\n");\
1444fprintf(a, " --write-strain-spectrum write the calibrated strain psd to a text file\n");
1467#ifdef LALAPPS_CUDA_ENABLED
1538#ifdef LALAPPS_CUDA_ENABLED
1539 INT4 gpuDeviceID = 0;
1540 cudaError_t cudaError = cudaSuccess;
1543 UINT4 haveOrder = 0;
1544 UINT4 haveApprox = 0;
1545 UINT4 haveSpace = 0;
1546 UINT4 havePsi0Min = 0;
1547 UINT4 havePsi0Max = 0;
1548 UINT4 havePsi3Min = 0;
1549 UINT4 havePsi3Max = 0;
1550 UINT4 haveAlpha = 0;
1551 UINT4 haveNumFcut = 0;
1552 UINT4 haveMaxFcut = 0;
1553 UINT4 haveMinFcut = 0;
1564 int option_index = 0;
1565 size_t LALoptarg_len;
1568#ifdef LALAPPS_CUDA_ENABLED
1569 "a:b:c:d:e:f:g:hi:j:k:l:m:n:o:p:r:s:t:u:v:x:yX:0:"
1570 "A:B:C:D:E:F:G:H:I:J:K:L:M:O:P:Q:R:S:T:U:VZ:1:2:3:4:5:6:7:8:9:+:",
1572 "a:b:c:d:e:f:g:hi:j:k:l:m:n:o:p:r:s:t:u:v:x:yX:0:"
1573 "A:B:C:D:E:F:G:H:I:J:K:L:M:O:P:Q:R:S:T:U:VZ:1:2:3:4:5:6:7:8:9:",
1575 long_options, &option_index );
1587 if ( long_options[option_index].
flag != 0 )
1593 fprintf( stderr,
"error parsing option %s with argument %s\n",
1602 if ( gstartt < 441417609 )
1604 fprintf( stderr,
"invalid argument to --%s:\n"
1605 "GPS start time is prior to "
1606 "Jan 01, 1994 00:00:00 UTC:\n"
1607 "(%ld specified)\n",
1608 long_options[option_index].
name, gstartt );
1620 if ( gendt < 441417609 )
1622 fprintf( stderr,
"invalid argument to --%s:\n"
1623 "GPS end time is prior to "
1624 "Jan 01, 1994 00:00:00 UTC:\n"
1625 "(%ld specified)\n",
1626 long_options[option_index].
name, gendt );
1638 char *channamptr = NULL;
1639 LALoptarg_len = strlen(
LALoptarg ) + 1;
1645 if ( ! (channamptr = strstr(
fqChanName,
":" ) ) )
1647 fprintf( stderr,
"invalid argument to --%s:\n"
1648 "channel name must be a full LIGO channel name "
1649 "e.g. L1:LSC-AS_Q\n(%s specified)\n",
1653 LALoptarg_len = strlen( ++channamptr ) + 1;
1658 memset(
ifo, 0,
sizeof(
ifo) );
1667 fprintf( stderr,
"invalid argument to --%s:\n"
1668 "number of points must be a non-zero power of 2: "
1669 "(%d specified) \n",
1680 fprintf( stderr,
"invalid argument to --%s:\n"
1681 "number of data segment must be greater than 0: "
1691 if ( sampleRate < 2 || sampleRate > 16384 ||
sampleRate % 2 )
1693 fprintf( stderr,
"invalid argument to --%s:\n"
1694 "rate must be power of 2 between 2 and 16384 inclusive: "
1702#ifdef LALAPPS_CUDA_ENABLED
1705 cudaError = cudaSetDevice( gpuDeviceID );
1706 if ( cudaError != cudaSuccess )
1708 fprintf( stderr,
"invalid argument to --%s:\n"
1709 "could not associate thread to GPU %d\n"
1711 long_options[option_index].
name, gpuDeviceID,
1712 cudaGetErrorString(cudaError));
1726 else if ( ! strcmp(
"real_8",
LALoptarg ) )
1732 fprintf( stderr,
"invalid argument to --%s:\n"
1733 "unknown data type specified;\n"
1734 "%s (must be one of: real_4, real_8)\n",
1745 fprintf( stderr,
"invalid argument to --%s:\n"
1746 "REAL8 h(t) high pass filter frequency must be greater than 0 Hz:"
1747 "(%f Hz specified)\n",
1758 fprintf( stderr,
"invalid argument to --%s:\n"
1759 "REAL8 h(t) high pass filter order must be greater than 0: "
1769 if ( strainHighPassAtten < 0.0 || strainHighPassAtten > 1.0 )
1771 fprintf( stderr,
"invalid argument to --%s:\n"
1772 "REAL8 h(t) high pass attenuation must be in the range [0:1]: "
1789 fprintf( stdout,
"invalid argument to --%s:\n"
1790 "low frequency cutoff is less than 0 Hz: "
1791 "(%f Hz specified)\n",
1792 long_options[option_index].
name,
fLow );
1803 else if ( ! strcmp(
"median",
LALoptarg ) )
1807 else if ( ! strcmp(
"iLIGOSRD",
LALoptarg ) )
1810 else if ( ! strcmp(
"eLIGOModel",
LALoptarg ) )
1813 else if ( ! strcmp(
"GEOModel",
LALoptarg ) )
1816 else if ( ! strcmp(
"aLIGONoSRMLoP",
LALoptarg ) )
1819 else if ( ! strcmp(
"aLIGONoSRMHiP",
LALoptarg ) )
1822 else if ( ! strcmp(
"aLIGOZDLoP",
LALoptarg ) )
1825 else if ( ! strcmp(
"aLIGOZDHiP",
LALoptarg ) )
1828 else if ( ! strcmp(
"iVirgoModel",
LALoptarg ) )
1831 else if ( ! strcmp(
"aVirgoModel",
LALoptarg ) )
1834 else if ( ! strcmp(
"KAGRAModel",
LALoptarg ) )
1840 fprintf( stderr,
"invalid argument to --%s:\n"
1841 "unknown power spectrum type: %s\n",
1855 LALoptarg_len = strlen(
LALoptarg ) + 1;
1866 else if ( ! strcmp(
"butterworth",
LALoptarg ) )
1872 fprintf( stderr,
"invalid argument to --%s:\n"
1873 "unknown resampling filter type: "
1874 "%s (must be ldas or butterworth)\n",
1884 fprintf( stderr,
"invalid argument to --%s:\n"
1885 "comment must be less than %d characters\n",
1900 fprintf( stdout,
"invalid argument to --%s:\n"
1901 "low frequency cutoff is less than 0 Hz: "
1902 "(%f Hz specified)\n",
1913 fprintf( stdout,
"invalid argument to --%s:\n"
1914 "high pass filter order must be greater than 0: "
1924 if ( highPassAtten < 0.0 || highPassAtten > 1.0 )
1926 fprintf( stdout,
"invalid argument to --%s:\n"
1927 "high pass attenuation must be in the range [0:1]: "
1936 LALoptarg_len = strlen(
LALoptarg ) + 1;
1943 LALoptarg_len = strlen(
LALoptarg ) + 1;
1953 fprintf( stderr,
"invalid argument to --%s:\n"
1954 "number of seconds to pad from input data"
1955 "must be greater than 0: (%d specified)\n",
1964 LALoptarg_len = strlen(
LALoptarg ) + 1;
1982 fprintf( stdout,
"invalid argument to --%s:\n"
1983 "minimum component mass must be > 0: "
1984 "(%f solar masses specified)\n",
1995 fprintf( stdout,
"invalid argument to --%s:\n"
1996 "maximum component mass must be > 0: "
1997 "(%f solar masses specified)\n",
2008 fprintf( stdout,
"invalid argument to --%s:\n"
2009 "minimum value of psi0 must be > 0: "
2022 fprintf( stdout,
"invalid argument to --%s:\n"
2023 "maximum value of psi0 must be > 0: "
2036 fprintf( stdout,
"invalid argument to --%s:\n"
2037 "miniumum value of psi3 must be < 0: "
2066 fprintf( stdout,
"invalid argument to --%s:\n"
2067 "number of templates in f_final direction must be >= 0"
2077 if ( alpha < -1 || alpha > 1 )
2079 fprintf( stdout,
"invalid argument to --%s:\n"
2080 "value of alpha must be the range [0:1]"
2082 long_options[option_index].
name,
alpha );
2093 fprintf( stdout,
"invalid argument to --%s:\n"
2094 "minimum match of bank must be > 0: "
2106 fprintf( stdout,
"invalid argument to --%s:\n"
2107 "miniumu component mass must be > 0: "
2116 if ( ! strcmp(
"newtonian",
LALoptarg ) )
2120 else if ( ! strcmp(
"oneHalfPN",
LALoptarg ) )
2124 else if ( ! strcmp(
"onePN",
LALoptarg ) )
2128 else if ( ! strcmp(
"onePointFivePN",
LALoptarg ) )
2132 else if ( ! strcmp(
"twoPN",
LALoptarg ) )
2136 else if ( ! strcmp(
"twoPointFive",
LALoptarg ) )
2140 else if ( ! strcmp(
"threePN",
LALoptarg ) )
2144 else if ( ! strcmp(
"threePointFivePN",
LALoptarg ) )
2150 fprintf( stderr,
"invalid argument to --%s:\n"
2151 "unknown order specified: "
2152 "%s (must be one of: newtonian, oneHalfPN, onePN,\n"
2153 "onePointFivePN, twoPN, twoPointFivePN, threePN or\n"
2154 "threePointFivePN)\n",
2163 if ( ! strcmp(
"TaylorT1",
LALoptarg ) )
2167 else if ( ! strcmp(
"TaylorT2",
LALoptarg ) )
2171 else if ( ! strcmp(
"TaylorT3",
LALoptarg ) )
2175 else if ( ! strcmp(
"TaylorF1",
LALoptarg ) )
2179 else if ( ! strcmp(
"TaylorF2",
LALoptarg ) )
2183 else if ( ! strcmp(
"PadeT1",
LALoptarg ) )
2187 else if ( ! strcmp(
"PadeF1",
LALoptarg ) )
2191 else if ( ! strcmp(
"EOB",
LALoptarg ) )
2195 else if ( ! strcmp(
"EOBNR",
LALoptarg ) )
2199 else if ( ! strcmp(
"EOBNRv2",
LALoptarg ) )
2203 else if ( ! strcmp(
"IMRPhenomA",
LALoptarg ) )
2207 else if ( ! strcmp(
"IMRPhenomB",
LALoptarg ) )
2211 else if ( ! strcmp(
"BCV",
LALoptarg ) )
2215 else if ( ! strcmp(
"SpinTaylorT3",
LALoptarg ) )
2219 else if ( ! strcmp(
"BCVSpin",
LALoptarg ) )
2223 else if ( ! strcmp(
"FindChirpPTF",
LALoptarg ) )
2229 fprintf( stderr,
"invalid argument to --%s:\n"
2230 "unknown order specified: "
2231 "%s (must be one of: TaylorT1, TaylorT2, TaylorT3, TaylorF1,\n"
2232 "TaylorF2, PadeT1, PadeF1, EOB, EOBNR, EOBNRv2, IMRPhenomA,\n"
2233 "IMRPhenomB, BCV, SpinTaylorT3, BCVSpin\n"
2234 "or FindChirpPTF)\n", long_options[option_index].
name,
LALoptarg );
2242 if ( ! strcmp(
"Tau0Tau2",
LALoptarg ) )
2246 else if ( ! strcmp(
"Tau0Tau3",
LALoptarg ) )
2250 else if ( ! strcmp(
"Psi0Psi3",
LALoptarg ) )
2256 fprintf( stderr,
"invalid argument to --%s:\n"
2257 "unknown space specified: "
2258 "%s (must be one of: Tau0Tau2, Tau0Tau3 or Psi0Psi3)\n",
2267 if ( ! strcmp(
"Hexagonal",
LALoptarg) )
2272 else if ( ! strcmp(
"SquareNotOriented",
LALoptarg) )
2279 fprintf(stderr,
"invalid argument to --%s:\n"
2280 "unknown grid spacing specified: "
2281 "%s (must be one of Hexagonal, SquareNotOriented )\n",
2292 fprintf( stdout,
"invalid argument to --%s:\n"
2293 "maximum total mass must be > 0: "
2294 "(%f solar masses specified)\n",
2305 fprintf( stdout,
"invalid argument to --%s:\n"
2306 "minimum total mass must be > 0: "
2307 "(%f solar masses specified)\n",
2318 fprintf( stdout,
"invalid argument to --%s:\n"
2319 "chirp mass cutoff must be > 0: "
2320 "(%f solar masses specified)\n",
2329 if ( etaMinCutoff < 0 || etaMinCutoff >= 0.25 )
2331 fprintf( stdout,
"invalid argument to --%s:\n"
2332 "minimum eta must be >= 0 and < 0.25: "
2342 if ( etaMaxCutoff <= 0 || etaMaxCutoff > 0.25 )
2344 fprintf( stdout,
"invalid argument to --%s:\n"
2345 "maximum eta must be > 0 and <= 0.25: "
2357 fprintf( stdout,
"invalid argument to --%s:\n"
2358 "standard candle signal-to-noise ratio must be > 0: "
2370 fprintf( stdout,
"invalid argument to --%s:\n"
2371 "standard candle minimum component mass must be > 0: "
2383 fprintf( stdout,
"invalid argument to --%s:\n"
2384 "standard candle maximum component mass must be > 0 and greater than min mass: "
2395 while ( !strstr( argv[
LALoptind],
"--" ) )
2406 while ( !strstr( argv[
LALoptind],
"--" ) )
2417 LALoptarg_len = strlen(
LALoptarg ) + 1;
2425 fprintf( stdout,
"LIGO/LSC Standalone Inspiral Template Bank Code\n"
2426 "Duncan Brown <duncan@gravity.phys.uwm.edu>\n");
2440 fprintf( stdout,
"invalid argument to --%s:\n"
2441 "Value must be a positive integer "
2451 if ( ! strcmp(
"SchwarzISCO",
LALoptarg ) )
2455 else if( ! strcmp(
"BKLISCO",
LALoptarg ) )
2459 else if ( ! strcmp(
"LightRing",
LALoptarg ) )
2463 else if ( ! strcmp(
"FRD",
LALoptarg ) )
2467 else if ( ! strcmp(
"ERD",
LALoptarg ) )
2471 else if ( ! strcmp(
"LRD",
LALoptarg ) )
2477 fprintf( stderr,
"invalid argument to --%s:\n"
2478 "unknown cutoff frequency specified: "
2479 "%s (must be one of: SchwarzISCO, BKLISCO, LightRing, FRD, ERD or LRD)\n",
2488 if ( ! strcmp(
"SchwarzISCO",
LALoptarg ) )
2492 else if ( ! strcmp(
"BKLISCO",
LALoptarg ) )
2496 else if ( ! strcmp(
"LightRing",
LALoptarg ) )
2500 else if ( ! strcmp(
"FRD",
LALoptarg ) )
2504 else if ( ! strcmp(
"ERD",
LALoptarg ) )
2508 else if ( ! strcmp(
"LRD",
LALoptarg ) )
2514 fprintf( stderr,
"invalid argument to --%s:\n"
2515 "unknown cutoff frequency specified: "
2516 "%s (must be one of: SchwarzISCO, BKLISCO, LightRing, FRD, ERD, or LRD)\n",
2528 fprintf( stdout,
"invalid argument to --%s:\n"
2529 "Spin magnitude can only take values between 0 and 1. : "
2541 fprintf( stdout,
"invalid argument to --%s:\n"
2542 "Spin magnitude can only take values between 0 and 1. : "
2554 fprintf( stdout,
"invalid argument to --%s:\n"
2555 "Kappa can only take values between -1. and 1. : "
2567 fprintf( stdout,
"invalid argument to --%s:\n"
2568 "Kappa can only take values between -1. and 1. : "
2580 fprintf( stdout,
"invalid argument to --%s:\n"
2581 "Number of points in the Chi direction must be greater than 0 : "
2593 fprintf( stdout,
"invalid argument to --%s:\n"
2594 "Number of points in the Kappa direction must be greater than 0 : "
2603 fprintf( stderr,
"unknown error while parsing options\n" );
2614 fprintf( stderr,
"extraneous command line arguments:\n" );
2641 "--write-compress" );
2652 "--disable-compute-moments" );
2663 "--disable-polygon-fit" );
2674 "--glob-frame-data" );
2685 "--glob-calibration-data" );
2696 "--point-calibration" );
2713 fprintf( stderr,
"--ifo-tag must be specified if using a simulated PSD\n" );
2718 memset(
ifo, 0,
sizeof(
ifo) );
2726 fprintf( stderr,
"--gps-start-time must be specified\n" );
2731 fprintf( stderr,
"--gps-end-time must be specified\n" );
2736 fprintf( stderr,
"invalid gps time range: "
2737 "start time: %d, end time %d\n",
2745 fprintf( stderr,
"--segment-length must be specified\n" );
2750 fprintf( stderr,
"--number-of-segments must be specified if using frama data\n" );
2757 fprintf( stderr,
"--sample-rate must be specified\n" );
2764 fprintf( stderr,
"--disable-high-pass or --enable-high-pass (freq)"
2765 " must be specified\n" );
2775 "--disable-high-pass" );
2784 fprintf( stderr,
"--high-pass-order must be specified\n" );
2789 fprintf( stderr,
"--high-pass-attenuation must be specified\n" );
2800 "--strain-high-pass-freq must be specified for REAL8 h(t) data\n" );
2806 "--strain-high-pass-order must be specified for REAL8 h(t) data\n");
2812 "--strain-high-pass-atten must be specified for REAL8 h(t) data\n");
2828 if ( inputDataLengthNS != gpsChanIntervalNS )
2830 fprintf( stderr,
"length of input data and data chunk do not match\n" );
2831 fprintf( stderr,
"start time: %d, end time %d\n",
2835 gpsChanIntervalNS, inputDataLengthNS );
2849 "--standard-candle" );
2856 "--candle-snr must be specified if --standard-candle is given\n" );
2862 "--candle-minmass must be specified if --standard-candle is given\n" );
2868 "--candle-maxmass must be specified if --standard-candle is given\n" );
2874 "--num-points must be specified if --standard-candle is given\n"
2875 "when using a simulated PSD\n" );
2883 fprintf( stderr,
"--low-frequency-cutoff must be specified\n" );
2888 fprintf( stderr,
"--resample-filter must be specified for frame data\n" );
2893 fprintf( stderr,
"--spectrum-type must be specified\n" );
2900 fprintf( stderr,
"If using a simulated PSD, a suitable dynamic \n"
2901 "range exponent must be given, eg 69.0. Exiting...\n" );
2908 fprintf( stderr,
"--channel-name must be specified for frame data\n" );
2920 "--frame-cache must not be specified when globbing frame data\n" );
2927 "--frame-type must be specified when globbing frame data\n" );
2936 "--frame-cache must be specified when not globbing frame data\n" );
2942 fprintf( stderr,
"--frame-type must not be specified when obtaining "
2943 "frame data from a cache file\n" );
2957 "--glob-frame-data" );
2970 "--point-calibration" );
2980 fprintf( stderr,
"either --calibration-cache or "
2981 "--glob-calibration-data must be specified\n" );
2986 fprintf( stderr,
"only one of --calibration-cache or "
2987 "--glob-calibration-data can be specified\n" );
2995 fprintf( stderr,
"neither --calibration-cache nor --glob-calibration-data\n"
2996 "should be given when using calibrated data or a simulated PSD\n" );
3009 "--glob-calibration-data" );
3017 fprintf( stderr,
"--order must be specified\n" );
3022 fprintf( stderr,
"--approximant must be specified\n" );
3027 fprintf( stderr,
"--space must be specified\n" );
3034 fprintf( stderr,
"--grid-spacing must be specified\n" );
3039 fprintf( stderr,
"--grid-spacing must be either SquareNotOriented or Hexagonal\n" );
3046 if ( ! havePsi0Min )
3048 fprintf( stderr,
"--minimum-psi0 must be specified\n" );
3051 if ( ! havePsi0Max )
3053 fprintf( stderr,
"--maximum-psi0 must be specified\n" );
3056 if ( ! havePsi3Min )
3058 fprintf( stderr,
"--minimum-psi3 must be specified\n" );
3061 if ( ! havePsi3Max )
3063 fprintf( stderr,
"--maximum-psi3 must be specified\n" );
3068 fprintf( stderr,
"--alpha must be specified\n" );
3073 fprintf( stderr,
"--maximum-fcut-tmplts must be specified\n" );
3079 fprintf( stdout,
"invalid argument to --maximum-psi3:\n"
3080 "maximum value of psi3 must be greater than minimum value of psi3: "
3090 if (
minMass < 0 && ( ! havePsi0Min || ! havePsi3Min ) )
3092 fprintf( stderr,
"--minimum-mass or --minimum-psi0 and --minimum-psi3 "
3093 "must be specified\n" );
3096 if (
maxMass < 0 && ( ! havePsi0Max || ! havePsi3Max ) )
3098 fprintf( stderr,
"--maximum-mass or --maximum-psi0 and --maximum-psi3 "
3099 "must be specified\n" );
3107 fprintf( stderr,
"--minimum-mass must be specified\n" );
3112 fprintf( stderr,
"Either --maximum-mass or --max-total-mass must be specified\n" );
3117 fprintf( stderr,
"--max-total-mass must be specified with --min-total-mass\n" );
3125 fprintf( stderr,
"--minimal-match must be specified\n" );
3130 fprintf( stderr,
"--high-frequency-cutoff must be specified\n" );
3135 if ( ! haveNumFcut )
3137 fprintf( stderr,
"must specify --num-freq-cutoffs\n" );
3140 if ( ! haveMaxFcut )
3142 fprintf( stderr,
"must specify --max-high-freq-cutoff\n" );
3145 if ( ! haveMinFcut )
3147 fprintf( stderr,
"must specify --min-high-freq-cutoff\n" );
3153 if( maxFreqCut < minFreqCut || maxFreqCut >
minFreqCut )
3155 fprintf(stderr,
"--max-high-freq-cutoff must equal --min-high-freq-cutoff when --num-freq-cutoffs = 1\n" );
3166 "Error: argument to --minimum-spin1 must be less than --maximum-spin1 .\n" );
3174 "Error: argument to --minimum-kappa1 must be less than --maximum-kappa1 .\n" );
3184 "Error: argument --max-eta must be given if --min-eta is given\n");
3191 "Error: argument --min-eta must be given if --max-eta is given\n");
3198 "Error: value for --max-eta must be greater than or equal to value for --min-eta\n");
3206#undef ADD_PROCESS_PARAM
const LALVCSInfoList lalAppsVCSInfoList
NULL-terminated list of VCS and build information for LALApps and its dependencies
const LALVCSInfo lalAppsVCSIdentInfo
Identable VCS and build information for LALApps.
lal_errhandler_t lal_errhandler
int LAL_ERR_EXIT(LALStatus *stat, const char *func, const char *file, const int line, volatile const char *id)
#define LAL_CALL(function, statusptr)
void LALFrSeek(LALStatus *status, const LIGOTimeGPS *epoch, LALFrStream *stream)
void LALFrGetREAL8TimeSeries(LALStatus *status, REAL8TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrCacheOpen(LALStatus *status, LALFrStream **output, LALCache *cache)
void LALFrGetREAL4TimeSeries(LALStatus *status, REAL4TimeSeries *series, FrChanIn *chanin, LALFrStream *stream)
void LALFrClose(LALStatus *status, LALFrStream **stream)
void LALCheckMemoryLeaks(void)
int LALgetopt_long_only(int argc, char *const *argv, const char *options, const struct LALoption *long_options, int *opt_index)
#define required_argument
int XLALCloseLIGOLwXMLFile(LIGOLwXMLStream *xml)
LIGOLwXMLStream * XLALOpenLIGOLwXMLFile(const char *path)
int XLALWriteLIGOLwXMLProcessTable(LIGOLwXMLStream *, const ProcessTable *)
int XLALWriteLIGOLwXMLProcessParamsTable(LIGOLwXMLStream *, const ProcessParamsTable *)
int XLALWriteLIGOLwXMLSnglInspiralTable(LIGOLwXMLStream *xml, const SnglInspiralTable *sngl_inspiral)
int XLALWriteLIGOLwXMLSearchSummaryTable(LIGOLwXMLStream *, const SearchSummaryTable *)
SnglInspiralTable * XLALSnglInspiralTableFromLIGOLw(const char *fileName)
static LALUnit strainPerCount
void LALButterworthREAL8TimeSeries(LALStatus *stat, REAL8TimeSeries *series, PassBandParamStruc *params)
void LALDButterworthREAL4TimeSeries(LALStatus *stat, REAL4TimeSeries *series, PassBandParamStruc *params)
LIGOTimeGPS * XLALGPSTimeNow(LIGOTimeGPS *gpstime)
void XLALDestroyCache(LALCache *cache)
LALCache * XLALCacheGlob(const char *dirstr, const char *fnptrn)
LALCache * XLALCacheImport(const char *fname)
LALCache * XLALCacheDuplicate(const LALCache *cache)
int XLALCacheSieve(LALCache *cache, INT4 t0, INT4 t1, const char *srcregex, const char *dscregex, const char *urlregex)
#define XLAL_INIT_DECL(var,...)
int XLALFrStreamSetMode(LALFrStream *stream, int mode)
LAL_FR_STREAM_CHECKSUM_MODE
LAL_FR_STREAM_VERBOSE_MODE
void LALInspiralBankGeneration(LALStatus *status, InspiralCoarseBankIn *in, SnglInspiralTable **out, INT4 *count)
MinComponentMassMaxTotalMass
void * XLALRealloc(void *p, size_t n)
LAL_PNORDER_TWO_POINT_FIVE
LAL_PNORDER_THREE_POINT_FIVE
LAL_PNORDER_ONE_POINT_FIVE
double XLALSimNoisePSDGEO(double f)
double XLALSimNoisePSDaLIGOZeroDetHighPower(double f)
double XLALSimNoisePSDaLIGONoSRMHighPower(double f)
double XLALSimNoisePSDeLIGOModel(double f)
double XLALSimNoisePSDaLIGONoSRMLowPower(double f)
double XLALSimNoisePSDAdvVirgo(double f)
double XLALSimNoisePSDaLIGOZeroDetLowPower(double f)
double XLALSimNoisePSDiLIGOSRD(double f)
double XLALSimNoisePSDKAGRA(double f)
double XLALSimNoisePSDVirgo(double f)
int XLALOutputVCSInfo(FILE *fp, const LALVCSInfoList vcs_list, const int verbose, const char *prefix)
void LALDPrintFrequencySeries(REAL8FrequencySeries *series, const CHAR *filename)
REAL4FFTPlan * XLALCreateForwardREAL4FFTPlan(UINT4 size, int measurelvl)
void XLALDestroyREAL4FFTPlan(REAL4FFTPlan *plan)
void LALResampleREAL4TimeSeries(LALStatus *status, REAL4TimeSeries *ts, ResampleTSParams *params)
int XLALREAL4AverageSpectrumMedian(REAL4FrequencySeries *spectrum, const REAL4TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL4Window *window, const REAL4FFTPlan *plan)
int XLALREAL4AverageSpectrumWelch(REAL4FrequencySeries *spectrum, const REAL4TimeSeries *tseries, UINT4 seglen, UINT4 stride, const REAL4Window *window, const REAL4FFTPlan *plan)
const LALUnit lalADCCountUnit
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
void LALCCreateVector(LALStatus *, COMPLEX8Vector **, UINT4)
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALCDestroyVector(LALStatus *, COMPLEX8Vector **)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
void LALSDestroyVector(LALStatus *, REAL4Vector **)
void LALSCreateVector(LALStatus *, REAL4Vector **, UINT4)
void XLALDestroyREAL4Window(REAL4Window *window)
REAL4Window * XLALCreateHannREAL4Window(UINT4 length)
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
char name[LIGOMETA_SOURCE_MAX]
FrameH * fr_add_proc_REAL8FrequencySeries(FrameH *frame, REAL8FrequencySeries *chan, const char *unit, const char *suffix)
FrameH * fr_add_proc_COMPLEX8FrequencySeries(FrameH *frame, COMPLEX8FrequencySeries *chan, const char *unit, const char *suffix)
FrameH * fr_add_proc_REAL4TimeSeries(FrameH *frame, REAL4TimeSeries *chan, const char *unit, const char *suffix)
FrameH * fr_add_proc_REAL4FrequencySeries(FrameH *frame, REAL4FrequencySeries *chan, const char *unit, const char *suffix)
InspiralBankMassRange massRange
ComputeMoments computeMoments
InsidePolygonEnum insidePolygon
const char *const vcsDate
const char *const vcsStatus
CHAR type[LIGOMETA_TYPE_MAX]
CHAR param[LIGOMETA_PARAM_MAX]
CHAR value[LIGOMETA_VALUE_MAX]
struct tagProcessParamsTable * next
CHAR program[LIGOMETA_PROGRAM_MAX]
CHAR ifos[LIGOMETA_IFOS_MAX]
CHAR comment[LIGOMETA_COMMENT_MAX]
ResampleTSFilter filterType
CHAR ifo[LIGOMETA_IFO_MAX]
struct tagSnglInspiralTable * next
CHAR channel[LIGOMETA_CHANNEL_MAX]
CHAR search[LIGOMETA_SEARCH_MAX]
int main(int argc, char *argv[])
#define ADD_PROCESS_PARAM(pptype, format, ppvalue)
int vrbflg
defined in lal/lib/std/LALError.c
CHAR comment[LIGOMETA_COMMENT_MAX]
REAL4 strainHighPassAtten
int arg_parse_check(int argc, char *argv[], ProcessParamsTable *procparams)