27#include <lal/LALStdlib.h>
28#include <lal/LALAtomicDatatypes.h>
29#include <lal/LALDatatypes.h>
30#include <lal/AVFactories.h>
31#include <lal/LALgetopt.h>
32#include <lal/SkyCoordinates.h>
33#include <lal/DetectorSite.h>
34#include <lal/DetResponse.h>
35#include <lal/ReadPulsarParFile.h>
36#include <lal/BinaryPulsarTiming.h>
37#include <lal/LALString.h>
38#include <lal/SFTfileIO.h>
39#include <lal/LALBarycenter.h>
40#include <lal/LALInitBarycenter.h>
41#include <lal/LALConstants.h>
42#include <lal/XLALError.h>
50"Usage: %s [options]\n\n"\
51" --help display this message\n"\
52" --detector IFOs to use e.g. H1\n"\
53" --par-file pulsar parameter (.par) file (full path)\n"\
54" --start start time GPS\n"\
55" --timespan time span to calculate over (seconds)\n"\
56" --deltat length of each step (seconds)\n"\
57" --output-dir output directory\n"\
58" --harmonic the frequency harmonic to output [default: 2]\n"\
61typedef struct tagInputParams {
79int main(
int argc,
char *argv[] )
104 baryinput.
site = det;
109 CHAR *earthfile = NULL, *sunfile = NULL, *
timefile = NULL;
118 REAL8Vector *freqs = NULL, *dopplerss = NULL, *dopplerbs = NULL, *doppler = NULL;
125 get_freq( inputs.
start, (
REAL8 )inputs.
deltat, inputs.
freqharm,
params, baryinput,
edat,
tdat, ttype, freqs, dopplerss, dopplerbs, doppler );
127 sprintf( outputfile,
"%s/frequency_evolution_%s.txt", inputs.
outputdir, inputs.
det );
129 fp = fopen( outputfile,
"w" );
132 dopplerss->data[
i], dopplerbs->data[
i], doppler->data[
i] );
167 INT4 option_index = 0;
177 if ( long_options[option_index].
flag ) {
216 if ( inputParams->
start < 0. ) {
226 if ( inputParams->
deltat < 0. ) {
247 REAL8 time0 = 0., timep1 = 0.;
255 if (
edat == NULL ) {
290 }
else if (
dist != 0. ) {
297 if ( pepoch == 0. && posepoch != 0. ) {
299 }
else if ( posepoch == 0. && pepoch != 0. ) {
304 REAL8 taylorcoeff = 1., tmpdt = 0.;
319 bary.
delta = dec + DT * pmdec;
320 bary.
alpha = ra + DT * pmra / cos( bary.
delta );
338 taylorcoeff /= (
REAL8 )
k;
339 freqs->
data[
i] += taylorcoeff * fs->
data[
k] * tmpdt;
342 freqs->
data[
i] *= freqharm;
352 binput.
earth = earth;
358 binput.
earth = earth2;
363 dfbinary->
data[
i] = 0.;
void XLALBinaryPulsarDeltaTNew(BinaryPulsarOutput *output, BinaryPulsarInput *input, PulsarParameters *params)
function to calculate the binary system delay using new parameter structure
#define __func__
log an I/O error, i.e.
int LALgetopt_long(int argc, char *const *argv, const char *options, const struct LALoption *long_options, int *opt_index)
#define required_argument
const REAL8Vector * PulsarGetREAL8VectorParam(const PulsarParameters *pars, const CHAR *name)
Return a REAL8Vector parameter.
REAL8 PulsarGetREAL8ParamOrZero(const PulsarParameters *pars, const CHAR *name)
Return a REAL8 parameter if it exists, otherwise return zero.
int PulsarCheckParam(const PulsarParameters *pars, const CHAR *name)
Check for the existence of the parameter name in the PulsarParameters structure.
PulsarParameters * XLALReadTEMPOParFile(const CHAR *pulsarAndPath)
Read in the parameters from a TEMPO(2) parameter file into a PulsarParameters structure.
REAL8 PulsarGetREAL8Param(const PulsarParameters *pars, const CHAR *name)
Return a REAL8 parameter.
void PulsarFreeParams(PulsarParameters *pars)
Function to free memory from pulsar parameters.
TimeCorrectionData * XLALInitTimeCorrections(const CHAR *timeCorrectionFile)
An XLAL interface for reading a time correction file containing a table of values for converting betw...
EphemerisData * XLALInitBarycenter(const CHAR *earthEphemerisFile, const CHAR *sunEphemerisFile)
XLAL interface to reading ephemeris files 'earth' and 'sun', and return ephemeris-data in old backwar...
int XLALBarycenter(EmissionTime *emit, const BarycenterInput *baryinput, const EarthState *earth)
Transforms from detector arrival time in GPS (as specified in the LIGOTimeGPS structure) to pulse em...
int XLALBarycenterEarthNew(EarthState *earth, const LIGOTimeGPS *tGPS, const EphemerisData *edat, const TimeCorrectionData *tdat, TimeCorrectionType ttype)
Computes the position and orientation of the Earth, at some arrival time, but unlike XLALBarycenterEa...
TimeCorrectionType
Enumerated type denoting the time system type to be produced in the solar system barycentring routine...
char char * XLALStringDuplicate(const char *s)
const LALDetector * XLALGetSiteInfo(const CHAR *name)
Find the site geometry-information 'LALDetector' for given a detector name (or prefix).
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_ERROR_VOID(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
void get_earth_pos_vel(EarthState *earth, EphemerisData *edat, LIGOTimeGPS *tGPS)
Get the position and velocity of the Earth at a given time.
Header file for the signal models functions used in parameter estimation code for known pulsar search...
TimeCorrectionType XLALAutoSetEphemerisFiles(CHAR **efile, CHAR **sfile, CHAR **tfile, PulsarParameters *pulsar, INT4 gpsstart, INT4 gpsend)
Automatically set the solar system ephemeris file based on environment variables and data time span.
Header file for the helper functions for the parameter estimation code for known pulsar searches usin...
int main(int argc, char *argv[])
void get_freq(REAL8 start, REAL8 deltaT, REAL8 freqharm, PulsarParameters *params, BarycenterInput bary, EphemerisData *edat, TimeCorrectionData *tdat, TimeCorrectionType ttype, REAL8Vector *freqs, REAL8Vector *dfsolar, REAL8Vector *dfbinary, REAL8Vector *dftotal)
void get_input_args(InputParams *inputParams, INT4 argc, CHAR *argv[])
structure containing the output parameters for the binary delay function
REAL8 deltaT
deltaT to add to TDB in order to account for binary
Basic output structure of LALBarycenterEarth.c.
Basic output structure produced by LALBarycenter.c.
REAL8 deltaT
(TDB) - (GPS)
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
The PulsarParameters structure to contain a set of pulsar parameters.
This structure will contain a vector of time corrections used during conversion from TT to TDB/TCB/Te...