Next: cw-line-veto, Previous: convert-units, Up: Directory Index [Contents][Index]
compute the amplitude-vector {A^mu} for given amplitude-params, which can follow
multiple signals must correspond to different *lines* in those fields, i.e. column-vectors! the output consists of 4D line vectors Amu(,1:4), multiple lines corresponding to multiple signals
p0 = struct("h0", 1e-24, "cosi", 0, "psi", 0.33 * pi/4, "phi0", pi/5);
p = amplitudeVect2Params(amplitudeParams2Vect(p0));
assert(p.h0, p0.h0, 1e-3);
assert(p.cosi, p0.cosi, 1e-3);
assert(p.psi, p0.psi, 1e-3);
assert(p.phi0, p0.phi0, 1e-3);
compute amplitude-vector {A^mu} from (MLDC) amplitudes {Amplitude, Inclination, Polarization, InitialPhase }
Amu is a row-vector for each signal, multiple signals being stored in multiple rows , the resulting fields in Amp are also column-vectors for multiple signals
Adapted from algorithm in LALEstimatePulsarAmplitudeParams()
A0 = 1e-24 * randn(1, 4); sert(amplitudeParams2Vect(amplitudeVect2Params(A0, "LIGO")), A0, 1e-3) sert(amplitudeParams2Vect(amplitudeVect2Params(A0, "MLDC")), A0, 1e-3)
check syntactic correctness of amplitude-parameter struct, and determine its convention: "LIGO" || "MLDC", depending on whether fields {Amplitude, Inclination, Polarization, InitialPhase}, or {h0, cosi, psi, phi0} are present. The presence of both types of fields is an error.
assert(checkAmplitudeParams(struct("h0", 1e-24, "cosi", 0, "psi", pi/4, "phi0", pi/5)), "LIGO")
Perform full software injections in generated SFTs using LALPulsar functions.
results structure
ref_timereference time in GPS seconds
start_timestart time in GPS seconds (default: ref_time - 0.5*time_span)
time_spanobservation time-span in seconds
detectorscomma-separated list of detector names
det_sqrt_sqrtSXsqrt(single-sided noise sqrtSX) to assume for each detector
ephemeridesEarth/Sun ephemerides from loadEphemerides()
sft_time_spanSFT time-span in seconds (default: 1800)
sft_overlapSFT overlap in seconds (default: 0)
sft_noise_windownumber of bins used when estimating SFT noise (default: 50)
inj_sqrt_sqrtSXinject Gaussian random noise with sqrt(single-sided noise sqrtSX) for each detector
*inj_h0injected h0 strain amplitude (default: 1.0)
*inj_cosiinjected cosine of inclination angle (default: random)
*inj_psiinjected polarisation angle (default: random)
*inj_phi0injected initial phase (default: random)
*inj_alphainjected right ascension (default: random)
*inj_deltainjected declination (default: random)
*inj_fndotinjected frequency/spindowns (default: 100 Hz)
*sch_alphasearched right ascension (default: same as injected)
*sch_deltasearched declination (default: same as injected)
*sch_fndotsearched frequency/spindowns (default: same as injected)
OrbitParamsoption that needs to be set to ’true’ to be able to specify the orbital parameters (default: false)
*inj_orbitasiniinjected orbital projected semi-major axis (normalised by the speed of light) in seconds (default: random)
*inj_orbitEccinjected orbital eccentricity (default: random)
*inj_orbitTpSSBinjected (SSB) time of periapsis passage (in seconds) (default: random)
*inj_orbitPeriodinjected orbital period (seconds) (default: random)
*inj_orbitArgpinjected argument of periapsis (radians) (default: random)
*sch_orbitasinisearched orbital projected semi-major axis (normalised by the speed of light) in seconds (default: same as injected)
*sch_orbitEccsearched orbital eccentricity (default: same as injected)
*sch_orbitTpSSBsearched (SSB) time of periapsis passage (in seconds) (default: same as injected)
*sch_orbitPeriodsearched orbital period (seconds) (default: same as injected)
*sch_orbitArgpsearched argument of periapsis (radians) (default: same as injected)
Dtermsnumber of Dirichlet terms to use in ComputeFstat() (default: number used by optimised hotloops)
See the tutorial on DoFstatInjections().
Compute the spin, orbital, and total components of a detector’s position and velocity at a list of GPS times, using LALPulsar
detector positions, in equatorial coordinates
detector velocities, in equatorial coordinates
spin components of detector positions
spin components of detector velocities
orbital components of detector positions
orbital components of detector velocities
gps_timeslist of GPS times
detectorname of detector (default: H1)
motiontype of motion (default: spin+orbit)
ephemeridesEarth/Sun ephemerides from loadEphemerides()
try
  lal; lalpulsar;
