Skip to content

Switch from using LIGOTimeGPSVectors to REAL8Vectors in HeterodynePulsarModel

Description

There are various functions in the LALPulsar HeterodynePulsarModel.c file for calculating the amplitude and phase evolution of a heterodyned continuous wave signal. These take in the set of GPS time stamps at which to calculate the model. Currently the vector of time stamps is passed as a LIGOTimeGPSVector. This MR changes this so that they instead take time stamps as REAL8Vectors. The main reason for this is the issue describe in #467 (closed); when using these SWIG-wrapped functions you have to create and fill in a LIGOTimeGPSVector and filling these in with LIGOTimeGPS objects leads to memory leaks (when looping over chunks of frame data and calculating phases for each chunk this memory leak becomes quite problematic). On top if this, the increased precision from using a LIGOTimeGPS over a REAL8 is never actually exploited in the code as the time stamps values being passed to the functions are always (in my use cases) being converted from 64-bit float values anyway, and in most cases within the functions are converting back from LIGOTimeGPS to REAL8 when being used. This is therefore a simpler, more practical way of doing things.

For GPS times with 10 digits before the decimal place, 64-bit floats can still hold them to microsecond or better precision, which is not problematic even for our fastest sources (less than a thousandth, but up to at most a few hundredths of a cycle), so this should not affect any analysis.

API Changes and Justification

Backwards Compatible Changes

  • This change introduces no API changes
  • This change adds new API calls

Backwards Incompatible Changes

  • This change modifies an existing API
  • This change removes an existing API

This changes the API for various functions for calculating a heterodyned continuous wave signal by changing the type of one of the inputs. As far as I am aware no one other than myself makes use of these functions and the only place where the change will be noticed is in my own CWInPy package. I plan to update CWInPy accordingly.

Review Status

These changes are covered by the test suite run in test_heterodyned_model.py.

cc @karl-wette @david-keitel

Merge request reports