46 #include <lal/LALError.h>
48 #include <lal/SFTfileIO.h>
49 #include <lal/SSBtimes.h>
54 #define MYMAX(x,y) ( (x) > (y) ? (x) : (y) )
55 #define MYMIN(x,y) ( (x) < (y) ? (x) : (y) )
56 #define COPY_VECT(dst,src) do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0)
57 #define SUB_VECT(dst,src) do { (dst)[0] -= (src)[0]; (dst)[1] -= (src)[1]; (dst)[2] -= (src)[2]; } while(0)
58 #define MULT_VECT(v,lam) do{ (v)[0] *= (lam); (v)[1] *= (lam); (v)[2] *= (lam); } while(0)
59 #define DOT_VECT(u,v) ((u)[0]*(v)[0] + (u)[1]*(v)[1] + (u)[2]*(v)[2])
60 #define NORM_VECT(v) sqrt(DOT_VECT(v,v))
79 range->refTime = *refTime;
82 range->fkdotBand[
k] = fabs( fkdot1[
k] - fkdot2[
k] );
112 memmove( &inRange, range0,
sizeof( inRange ) );
115 REAL8 flmin = 0, flmax = 0;
116 REAL8 kfact = 1, dtau_powk = 1;
122 REAL8 fkltauk_min =
MYMIN( fkltauk0, fkltauk1 );
123 REAL8 fkltauk_max =
MYMAX( fkltauk0, fkltauk1 );
125 flmin += fkltauk_min / kfact;
126 flmax += fkltauk_max / kfact;
178 for (
l = 0;
l < numSpins;
l ++ ) {
184 for (
k = 0;
k < numSpins;
k ++ ) {
185 REAL8 kcoef = dtauk / kfact;
186 for (
l = 0;
l < numSpins -
k ;
l ++ ) {
187 fkdot1[
l] += inSpins[
k +
l ] * kcoef;
190 kfact *= (
k + 1.0 );
225 for (
k = 0;
k < numSpins;
k++ ) {
228 frac_cycles += modf( fkdot1[
k] * dtauk / kFact, &
dummy );
254 const REAL8 binaryMaxAsini,
255 const REAL8 binaryMinPeriod,
256 const REAL8 binaryMaxEcc
267 XLAL_CHECK( ( binaryMaxAsini > 0 ) || ( ( binaryMinPeriod == 0 ) && ( binaryMaxEcc == 0 ) ),
XLAL_EINVAL );
268 XLAL_CHECK( ( binaryMaxAsini == 0 ) || ( ( binaryMinPeriod > 0 ) && ( binaryMaxEcc >= 0 ) && ( binaryMaxEcc < 1 ) ),
XLAL_EINVAL );
280 dT =
Tspan / ( numSteps - 1 );
284 for (
UINT4 i = 0;
i < numSteps;
i ++ ) {
285 REAL8 t_i = tStart +
i * dT;
286 REAL8 DeltaT_i = t_i - refTime;
301 if ( binaryMaxAsini > 0 ) {
303 extraPerFreq += maxOmega * binaryMaxAsini / ( 1.0 - binaryMaxEcc );
307 ( *minCoverFreq ) = minFreq * ( 1.0 - extraPerFreq );
308 ( *maxCoverFreq ) = maxFreq * ( 1.0 + extraPerFreq );
335 if ( doppler->
asini > 0 ) {
342 for (
UINT4 i = 0;
i < Nsteps;
i ++ ) {
346 REAL8 freq_i = fkdot_i[0];
350 minFreq0 =
fmin( minFreq0, freq_i );
351 maxFreq0 =
fmax( maxFreq0, freq_i );
356 ( *minFreq ) = minFreq0;
357 ( *maxFreq ) = maxFreq0;
396 if ( skypos_maxdoppler ) {
410 REAL8 longitude = atan2( dV[1], dV[0] );
411 if ( longitude < 0 ) {
414 REAL8 latitude = asin( dV[2] );
415 ( *skypos_maxdoppler ).longitude = longitude;
416 ( *skypos_maxdoppler ).latitude = latitude;
DetectorStateSeries * XLALGetDetectorStates(const LIGOTimeGPSVector *timestamps, const LALDetector *detector, const EphemerisData *edat, REAL8 tOffset)
Get the 'detector state' (ie detector-tensor, position, velocity, etc) for the given vector of timest...
#define XLAL_INIT_DECL(var,...)
REAL8 PulsarSpins[PULSAR_MAX_SPINS]
Typedef for fixed-size array holding GW frequency and derivatives fk = d^k Freq/dt^k|(tau_ref)
#define PULSAR_MAX_SPINS
maximal number of spin-parameters (Freq + spindowns) we can handle
LIGOTimeGPSVector * XLALMakeTimestamps(LIGOTimeGPS tStart, REAL8 Tspan, REAL8 Tsft, REAL8 Toverlap)
Given a start-time, Tspan, Tsft and Toverlap, returns a list of timestamps covering this time-stretch...
void XLALDestroyTimestampVector(LIGOTimeGPSVector *vect)
De-allocate a LIGOTimeGPSVector.
void XLALDestroySSBtimes(SSBtimes *tSSB)
Destroy a SSBtimes structure.
SSBtimes * XLALGetSSBtimes(const DetectorStateSeries *DetectorStates, SkyPosition pos, LIGOTimeGPS refTime, SSBprecision precision)
For a given DetectorStateSeries, calculate the time-differences , and their derivatives .
int XLALAddBinaryTimes(SSBtimes **tSSBOut, const SSBtimes *tSSBIn, const PulsarDopplerParams *Doppler)
Compute extra time-delays for a CW source in a (Keplerian) binary orbital system.
@ SSBPREC_NEWTONIAN
simple Newtonian:
COORDINATESYSTEM_EQUATORIAL
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_NULL(assertion,...)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
LIGOTimeGPS tGPS
GPS timestamps corresponding to this entry.
Timeseries of DetectorState's, representing the detector-info at different timestamps.
DetectorState * data
array of DetectorState entries
UINT4 length
total number of entries
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
A vector of 'timestamps' of type LIGOTimeGPS.
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
PulsarSpins fkdot
Intrinsic spins: [Freq, f1dot, f2dot, ...
REAL8 Delta
Sky position: DEC (latitude) in equatorial coords and radians.
LIGOTimeGPS refTime
Reference time of pulsar parameters (in SSB!)
REAL8 Alpha
Sky position: RA (longitude) in equatorial coords and radians.
REAL8 asini
Binary: projected, normalized orbital semi-major axis (s).
Contains a "spin-range", ie spins and corresponding bands at a given (SSB) reference GPS-time .
PulsarSpins fkdot
Vector of spin-values .
LIGOTimeGPS refTime
SSB reference GPS-time at which spin-range is defined.
PulsarSpins fkdotBand
Vector of spin-bands , MUST be same length as fkdot.
Simple container for two REAL8-vectors, namely the SSB-timings DeltaT_alpha and Tdot_alpha,...
REAL8Vector * Tdot
dT/dt : time-derivative of SSB-time wrt local time for SFT-alpha