Gitlab will migrate to a new storage backend starting 0300 UTC on 2020-04-04. We do not anticipate a maintenance window for this migration. Performance may be impacted over the weekend. Thanks for your patience.

Commit e10a4461 authored by Leo Pound Singer's avatar Leo Pound Singer

Use detector positions in light seconds in BAYESTAR

This further reduces the dependencies of the C code on LAL headers.
parent 8129345a
......@@ -163,7 +163,7 @@ def localize(
detectors = [lalsimulation.DetectorPrefixToLALDetector(str(ifo))
for ifo in ifos]
responses = np.asarray([det.response for det in detectors])
locations = np.asarray([det.location for det in detectors])
locations = np.asarray([det.location for det in detectors]) / lal.C_SI
# Power spectra for each detector.
psds = [single.psd for single in singles]
......@@ -210,7 +210,7 @@ def localize(
# For LHO+LLO, this is 15.0 ms.
# For an arbitrary terrestrial detector network, the maximum is 26.3 ms.
max_abs_t = np.max(
np.sqrt(np.sum(np.square(locations / lal.C_SI), axis=1))) + 0.005
np.sqrt(np.sum(np.square(locations), axis=1))) + 0.005
if snr_series is None:
log.warn("No SNR time series found, so we are creating a zero-noise "
......
......@@ -508,7 +508,7 @@ static void toa_errors(
{
dot += locs[i][j] * n[j];
}
dt[i] = toas[i] + dot / LAL_C_SI;
dt[i] = toas[i] + dot;
}
}
......@@ -846,7 +846,7 @@ bayestar_pixel *bayestar_sky_map_toa_phoa_snr(
const double *epochs, /* Timestamps of SNR time series */
const float complex **snrs, /* Complex SNR series */
const float (**responses)[3], /* Detector responses */
const double **locations, /* Barycentered Cartesian geographic detector positions (m) */
const double **locations, /* Barycentered Cartesian geographic detector positions (light seconds) */
const double *horizons /* SNR=1 horizon distances for each detector */
) {
/* Initialize precalculated tables. */
......@@ -1051,7 +1051,7 @@ double bayestar_log_likelihood_toa_phoa_snr(
const double *epochs, /* Timestamps of SNR time series */
const float complex **snrs, /* Complex SNR series */
const float (**responses)[3], /* Detector responses */
const double **locations, /* Barycentered Cartesian geographic detector positions (m) */
const double **locations, /* Barycentered Cartesian geographic detector positions (light seconds) */
const double *horizons /* SNR=1 horizon distances for each detector */
) {
const double dec = asin(sin_dec);
......
......@@ -101,7 +101,7 @@ bayestar_pixel *bayestar_sky_map_toa_phoa_snr(
const double *epochs, /* Timestamps of SNR time series */
const float complex **snrs, /* Complex SNR series */
const float (**responses)[3], /* Detector responses */
const double **locations, /* Barycentered Cartesian geographic detector positions (m) */
const double **locations, /* Barycentered Cartesian geographic detector positions (light seconds) */
const double *horizons /* SNR=1 horizon distances for each detector */
);
......@@ -121,7 +121,7 @@ double bayestar_log_likelihood_toa_phoa_snr(
const double *epochs, /* Timestamps of SNR time series */
const float complex **snrs, /* Complex SNR series */
const float (**responses)[3], /* Detector responses */
const double **locations, /* Barycentered Cartesian geographic detector positions (m) */
const double **locations, /* Barycentered Cartesian geographic detector positions (light seconds) */
const double *horizons /* SNR=1 horizon distances for each detector */
);
......
Markdown is supported
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