catch
  disp("skipping test: LALSuite bindings not available"); return;
end_try_catch
[p, v, sp, sv, op, ov] = getDetectorPosVel("gps_times", 800000000 + 100*(0:5));
assert(p, sp + op, 1e-3);
assert(v, sv + ov, 1e-3);
Perform signal injection and (area-search) recovery using HierarchSearchGCT
structure containing various histograms of measured statistics and mismatches from the injection+recovery runs, and
Ntrials(optional) number of repeated injection+recovery trials to perform [default: 1]
timestampsFilesCSV list of SFT timestamp filenames
IFOsCSV list of IFO names (eg "H1,L1,...")
segmentListfilename of segment list (containing lines of the form "startGPS endGPS\n")
inj_sqrtSXinjections: (optional) CSV list of per-detector noise-floor sqrt(PSD) to generate
inj_h0injections: signal amplitude ’h0’ of signals
inj_SNRinjections: alternative: signal-to-noise ratio ’SNR’ of signals
inj_AlphaRangeinjections: range of sky-position alpha to (isotropically) draw from [default: [0, 2pi]]
inj_DeltaRangeinjections: range of sky-position delta to (isotropically) draw from [default: [-pi/2, pi/2]]
inj_FreqRangeinjections: range of signal frequencies to draw from
inj_fkdotRangeinjections: [numSpindowns x 2] ranges of spindown-values to draw from [default: []]
dFreqsearch: frequency resolution
dfkdotsearch: numSpindowns vector of spindown resolutions to use in search
gammaRefinesearch: numSpindowns vector of ’gammeRefine[s]’ refinement factors to use
skyGridFilesearch: sky-grid file to use
sch_Nskysearch-box: number of nearest-neighbor skygrid points to use around injection
sch_Nfreqsearch-box: number of frequency bins to use around injection frequency
sch_Nfkdotsearch-box: number of spindown-bins to use around injection spindown-value
FstatMethodsearch: F-statistic method to use: "DemodBest", "ResampBest", ...
computeBSGLsearch: additionally compute and histogram B_S/GL statistic values
Fstar0search: BSGL parameter ’Fstar0sc’
nCandsearch: number of toplist candidates to keep
GCT_binarywhich GCT executable to use for searching
cleanupboolean: remove intermediate output files at the end or not
if isempty(file_in_path(getenv("PATH"), "lalapps_HierarchSearchGCT"))
  disp("skipping test: LALApps programs not available"); return;
endif
output = nthargout(2, @system, "lalapps_HierarchSearchGCT --version");
LALApps_version = versionstr2hex(nthargout(5, @regexp, output, "LALApps: ([0-9.]+)"){1}{1,1});
if LALApps_version <= 0x06210000
  disp("cannot run test as version of lalapps_HierarchSearchGCT is too old"); return;
endif
oldpwd = pwd;
basedir = mkpath(tempname(tempdir));
unwind_protect
  cd(basedir);
  args = struct;
  args.timestampsFiles = "H1.txt";
  args.IFOs = "H1";
  args.segmentList = "segs.txt";
  args.inj_sqrtSX = 1.0;
  args.inj_h0 = 1.0;
  args.inj_AlphaRange = [0, 2*pi];
  args.inj_DeltaRange = [-pi/2, pi/2];
  args.inj_FreqRange = [100, 100.01];
  args.inj_fkdotRange = [-1e-8, 0];
  args.dFreq = 1e-7;
  args.dfkdot = 1e-11;
  args.gammaRefine = 100;
  args.skyGridFile = "sky.txt";
  args.sch_Nsky = 5;
  args.sch_Nfreq = 5;
  args.sch_Nfkdot = 5;
  args.FstatMethod = "DemodBest";
  args.cleanup = true;
  fid = fopen(args.timestampsFiles, "w");
  for i = 1:10
    fprintf(fid, "%i\n", 800000000 + 1800*i);
  endfor
  fclose(fid);
  fid = fopen(args.segmentList, "w");
  fprintf(fid, "%i %i\n", 800000000 + 1800*[0, 5]);
  fprintf(fid, "%i %i\n", 800000000 + 1800*[5, 10]);
  fclose(fid);
  fid = fopen(args.skyGridFile, "w");
  for i = 1:50
    fprintf(fid, "%.5f %.5f\n", octforge_unifrnd(0+eps, 2*pi-eps), octforge_unifrnd(-pi/2+eps, pi/2-eps));
  endfor
  fclose(fid);
  fevalstruct(@injectionRecoveryGCT, args);
