Commit b6c993f6 authored by Bruce Allen's avatar Bruce Allen
Browse files

Changed time offset units to milliseconds

parent b574ee77
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
const double deg_to_rad = M_PI/180.0; const double deg_to_rad = M_PI/180.0;
// For computing arrival time delays, need mean radius of the earth in // For computing arrival time delays, need mean radius of the earth in
// seconds. Get this by dividing radius in km by speed of light in // milliseconds. Get this by dividing radius in km by speed of light in
// km/s. // km/s.
const double radius_earth = 6371.0/299792.458; const double radius_earth = 6371.0*1000.0/299792.458;
// Event time // Event time
// GPS 1187008882 // GPS 1187008882
...@@ -337,10 +337,10 @@ int main(int argc, char *argv[]) { ...@@ -337,10 +337,10 @@ int main(int argc, char *argv[]) {
// form combinations as functions of inclination and polarization angles // form combinations as functions of inclination and polarization angles
X = 2.0*ci*(alpha*s2p - beta*c2p); X = 2.0*ci*(alpha*s2p - beta*c2p);
Y = -(ci*ci + 1.0)*(alpha*c2p + beta*s2p); Y = -(ci*ci + 1.0)*(alpha*c2p + beta*s2p);
// compute time delay // compute time delay in milliseconds
dt *= radius_earth; dt *= radius_earth;
// printf("For detector %s the waveform is w^2 [ %.3f sin(2w(t%+.3f s))%+.3f cos(2w(t%+.3f s)) ]\n", detectors[i].name, X, dt, Y, dt); // printf("For detector %s the waveform is w^2 [ %.3f sin(2w(t%+.1f ms))%+.3f cos(2w(t%+.1f ms)) ]\n", detectors[i].name, X, dt, Y, dt);
// compute alternative form of output // compute alternative form of output
// X sin(phi) + Y cos(phi) = sqrt(X^2+Y^2) sin(phi + ang) where ang=atan2(Y,X) // X sin(phi) + Y cos(phi) = sqrt(X^2+Y^2) sin(phi + ang) where ang=atan2(Y,X)
...@@ -351,7 +351,7 @@ int main(int argc, char *argv[]) { ...@@ -351,7 +351,7 @@ int main(int argc, char *argv[]) {
// degree character in UTF-8 character set (most likely terminal type!) // degree character in UTF-8 character set (most likely terminal type!)
int deg1=0xC2, deg2=0xB0; int deg1=0xC2, deg2=0xB0;
printf("For detector %s the waveform is %.3f w^2 sin(2w[t%+.3f s]%+.1f%c%c)\n", detectors[i].name, amp, dt, ang, deg1, deg2); printf("For detector %s the waveform is %.3f w^2 sin(2w[t%+.1f ms]%+.1f%c%c)\n", detectors[i].name, amp, dt, ang, deg1, deg2);
} }
return 0; return 0;
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment