Header file for the data reading functions for the parameter estimation code for known pulsar searches using the nested sampling algorithm. More...
Prototypes | |
void | read_pulsar_data (LALInferenceRunState *runState) |
Reads in the input gravitational wave data files, or creates fake data sets. More... | |
void | setup_from_par_file (LALInferenceRunState *runState) |
Reads in the parameters of the pulsar being searched for. More... | |
void | samples_prior (LALInferenceRunState *runState) |
Read in an ascii text file of nested samples, convert to posterior samples and create k-d tree. More... | |
Header file for the data reading functions for the parameter estimation code for known pulsar searches using the nested sampling algorithm.
Definition in file ppe_readdata.h.
Go to the source code of this file.
void read_pulsar_data | ( | LALInferenceRunState * | runState | ) |
Reads in the input gravitational wave data files, or creates fake data sets.
The function will check whether data files are being input of fake data is to be generated. If using real data the detectors
command line input must list the names of the detectors from which each of the data sets comes, with names separated by commas - allowed detector names are H1, H2, L1, V1, G1 or T1, for LIGO Hanford Observatory 1, LIGO Hanford Observatory 2, LIGO Livingston Observatory, Virgo, GEO600/HF and TAMA300 respectively. If requiring fake data to be generated then the fake-data
command line argument must list the detectors for which fake data is required (again separated by commas) - these can be the same names as above, although if an 'A' is appended to the LIGO of Virgo detector name then the Advanced detector is assumed (for use if generating data from designed sensitivity curves).
If generating fake data the noise floor can either be created using models of the detector design sensitivities (if just fake-data
is set), or with noise levels defined using the fake-psd
command line argument. If using fake-psd
it should list the signle-sided power spectral density required for each detector listed in fake-data
(again separated by commas). If using the design sensitivity models the par-file
argument will be used to find the noise at the correct frequency, which is here assumed to be twice the rotation frequency. The start time (in GPS seconds), data length (in seconds) and sample interval (in seconds) can be specified for each fake data set by supplying comma separated lists to the fake-starts
, fake-lengths
and fake-dt
command line arguments. By default these values are GPS 900000000 (13th July 2008 at 15:59:46 UTC), 86400 seconds (1 solar day) and 60 seconds (1/60 Hz sample rate) respectively. The fake data is drawn from a normal distribution using XLALNormalDeviates
and scaled with the appropriate PSD.
The number of data files required to be read in, or number of fake data sets generated depends on the pulsar model type, which is specified by the number of frequency harmonics given by the harmonics
command line argument. This should be a list of comma separated values giving the frequency of the signal harmonics to be included. E.g.
harmonics
input would just be 2
. This requires that for each specified detector there is one input file containing data heterodyned at twice the rotation frequency of the pulsar. harmonics
input would be 1
,2. This requires that for each specified detector there are two input files containing data heterodyned and the rotation frequency and twice the rotation frequency (these must be in the same order as the harmonics are listed). The default model, if none is specified, is the triaxial source model with emission at just twice the rotation frequency. At the moment only these two models above can be used, although this could be expanded in the future.
If creating fake data for a specific model then the number of PSDs, start time, lengths and sample intervals specified must be equivalent to the number of input files that would have been required e.g. if using the pinned superfluid model and requiring data for H1 and L1 then four fake PSDs would be required (the first pair at the pulsars rotation frequency and twice that in H1, and the seconds pair at the pulsars rotation frequency and twice that in L1). These most be specified in the same order as the detectors.
Any new models added can require and arbitrary number of inputs for a given detector, however the heterodyned frequencies of each input must be hardcoded into the function.
If using real data the files must be specified in the input-files
command line argument - these should be comma separated for multiple files and be in the same order at the associated detector from which they came given by the detectors
command. Any potentially spuriously large data values, with an absolute value of greater than 1e-18 will be vetoed when the data in read in. If requiring a different threshold for the veto (e.g., you are working with very low frequency data, or simulated data with a different scaling) then the value can be changed by setting it with the --veto-threshold
command line argument.
The function also checks that valid Earth and Sun ephemeris files (from the lalpulsar suite) are set with the ephem-earth
and ephem-sun
arguments, and that a valid output file for the nested samples is set via the outfile
argument.
The function will by default also call chop_n_merge()
for each data set, which will split the data into chunks during which it can be considered Gaussian and stationary. The command line arguments chunk-min
and chunk-max
can be used to specify hardwire minimum and maximum lengths of chunks that are allowable. By default the maximum chunk length is 0, which corresponds to no maximum value being set. If the --oldChunks
flag is set then data will be split as in the older version of the parameter estimation code, in which the chunk length is fixed, except for the possibility of shorter segments at the end of science segments.
The log_factorial
array is also filled in with values of the log of the factorial of all numbers up to the maximum length of the data. This is used in likelihood calculations.
runState | [in] A pointer to the LALInferenceRunState |
Definition at line 100 of file ppe_readdata.c.
void setup_from_par_file | ( | LALInferenceRunState * | runState | ) |
Reads in the parameters of the pulsar being searched for.
This function reads in a pulsars parameters from the specified TEMPO-style .par file given by par-file
using XLALReadTEMPOParFile
. This file must be specified and should contain at least the pulsars frequency, right ascension and declination (any value not included will be zero by default). The file should contain the parameters with which the detector data was heterodyned, as these are used to produce a signal phase template based on this assumption.
A example .par file may look like
which shows several parameters mostly defined by the parameter name and a parameter value. However, the F0
value contains 4 items. If a parameter has a 1
as the third entry then it means that this was a parameter that was fit by TEMPO with the entry after the 1
being the 1 standard deviation error on that parameter. For parameters where an error is present the code will attempt to search over that parameter using a Gaussian prior defined by the 1 \( \sigma \) error value. Other parameters will be set as fixed by default. These can be overridden by the prior file values described in initialise_prior()
.
Based on the defined sky position defined in the par file a lookup table of the detector antenna response over time and polarisation will be set by setup_lookup_tables()
.
The function add_initial_variables()
is used to pass the parameter values from the .par file to the algorithm.
Using the parameters from the .par file the phase template, including the solar system and binary system barycentring time delays will be setup. These define the phase template used to perform the initial heterodyne, which is used as the reference in cases when phase parameters (other than the initial phase) are being searched over.
Values used for scaling the parameters (to avoid dynamic range issues) are initialised although will be set as default values.
runState | [in] A pointer to the LALInferenceRunState |
Definition at line 1084 of file ppe_readdata.c.
void samples_prior | ( | LALInferenceRunState * | runState | ) |
Read in an ascii text file of nested samples, convert to posterior samples and create k-d tree.
This function reads in an ascii file of nested samples, converted them into posterior samples and them add them to a k-d tree. The file name containing the samples must have been given as the command line argument sample-file
and there must be an accompanying file with the names of each column with the same file name with _params.txt appended.
It is assumed that the samples are in ascending log likelihood order. It is also assumed that variable values in the file (and are not likelihood-like values) are consistent with those given that have prior ranges defined in the prior file/par file (as these ranges will be used as bounds in a k-d tree created from this data).
As it is assumed that the points read in are from a previous nested sampling run the number of live points used for that run are also required to be given with the sample-nlive
argument. This will be used during the conversion to posterior samples.
If given the k-d tree cell size for using the posterior as a prior can be set with the prior-cell
argument, if not set this defaults to 32.
In the future this will be altered so as to also read in an XML file of samples.
NOTE: add the ability to read in multiple files and combine the posterior samples
runState | [in] A pointer to the LALInferenceRunState |
Definition at line 1250 of file ppe_readdata.c.