unwind_protect_cleanup
  cd(oldpwd);
end_unwind_protect
loads a ’candidate-file’ from lalapps_ComputeFStatistic_v2 --outputLoudest=cand.file
and returns a struct containing the data
if isempty(file_in_path(getenv("PATH"), "lalapps_ComputeFstatistic_v2"))
  disp("skipping test: LALApps programs not available"); return;
endif
output = nthargout(2, @system, "lalapps_ComputeFstatistic_v2 --version");
LALApps_version = versionstr2hex(nthargout(5, @regexp, output, "LALApps: ([0-9.]+)"){1}{1,1});
if LALApps_version <= 0x06210000
  disp("cannot run test as version of lalapps_ComputeFstatistic_v2 is too old"); return;
endif
args = struct;
args.Alpha = 1.2;
args.Delta = 3.4;
args.Freq = 100;
args.f1dot = -1e-8;
args.Tsft = 1800;
args.IFOs = "H1";
args.injectSqrtSX = 1.0;
args.timestampsFiles = tempname(tempdir);
args.outputLoudest = tempname(tempdir);
fid = fopen(args.timestampsFiles, "w");
fprintf(fid, "800000000\n800001800\n800003600\n");
fclose(fid);
runCode(args, "lalapps_ComputeFstatistic_v2");
cand_file = loadCandidateFile(args.outputLoudest);
assert(isstruct(cand_file));
Load Earth and Sun ephemerides from LALPulsar.
structure containing ephemerides
earth_fileEarth ephemerides file (default: earth00-40-DE405.dat.gz)
sun_fileSun ephemerides file (default: sun00-40-DE405.dat.gz)
try
  lal; lalpulsar;
catch
  disp("skipping test: LALSuite bindings not available"); return;
