88 #include <gsl/gsl_rng.h>
90 #include <lal/LALStdlib.h>
91 #include <lal/LALgetopt.h>
92 #include <lal/LALConstants.h>
94 #include <lal/Units.h>
95 #include <lal/FrequencySeries.h>
96 #include <lal/TimeSeries.h>
97 #include <lal/LALSimSGWB.h>
99 #include <lal/LALSimReadData.h>
118 int main(
int argc,
char *argv[])
122 const size_t length = 65536;
123 const size_t stride = length / 2;
136 rng = gsl_rng_alloc(gsl_rng_default);
156 printf(
"# time (s)");
161 printf(
"\t%s (strain)",
name);
169 for (j = 0; j < stride; ++j, --n) {
175 printf(
"\t%.18e", seg[
i]->
data->data[j]);
209 char args[] =
"hGHLVs:t:r:W:a:F:f:p:";
211 int option_index = 0;
220 if (long_options[option_index].
flag)
223 fprintf(stderr,
"error parsing option %s with argument %s\n", long_options[option_index].
name,
LALoptarg);
270 fprintf(stderr,
"unknown error while parsing options\n");
276 fprintf(stderr,
"extraneous command line arguments:\n");
283 fprintf(stderr,
"Using a custom spectrum\n");
286 fprintf(stderr,
"Using a powerlaw spectrum\n");
289 fprintf(stderr,
"must select a duration and a value of Omega0\n");
295 fprintf(stderr,
"Using a flat spectrum\n");
298 fprintf(stderr,
"must select a duration and a value of Omega0\n");
310 fprintf(stderr,
"options:\n" );
311 fprintf(stderr,
"\t-h, --help \tprint this message and exit\n");
312 fprintf(stderr,
"\t-G, --geo \tinclude GEO\n");
313 fprintf(stderr,
"\t-H, --hanford \tinclude LHO\n");
314 fprintf(stderr,
"\t-L, --livingston \tinclude LLO\n");
315 fprintf(stderr,
"\t-V, --virgo \tinclude Virgo\n");
316 fprintf(stderr,
"\t-s, --start-time GPSSTART \tGPS start time (s)\n");
317 fprintf(stderr,
"\t-t, --duration DURATION \t(required) duration of data to produce (s)\n");
318 fprintf(stderr,
"\t-r, --sample-rate SRATE \tsample rate (Hz) [16384]\n");
319 fprintf(stderr,
"\t-W, --Omega0 OMEGA0 \t(required) flat spectral energy density\n");
320 fprintf(stderr,
"\t-f, --low-frequency FLOW \tlow frequency cutoff (Hz) (default = 10 Hz)\n");
321 fprintf(stderr,
"\t-a, --alpha \tsgwb spectrum power law power\n");
322 fprintf(stderr,
"\t-F, --reference-frequency FREF\treference frequency (Hz) for a powerlaw spectrum\n");
323 fprintf(stderr,
"\t-p, --path-to-file \tpath to a file including data for Omega (overrides other options)\n");
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
const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]
char * XLALGPSToStr(char *s, const LIGOTimeGPS *t)
void XLALDestroyREAL8FrequencySeries(REAL8FrequencySeries *series)
REAL8FrequencySeries * XLALSimSGWBOmegaGWPowerLawSpectrum(double Omegaref, double alpha, double fref, double flow, double deltaF, size_t length)
Creates a frequency series that contains a power law SGWB spectrum with the specified power Omegaref ...
int XLALSimSGWB(REAL8TimeSeries **h, const LALDetector *detectors, size_t numDetectors, size_t stride, const REAL8FrequencySeries *OmegaGW, double H0, gsl_rng *rng)
Routine that may be used to generate sequential segments of stochastic background gravitational wave ...
REAL8FrequencySeries * XLALSimSGWBOmegaGWFlatSpectrum(double Omega0, double flow, double deltaF, size_t length)
Creates a frequency series that contains a flat SGWB spectrum with the specified power Omega0 above s...
REAL8FrequencySeries * XLALSimSGWBOmegaGWNumericalSpectrumFromFile(const char *fname, size_t length)
REAL8TimeSeries * XLALCreateREAL8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
const LALUnit lalStrainUnit
void XLALAbortErrorHandler(const char *func, const char *file, int line, int errnum)
XLALErrorHandlerType * XLALSetErrorHandler(XLALErrorHandlerType *newHandler)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
LALDetector detectors[LAL_NUM_DETECTORS]
int main(int argc, char *argv[])
int usage(const char *program)
int parseargs(int argc, char **argv)