136#include <gsl/gsl_rng.h>
138#include <lal/LALStdlib.h>
139#include <lal/LALgetopt.h>
140#include <lal/LALConstants.h>
142#include <lal/Units.h>
143#include <lal/FrequencySeries.h>
144#include <lal/TimeSeries.h>
145#include <lal/LALSimNoise.h>
146#include <lal/LALSimUtils.h>
148static LALUnit strainSquaredPerHertzUnit = { 0, { 0, 0, 1, 0, 0, 2, 0}, { 0, 0, 0, 0, 0, 0, 0} };
168int main(
int argc,
char *argv[])
187 if (strcmp(
detector,
"0noise") == 0) {
190 double deltaF =
srate / length;
191 size_t klow =
flow / deltaF;
193 fprintf(stdout,
"# freq (s^-1)\tASD (strain s^1/2)\n");
194 for (k = klow; k < length/2 - 1; ++k)
195 fprintf(stdout,
"%.18e\t%.18e\n", k * deltaF, 0.0);
198 fprintf(stdout,
"# time (s)\tNOISE (strain)\n");
200 for (j = 0; j < n; ++j) {
209 rng = gsl_rng_alloc(gsl_rng_default);
219 double horizon_distance;
221 fprintf(stderr,
"%-39s %g Hz\n",
"low-frequency cutoff: ",
flow);
223 fprintf(stderr,
"%-39s %g Mpc\n",
"standard siren horizon distance: ", horizon_distance / Mpc);
225 fprintf(stderr,
"%-39s GSL_RNG_TYPE=%s\n",
"GSL random number generator:", gsl_rng_name(rng));
226 fprintf(stderr,
"%-39s GSL_RNG_SEED=%lu\n",
"GSL random number seed:", gsl_rng_default_seed);
231 fprintf(stdout,
"# freq (s^-1)\tASD (strain s^1/2)\n");
232 for (k = klow; k < length/2 - 1; ++k)
240 fprintf(stdout,
"# time (s)\tNOISE (strain)\n");
243 for (j = 0; j < stride; ++j, --n) {
268 {
"aligo-zerodet-highpower",
no_argument, 0,
'C' },
289 char args[] =
"h\1I0ABCDEFOPvVgGTKa:s:t:r:d:f:";
291 int option_index = 0;
300 if (long_options[option_index].
flag)
303 fprintf(stderr,
"error parsing option %s with argument %s\n", long_options[option_index].
name,
LALoptarg);
329 detector =
"aLIGO_ZeroDet_LowPower";
335 detector =
"aLIGO_ZeroDet_HighPower";
424 fprintf(stderr,
"unknown error while parsing options\n");
430 fprintf(stderr,
"extraneous command line arguments:\n");
437 fprintf(stderr,
"must select a noise model and a duration\n");
448 fprintf(stderr,
"options:\n" );
449 fprintf(stderr,
"\t-h, --help \tprint this message and exit\n");
450 fprintf(stderr,
"\t-0, --0noise \tno noise (generates zeros)\n");
451 fprintf(stderr,
"\t-A, --aligo-nosrm \taLIGO no SRM noise\n");
452 fprintf(stderr,
"\t-B, --aligo-zerodet-lowpower \taLIGO zero detuning low power noise\n");
453 fprintf(stderr,
"\t-C, --aligo-zerodet-highpower\taLIGO zero detuning high power noise\n");
454 fprintf(stderr,
"\t-D, --aligo-nsnsopt \taLIGO NSNS optimized noise\n");
455 fprintf(stderr,
"\t-E, --aligo-bhbh20deg \taLIGO BHBH optimized 20 deg detuning noise\n");
456 fprintf(stderr,
"\t-F, --aligo-highfreq \taLIGO kHz narrowband noise\n");
457 fprintf(stderr,
"\t-I, --iligo-srd \tiLIGO SRD noise power\n");
458 fprintf(stderr,
"\t-v, --virgo \tinitial Virgo noise power\n");
459 fprintf(stderr,
"\t-V, --advvirgo \tAdvanced Virgo noise power\n");
460 fprintf(stderr,
"\t-g, --geo \tGEO600 noise power\n");
461 fprintf(stderr,
"\t-G, --geohf \tGEO-HF noise power\n");
462 fprintf(stderr,
"\t-T, --tama \tTAMA300 noise power\n");
463 fprintf(stderr,
"\t-K, --kagra \tKAGRA noise power\n");
464 fprintf(stderr,
"\t-O, --official \tuse official data files\n");
465 fprintf(stderr,
"\t-P, --psd-only \toutput PSD only (actually ASD)\n");
466 fprintf(stderr,
"\t-a, --asd-file ASDFILE \tread an ASD file\n");
467 fprintf(stderr,
"\t-s, --start-time GPSSTART \tGPS start time (s)\n");
468 fprintf(stderr,
"\t-t, --duration DURATION \t(required) duration of data to produce (s)\n");
469 fprintf(stderr,
"\t-r, --sample-rate SRATE \tsample rate (Hz) [16384]\n");
470 fprintf(stderr,
"\t-d, --segment-duration SEGDUR\tsegment duration (s) [4]\n");
471 fprintf(stderr,
"\t-f, --low-frequency FLOW \toverride default low frequency (Hz)\n");
int XLALStrToGPS(LIGOTimeGPS *t, const char *nptr, char **endptr)
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 main(int argc, char *argv[])
int usage(const char *program)
int parseargs(int argc, char **argv)
double zeronoise(double f)
static LALUnit strainSquaredPerHertzUnit
double(* psdfunc)(double)
int(* opsdfunc)(REAL8FrequencySeries *, double)
char * XLALGPSToStr(char *s, const LIGOTimeGPS *t)
REAL8FrequencySeries * XLALCreateREAL8FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL8FrequencySeries(REAL8FrequencySeries *series)
int XLALSimNoise(REAL8TimeSeries *s, size_t stride, REAL8FrequencySeries *psd, gsl_rng *rng)
Routine that may be used to generate sequential segments of data with a specified stride from one seg...
int XLALSimNoisePSDaLIGOHighFrequencyGWINC(REAL8FrequencySeries *psd, double flow)
Returns a frequency series psd with low frequency cutoff flow corresponding to the "High_Freq....
double XLALSimNoisePSDGEO(double f)
Provides a GEO noise power spectrum based on that from Table IV of .
double XLALSimNoisePSDGEOHF(double f)
Provides a GEO-HF noise power spectrum based on a fit to Figure 6 from .
int XLALSimNoisePSDaLIGOBHBH20DegGWINC(REAL8FrequencySeries *psd, double flow)
Returns a frequency series psd with low frequency cutoff flow corresponding to the "BBH_20deg....
double XLALSimNoisePSDTAMA(double f)
Provides a TAMA300 noise power spectrum based on that from Table IV of .
double XLALSimNoisePSDaLIGOZeroDetHighPower(double f)
Provides the noise power spectrum for aLIGO under the high-power broad-band signal recycling (no detu...
int XLALSimNoisePSDFromFile(REAL8FrequencySeries *psd, double flow, const char *fname)
Reads file fname containing two-column amplitude spectral density data file and interpolates at the f...
int XLALSimNoisePSD(REAL8FrequencySeries *psd, double flow, double(*psdfunc)(double))
Evaluates a power spectral density function, psdfunc, at the frequencies required to populate the fre...
int XLALSimNoisePSDaLIGONoSRMLowPowerGWINC(REAL8FrequencySeries *psd, double flow)
Returns a frequency series psd with low frequency cutoff flow corresponding to the "NO_SRM....
double XLALSimNoisePSDaLIGONoSRMLowPower(double f)
Provides the noise power spectrum for aLIGO under the low-power no-signal-recycling-mirror configurat...
double XLALSimNoisePSDaLIGOHighFrequency(double f)
Provides the noise power spectrum for aLIGO under the configuration tuned to narrow-band high-frequen...
int XLALSimNoisePSDaLIGOZeroDetLowPowerGWINC(REAL8FrequencySeries *psd, double flow)
Returns a frequency series psd with low frequency cutoff flow corresponding to the "ZERO_DET_low_P....
int XLALSimNoisePSDaLIGONSNSOptGWINC(REAL8FrequencySeries *psd, double flow)
Returns a frequency series psd with low frequency cutoff flow corresponding to the "NSNS_Opt....
double XLALSimNoisePSDaLIGONSNSOpt(double f)
Provides the noise power spectrum for aLIGO under the configuration tuned to optimize sensitivity to ...
double XLALSimNoisePSDAdvVirgo(double f)
Provides the noise power spectrum for AdvVirgo based on that from Eqn 6 of .
double XLALSimNoisePSDaLIGOZeroDetLowPower(double f)
Provides the noise power spectrum for aLIGO under the low-power broad-band signal recycling (no detun...
double XLALSimNoisePSDiLIGOSRD(double f)
Provides the noise power spectrum based on a phenomenological fit to the SRD curve for iLIGO.
double XLALSimNoisePSDKAGRA(double f)
Provides the noise power spectrum for KAGRA based on that from Eqn 5 of .
double XLALSimNoisePSDVirgo(double f)
Provides the design noise power spectrum for Virgo based on a phenomenological fit (from the Virgo we...
int XLALSimNoisePSDaLIGOZeroDetHighPowerGWINC(REAL8FrequencySeries *psd, double flow)
Returns a frequency series psd with low frequency cutoff flow corresponding to the "ZERO_DET_high_P....
double XLALSimNoisePSDaLIGOBHBH20Deg(double f)
Provides the noise power spectrum for aLIGO under the configuration tuned to optimize sensitivity to ...
double XLALMeasureStandardSirenHorizonDistance(const REAL8FrequencySeries *psd, double f_min, double f_max)
Computes the horizon distance for a binary neutron star standard siren signal for a given one-sided d...
#define LAL_HORIZON_DISTANCE_OVER_SENSEMON_RANGE
Ratio of horizon distance to sense-monitor range.
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
REAL8TimeSeries * XLALCreateREAL8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
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)