end_try_catch
ephemerides = loadEphemerides();
ephemerides = loadEphemerides();
ephemerides = loadEphemerides();
Predict single-segment F-statistic computation time per frequency bin per detector (tauF_core and tauF_buffer)
and corresponding memory requirements (MBWorkspace, MBDataPerDetSeg) for both Resampling and Demod Fstat methods.
See the F-stat timing notes at https://dcc.ligo.org/LIGO-T1600531-v4 for a detailed description of the F-statistic timing model and notation.
The estimate is for one coherent segment of length Tcoh, whileTspan is only used to correctly deal with the GCT code’s handling of multi-segment searches, which
can affect timing and memory requirements for each segment. In the case of Weave, however, use Tspan = Tcoh [default].
Tcohcoherent segment length
Tspantotal data time-span [Default: Tcoh].
Note: this is used to estimate the total memory in the case of the GCT search code,
which load the full frequency band of data over all segments. In the case of the
Weave code, the SFT frequency band is computed for each segment separately, so
in this case one should use Tspan==Tcoh to correctly estimate the timing and memory!
Freq0start search frequency
FreqBandsearch frequency band
dFreqsearch frequency spacing
f1dot0f1dotBandfirst-order spindown range [f1dot0, f1dot0+f1dotBand] [Default: 0]
f2dot0f2dotBand2nd-order spindown range [f2dot0,f2dot0+f2dotBand] [Default: 0]
Dtermsnumber of Dterms used in sinc-interpolation [Default: 8]
Nsftnumber of SFTs (for single segment, single detector) [Default: Nsft=Tcoh/Tsft]
TsftSFT length [Default: 1800]
refTimeShiftoffset of reference time from starttime, measured in units of Tspan, ie refTimeShift = (refTime - startTime)/Tspan [Default: 0.5]
binaryMaxAsiniMaximum projected semi-major axis a*sini/c (= 0 for isolated sources) [Default: 0]
binaryMinPeriodMinimum orbital period (s); must be 0 for isolated signals [Default: 0]
binaryMaxEccMaximal binary eccentricity: must be 0 for isolated signals [Default: 0]
resampFFTPowerOf2enforce FFT length to be a power of two (by rounding up) [Default: true]
tau0_FbinResampling timing coefficient for contributions scaling with output frequency bins NFbin
tau0_FFTResampling timing coefficient for FFT performance. Can be 2-element vector [t1, t2]: use t1 if log2(NsampFFT) <= 18, t2 otherwise
tau0_spinResampling timing coefficient for applying spin-down corrections
tau0_baryResampling timing coefficient (buffered) barycentering (contributes to tauF_buffer)
tau0_coreLDDemod timing coefficient for core F-stat time
tau0_bufferLDDemod timing coefficient for computation of buffered quantities
Two structs resampInfo and demodInfo with fields:
tauF_coreFstat time per frequency bin per detector excluding time to compute buffered quantities (eg barycentering) [in seconds]
tauF_bufferFstat time per frequency bin per detector for computing all the buffered quantities once [in seconds]
The effective F-stat time per frequency bin per detector is therefore
tauF_eff = tauF_core + b * tauF_buffer, where b = 1/N_{f1,f2,...} is the fraction of calls to XLALComputeFstat() where the buffer can be re-used
l2NsampFFTresamp only log_2(NsampFFT) where NsampFFT is the number of FFT samples
MBWorkspaceresamp only memory for (possibly shared) workspace [in MBytes]
MBDataPerDetSegmemory to hold all data per detector, per-segment (original+buffered) [in MBytes] ie total data memory would be
memData[all] = Nseg * Ndet * memDataPerDetSeg
try
  lal; lalpulsar;
catch
  disp("skipping test: LALSuite bindings not available"); return;
end_try_catch
[resampInfo, demodInfo] = predictFstatTimeAndMemory("Tcoh", 86400, "Freq0", 100, "FreqBand", 1e-2, "dFreq", 1e-7);
assert(isstruct(resampInfo));
assert(isfield(resampInfo, "tauF_core"));
assert(resampInfo.tauF_core > 0);
assert(isfield(resampInfo, "tauF_buffer"));
assert(resampInfo.tauF_buffer > 0);
assert(isfield(resampInfo, "MBDataPerDetSeg"));
assert(resampInfo.MBDataPerDetSeg > 0);
assert(isstruct(demodInfo));
assert(isfield(demodInfo, "tauF_core"));
assert(demodInfo.tauF_core > 0);
assert(isfield(demodInfo, "tauF_buffer"));
assert(demodInfo.tauF_buffer > 0);
assert(isfield(demodInfo, "MBDataPerDetSeg"));
assert(demodInfo.MBDataPerDetSeg > 0);
generate random-parameters for ’numSignals’ (default=1, returns a colunm-vector) signals within given ranges and return the signal-parameters in a struct sigparams = [h0, cosi, psi, phi0, alpha, delta, f, f1dot, f2dot, f3dot]
assert(isstruct(randSignalParams(struct("h0", 1e-24, "cosi", 0, "psi", pi/4, "phi0", pi/5))))
read a given SFT-file and return its meta-info (header) and data as a struct: ret = {version; epoch; Tsft; f0; Band; SFTdata }
typedef struct tagSFTHeader {
   REAL8  version;              /* SFT version-number (currently only 1.0 allowed )*/
   INT4   gpsSeconds;           /* gps start-time */
   INT4   gpsNanoSeconds;
   REAL8  timeBase;             /* length of data-stretch in seconds */
   INT4   fminBinIndex;         /* first frequency-index contained in SFT */
   INT4   length;               /* number of frequency bins */
   /* v2-specific part: */
   INT8 crc64;                  /* 64 bits */
   CHAR detector[2];
   CHAR padding[2];
   INT comment_length;
} SFTHeader;
CHAR[comment_length] comment;
sft = readSFT(fullfile(fileparts(file_in_loadpath("readSFT.m")), "SFT-good"));
Next: cw-line-veto, Previous: convert-units, Up: Directory Index [Contents][Index]