Commit 0aef93c8 authored by Karl Wette's avatar Karl Wette

XLALComputeSuperskyMetrics(): add 'type' argument to indicate metric type

- In anticipation of Arunava adding the binary metric into this function
Original: c9cb803079b8e7c89f734f9899e3f79d534540e8
parent e75ae34f
......@@ -568,6 +568,7 @@ static int SM_ComputeReducedSuperskyMetric(
}
SuperskyMetrics *XLALComputeSuperskyMetrics(
const SuperskyMetricType type,
const size_t spindowns,
const LIGOTimeGPS *ref_time,
const LALSegList *segments,
......@@ -580,6 +581,7 @@ SuperskyMetrics *XLALComputeSuperskyMetrics(
{
// Check input
XLAL_CHECK_NULL( type < MAX_METRIC_TYPE, XLAL_EINVAL );
XLAL_CHECK_NULL( spindowns <= 4, XLAL_EINVAL );
XLAL_CHECK_NULL( ref_time != NULL, XLAL_EFAULT );
XLAL_CHECK_NULL( segments != NULL, XLAL_EFAULT );
......
......@@ -44,6 +44,14 @@ extern "C" {
///
typedef struct tagSuperskyTransformData SuperskyTransformData;
///
/// Type of supersky metric to compute.
///
typedef enum tagSuperskyMetricType {
SUPERSKY_METRIC_TYPE, ///< Metric for all-sky searches
MAX_METRIC_TYPE
} SuperskyMetricType;
///
/// Computed supersky metrics, returned by XLALComputeSuperskyMetrics().
///
......@@ -71,6 +79,7 @@ typedef struct tagSuperskyMetrics {
/// Compute the supersky metrics, which are returned in a #SuperskyMetrics struct.
///
SuperskyMetrics *XLALComputeSuperskyMetrics(
const SuperskyMetricType type, ///< [in] Type of supersky metric to compute
const size_t spindowns, ///< [in] Number of frequency+spindown coordinates
const LIGOTimeGPS *ref_time, ///< [in] Reference time for the metrics
const LALSegList *segments, ///< [in] List of segments to compute metrics over
......
......@@ -652,7 +652,7 @@ static int SuperskyTests(
TEST_DATA_DIR "sun00-19-DE405.dat.gz" );
XLAL_CHECK( edat != NULL, XLAL_EFUNC );
const double freq_max = 40.0;
SuperskyMetrics *metrics = XLALComputeSuperskyMetrics( 1, &ref_time, &segments, freq_max, &detectors, NULL, DETMOTION_SPIN | DETMOTION_PTOLEORBIT, edat );
SuperskyMetrics *metrics = XLALComputeSuperskyMetrics( SUPERSKY_METRIC_TYPE, 1, &ref_time, &segments, freq_max, &detectors, NULL, DETMOTION_SPIN | DETMOTION_PTOLEORBIT, edat );
XLAL_CHECK( metrics != NULL, XLAL_EFUNC );
XLAL_CHECK( metrics->num_segments == segments.length, XLAL_EFAILED );
......
......@@ -338,7 +338,7 @@ int main( void )
{
const LIGOTimeGPS ref_time = REF_TIME;
const MultiLALDetector detectors = { .length = 1, .sites = { lalCachedDetectors[LAL_LLO_4K_DETECTOR] } };
metrics = XLALComputeSuperskyMetrics( 1, &ref_time, &segments, FIDUCIAL_FREQ, &detectors, NULL, DETMOTION_SPIN | DETMOTION_PTOLEORBIT, edat );
metrics = XLALComputeSuperskyMetrics( SUPERSKY_METRIC_TYPE, 1, &ref_time, &segments, FIDUCIAL_FREQ, &detectors, NULL, DETMOTION_SPIN | DETMOTION_PTOLEORBIT, edat );
}
XLAL_CHECK_MAIN( metrics != NULL, XLAL_EFUNC );
......
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