31int main (
int argc,
char **argv)
34 double totalMass,
eta, fOld,
x, sevenBy3=7./3.;
37 double rhorms, rmsD, idealD, Crms, integral;
39 double lso_radius=6., light_ring_radius=2.8, MTSUN_SI=4.925e-6,
pi=3.14159, MPC_SI=3.e22, C_SI=3.e8;
44 fprintf(stderr,
"* Given the noise amplitude/power spectral density as a two-column\n");
45 fprintf(stderr,
"* ascii file this code returns the distance in Mpc as a function of the\n");
46 fprintf(stderr,
"* total mass to binaries with equal masses and an rms orientation \n");
47 fprintf(stderr,
"* and produce an SNR of 5 when integrated up to the LSO R=6M or \n");
48 fprintf(stderr,
"* the light ring R=2.8 M.\n");
49 fprintf(stderr,
"-----------------------------\n");
50 fprintf (stderr,
"Usage: %s ampSpec (0/1) LO (0/1)\n", argv[0]);
51 fprintf (stderr,
"ampSpec: should be 0 if input spectrum is power and 1 if amplitude\n");
52 fprintf (stderr,
"LO: should be 0 if the last orbit is at R=6M (Schwarzschild) and nonzero if at R=2.8M (as in EOB)\n");
53 fprintf(stderr,
"-----------------------------\n");
58 ampSpec = atoi(argv[1]);
60 if (atoi(argv[2]) == 0)
63 LO = light_ring_radius;
73 if ( scanf(
"%le %le\n", &
freq, &
x) == EOF)
75 fprintf(stderr,
"Empty input file\n");
80 while (scanf(
"%le %le\n", &
freq, &
x) != EOF)
89 integral += (
freq-fOld) * pow(
freq, -sevenBy3)/pwrSpec;
92 totalMass = 1./(pow(LO, 1.5) *
pi *
freq);
94 Crms = pow(totalMass, 5./6.) * pow(2.*
eta/15., 0.5) / (rhorms * pow(
pi, 2./3.));
96 rmsD = Crms * sqrt(integral) / MPC_SI * C_SI;
100 totalMass /= MTSUN_SI;
101 if (totalMass < 5000.)
fprintf(stdout,
"%e %e %e %e\n", totalMass, rmsD, idealD,
freq);
int main(int argc, char **argv)