35#ifdef LALPULSAR_CUDA_ENABLED
37#include <cuda_runtime_api.h>
40#include <lal/LogPrintf.h>
41#include <lal/UserInput.h>
42#include <lal/Random.h>
44int main(
int argc,
char *argv[] )
57 BOOLEAN validate_sft_files, interpolation, lattice_rand_offset, mean2F_hgrm,
segment_info, simulate_search, time_search, cache_all_gc, strict_spindown_bounds;
60 REAL8 sft_timebase, semi_max_mismatch, coh_max_mismatch, ckpt_output_period, ckpt_output_exit, lrs_Fstar0sc, nc_2Fth;
63 UINT4 sky_patch_count, sky_patch_index, freq_partitions, f1dot_partitions, Fstat_run_med_window, Fstat_Dterms, toplist_limit,
rand_seed, cache_max_size;
64 int lattice, Fstat_method, Fstat_SSB_precision, toplists, extra_statistics, recalc_statistics;
66 .Fstat_Dterms = Fstat_opt_args.
Dterms,
67 .Fstat_SSB_precision = Fstat_opt_args.
SSBprec,
73 .f1dot_partitions = 1,
76 .toplist_limit = 1000,
89 setup_file,
STRING,
'S', REQUIRED,
90 "Setup file generated by lalpulsar_WeaveSetup; the segment list, parameter-space metrics, and other required data. "
94 "Output file which stores all quantities computed by lalpulsar_Weave. "
101 sft_files,
STRING,
'I', NODEFAULT,
102 "Pattern matching the SFT files to be analysed. Possibilities are:\n"
103 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'"
106 validate_sft_files,
BOOLEAN,
'V', DEVELOPER,
107 "Validate the checksums of the SFTs matched by " UVAR_STR( sft_files )
" before loading them into memory. "
110 sft_timebase,
REAL8,
't', NODEFAULT,
111 "Generate SFTs with this timebase instead of loading from files. "
114 sft_timestamps_files, STRINGVector,
'T', DEVELOPER,
115 "Files containing timestamps for the generated SFTs; if not given, SFTs with contiguous timestamps are generated. "
116 "Arguments correspond to the detectors in the setup file given by " UVAR_STR( setup_file )
117 "; for example, if the setup file was created with " UVAR_STR(
detectors )
" set to 'H1,L1', then an argument of "
118 "'t1.txt,t2.txt' to this option will read H1 timestamps from the file 't1.txt', and L1 timestamps from the file 't2.txt'. "
119 "The timebase of the generated SFTs is specified by " UVAR_STR( sft_timebase )
". "
122 sft_noise_sqrtSX, STRINGVector,
'p', NODEFAULT,
123 "Inject fake Gaussian noise with these amplitude spectral densities [sqrt(Sh)] into the generated SFTs. "
124 "Arguments correspond to the detectors in the setup file given by " UVAR_STR( setup_file )
125 "; for example, if the setup file was created with " UVAR_STR(
detectors )
" set to 'H1,L1', then an argument of "
126 "'1.2,3.4' to this option will generate H1 SFTs with a noise sqrt(Sh) of 1.2, and L1 SFTs with a noise sqrt(Sh) of 3.4. "
134 "Inject a simulated signal, with phase parameters drawn randomly from the search parameter space, "
135 "and with a randomly-generated polarisation angle (psi) and initial phase (phi0). "
136 "The amplitude of the injection is specified by either 1 or 2 arguments to " UVAR_STR( random_injection )
":\n"
137 " - h0: generate a random cosine of inclination angle (cosi), then set aPlus=0.5*h0*(1+cosi^2), aCross=h0*cosi;\n"
138 " - aPlus,aCross: use the given plus- and cross-polarisation amplitudes."
146 alpha, RAJRange,
'a', NODEFAULT,
147 "Search parameter space in right ascension. "
148 "If not specified, an all-sky search is performed; otherwise " UVAR_STR(
delta )
" must also be specified. "
149 "Range for a partial-sky search is limited to PI radians. "
152 delta, DECJRange,
'd', NODEFAULT,
153 "Search parameter space in declination. "
154 "If not specified, an all-sky search is performed; otherwise " UVAR_STR(
alpha )
" must also be specified. "
157 sky_patch_count,
UINT4,
'K', DEVELOPER,
158 "Divide the entire sky into this number of ~equal-template-count patches. "
162 sky_patch_index,
UINT4,
'k', DEVELOPER,
163 "Search the sky patch given by this index, from zero to one less than " UVAR_STR( sky_patch_count )
". "
168 "Search parameter space in frequency, in Hertz. "
171 freq_partitions,
UINT4,
'F', DEVELOPER,
172 "Internally divide the frequency parameter space into this number of ~equal-width partitions. "
176 "Search parameter space in first spindown, in Hertz/second. "
179 f1dot_partitions,
UINT4,
'!', DEVELOPER,
180 "Internally divide the first spindown parameter space into this number of ~equal-width partitions. "
184 "Search parameter space in second spindown, in Hertz/second^2. "
188 "Search parameter space in third spindown, in Hertz/second^3. "
192 "Search parameter space in fourth spindown, in Hertz/second^4. "
193 "(Just in case a nearby supernova goes off!) "
196 strict_spindown_bounds,
BOOLEAN,
'0', DEVELOPER,
197 "Do not add padding to spindown parameter space bounds."
204 semi_max_mismatch,
REAL8,
's', REQUIRED,
205 "Maximum metric mismatch of the lattice tiling on which semicoherent quantities are computed, e.g. F-statistics averaged over segments. "
208 coh_max_mismatch,
REAL8,
'c', NODEFAULT,
209 "Maximum metric mismatch of the per-segment lattice tilings on which coherent quantities are computed, e.g. coherent F-statistics. "
210 "If the search setup contains only 1 segment, then this option must not be specified. "
213 interpolation,
BOOLEAN,
'i', OPTIONAL,
214 "If TRUE, perform interpolation from the semicoherent lattice tiling to the per-segment coherent lattice tilings; "
215 UVAR_STR( coh_max_mismatch )
" must also be specified in this case. "
216 "If FALSE, turn off interpolation and use the same lattice tiling for both semicoherent and coherent computations; "
217 UVAR_STR( coh_max_mismatch )
" must not be specified in this case. "
221 "Type of lattice used to generate the lattice tilings. "
224 lattice_rand_offset,
BOOLEAN,
'j', DEVELOPER,
225 "Offset the physical parameter-space origin of the lattice tilings by a random fraction of the lattice step size. "
226 "This is important when performing mismatch studies to ensure that the mismatch distribution is fully sampled. "
234 "Method used to calculate the F-statistic. "
237 Fstat_run_med_window,
UINT4,
'w', DEVELOPER,
238 "Size of the running median window used to normalise SFTs and compute noise weight. "
241 Fstat_assume_sqrtSX, STRINGVector,
'q', DEVELOPER,
242 "Assume that the noise in the SFTs have known amplitude spectral densities [sqrt(Sh)], which are given by the arguments to "
243 "this option, and normalise the SFTs by these given sqrt(Sh). "
244 "Arguments correspond to the detectors in the setup file given by " UVAR_STR( setup_file )
245 "; for example, if the setup file was created with " UVAR_STR(
detectors )
" set to 'H1,L1', then an argument of "
246 "'3.2,4.3' to this option will assume that H1 SFTs contain noise with a sqrt(Sh) of 3.2, and L1 SFTs contain noise with a sqrt(Sh) of 4.3. "
247 "If this option is not given, the SFTs are normalised using noise sqrt(Sh) estimated from the SFTs themselves. "
250 Fstat_Dterms,
UINT4, 0, DEVELOPER,
251 "Number of Dirichlet kernel terms to use in computing the F-statistic. May not be available for all F-statistic methods. "
255 "Precision in calculating the barycentric transformation. "
262 lrs_Fstar0sc,
REAL8, 0, OPTIONAL,
263 "(Semi-coherent) transition-scale parameter 'Fstar0sc' (=Nseg*Fstar0coh) for B_S/GL.. family of statistics."
266 lrs_oLGX, STRINGVector, 0, OPTIONAL,
267 "Per-detector line-vs-Gauss prior odds 'oLGX' (Defaults to oLGX=1/Ndet) for B_S/GL.. family of statistics."
270 nc_2Fth,
REAL8, 0, OPTIONAL,
271 "Number count: per-segment 2F threshold value."
278 toplist_limit,
UINT4,
'n', OPTIONAL,
279 "Maximum number of candidates to return in an output toplist; if 0, all candidates are returned. "
283 "Sets which combination of toplists to return in the output file given by " UVAR_STR(
output_file )
":\n"
287 mean2F_hgrm,
BOOLEAN, 0, DEVELOPER,
288 "Output a histogram of all mean multi-Fstatistics computed by the search. "
292 "Sets which ('stage 0') extra statistics to compute and return in the output file given by " UVAR_STR(
output_file )
":\n"
298 "Sets which extra *recalc* statistics to compute on final toplist without interpolation. See " UVAR_STR( extra_statistics )
" for statistics descriptions.\n"
303 "Output various information regarding the segment list, e.g. number of SFTs within each segment. "
310 ckpt_output_file,
STRING,
'C', DEVELOPER,
311 "File to which to periodically write checkpoints of output results. "
314 ckpt_output_period,
REAL8,
'z', DEVELOPER,
315 "Write checkpoints of output results after this time period (in seconds) has elapsed. "
318 ckpt_output_exit,
REAL8, 0, DEVELOPER,
319 "Write a checkpoint of output results after this fraction of the search has been completed, then exit. "
320 "Arguments to this option must be in the range [0,1]. "
321 "(This option is only really useful for testing the checkpointing feature.) "
329 "Random seed used to initialise random number generators. "
332 simulate_search,
BOOLEAN, 0, DEVELOPER,
333 "Simulate search; perform all search actions apart from computing any results. "
334 "If SFT parameters (i.e. " UVAR_STR( sft_files )
" or " UVAR_STR( sft_timebase )
") are supplied, simulate search with full memory allocation, i.e. with F-statistic input data, cached coherent results, etc. "
335 "Otherwise, perform search with minimal memory allocation, i.e. do not allocate memory for any data or results. "
338 time_search,
BOOLEAN, 0, DEVELOPER,
339 "Collect and output detailed timing information from various stages of the search pipeline. "
342 cache_max_size,
UINT4, 0, DEVELOPER,
343 "Limit the size of the internal caches, used to store intermediate results, to this number of items per segment. "
344 "If zero, the caches will grow in size to store all items that are still required. "
345 "Has no effect when performing a fully-coherent single-segment search, or a non-interpolating search. "
348 cache_all_gc,
BOOLEAN, 0, DEVELOPER,
349 "If TRUE, try to instead remove as many items as possible, provided that they are no longer required. "
350 "If FALSE, whenever an item is added to the internal caches, at most one item that may no longer be required is removed. "
351 "Has no effect when performing a fully-coherent single-segment search, or a non-interpolating search. "
371 uvar->simulate_search ||
UVAR_SET2( sft_files, sft_timebase ) == 1,
372 "Exactly one of " UVAR_STR2OR( sft_files, sft_timebase )
" must be specified" );
374 !
UVAR_SET( sft_files ) || !
UVAR_ALLSET3( sft_timebase, sft_timestamps_files, sft_noise_sqrtSX ),
375 UVAR_STR( sft_files )
" are mutually exclusive with " UVAR_STR3AND( sft_timebase, sft_timestamps_files, sft_noise_sqrtSX ) );
380 !
UVAR_SET( sft_timebase ) || uvar->sft_timebase > 0,
381 UVAR_STR( sft_timebase )
" must be strictly positive" );
386 !
UVAR_SET( random_injection ) || uvar->random_injection->length <= 2,
387 UVAR_STR( random_injection )
" must be passed either 1 or 2 arguments" );
398 UVAR_SET2( sky_patch_count, sky_patch_index ) != 1,
399 UVAR_STR( sky_patch_count )
" requires " UVAR_STR( sky_patch_index )
" and vice versa" );
401 !
UVAR_SET( sky_patch_index ) || uvar->sky_patch_index < uvar->sky_patch_count,
402 UVAR_STR( sky_patch_index )
" must be positive and strictly less than " UVAR_STR( sky_patch_count ) );
404 uvar->freq_partitions > 0,
405 UVAR_STR( freq_partitions )
" must be strictly positive" );
407 uvar->f1dot_partitions > 0,
408 UVAR_STR( freq_partitions )
" must be strictly positive" );
417 UVAR_STR( f2dot )
" must be specified if " UVAR_STR( f3dot )
" is specified" );
420 UVAR_STR( f3dot )
" must be specified if " UVAR_STR( f4dot )
" is specified" );
425 uvar->semi_max_mismatch > 0,
426 UVAR_STR( semi_max_mismatch )
" must be strictly positive" );
428 !
UVAR_SET( coh_max_mismatch ) || uvar->coh_max_mismatch > 0,
429 UVAR_STR( coh_max_mismatch )
" must be strictly positive" );
445 UVAR_STR2AND( ckpt_output_period, ckpt_output_exit )
" are mutually exclusive" );
447 !
UVAR_SET( ckpt_output_period ) || uvar->ckpt_output_period > 0,
448 UVAR_STR( ckpt_output_period )
" must be strictly positive" );
450 !
UVAR_SET( ckpt_output_exit ) || ( 0 <= uvar->ckpt_output_exit && uvar->ckpt_output_exit <= 1 ),
451 UVAR_STR( ckpt_output_exit )
" must be in range [0,1]" );
457 UVAR_STR2AND( time_search, simulate_search )
" are mutually exclusive" );
460 UVAR_STR2AND( time_search, ckpt_output_file )
" are mutually exclusive" );
495 const UINT4 ndetectors = setup.detectors->length;
496 const UINT4 nsegments = setup.segments->length;
509 WeaveStatisticsParams *statistics_params =
XLALCalloc( 1,
sizeof( *statistics_params ) );
513 statistics_params->nsegments = nsegments;
514 statistics_params->ref_time = setup.ref_time;
524 statistics_params->coh_input =
XLALCalloc( nsegments,
sizeof( statistics_params->coh_input[0] ) );
529 REAL4 *oLGX_p = NULL;
531 if ( uvar->lrs_oLGX != NULL ) {
532 XLAL_CHECK_MAIN( uvar->lrs_oLGX->length == ndetectors,
XLAL_EINVAL,
"length(lrs-oLGX) = %d must equal number of detectors (%d)'\n", uvar->lrs_oLGX->length, ndetectors );
536 const BOOLEAN useLogCorrection = 0;
537 statistics_params->BSGL_setup =
XLALCreateBSGLSetup( ndetectors, uvar->lrs_Fstar0sc, oLGX_p, useLogCorrection, nsegments );
541 statistics_params->nc_2Fth = uvar->nc_2Fth;
544 if ( uvar->mean2F_hgrm ) {
551 if ( nsegments == 1 ) {
554 UVAR_STR( coh_max_mismatch )
" must not be specified if setup file '%s' contains only 1 segment", uvar->setup_file );
556 !
UVAR_SET( interpolation ) || !uvar->interpolation,
557 UVAR_STR( interpolation )
" must either be FALSE or not specified if setup file '%s' contains only 1 segment", uvar->setup_file );
558 }
else if ( uvar->interpolation ) {
561 UVAR_STR( coh_max_mismatch )
" must be specified if " UVAR_STR( interpolation )
" is true" );
565 UVAR_STR( coh_max_mismatch )
" must not be set if " UVAR_STR( interpolation )
" is false" );
572 const BOOLEAN interpolation = ( nsegments > 1 ) ? uvar->interpolation : 0;
573 const double semi_max_mismatch = uvar->semi_max_mismatch;
574 const double coh_max_mismatch = interpolation ? uvar->coh_max_mismatch : semi_max_mismatch;
575 if ( nsegments == 1 ) {
576 LogPrintf(
LOG_NORMAL,
"Performing a fully-coherent single-segment search with maximum (semicoherent) mismatch = %.15g\n", semi_max_mismatch );
577 }
else if ( !interpolation ) {
578 LogPrintf(
LOG_NORMAL,
"Performing a non-interpolating search with maximum (semicoherent) mismatch = %.15g\n", semi_max_mismatch );
580 LogPrintf(
LOG_NORMAL,
"Performing an interpolating search with maximum semicoherent mismatch = %.15g, maximum coherent mismatch = %.15g\n", semi_max_mismatch, coh_max_mismatch );
585 LogPrintf(
LOG_NORMAL,
"Metric fiducial frequency set to maximum search frequency = %.15g Hz\n", uvar->freq[1] );
591 const double uvarspins[][2] = {
592 { uvar->f1dot[0], uvar->f1dot[1] },
593 { uvar->f2dot[0], uvar->f2dot[1] },
594 { uvar->f3dot[0], uvar->f3dot[1] },
595 { uvar->f4dot[0], uvar->f4dot[1] }
599 size_t nmetricspins = 0;
602 XLAL_CHECK_MAIN( nmetricspins <= nuvarspins,
XLAL_EINVAL,
"Number of spindowns from metrics (%zu) computed in setup file '%s' must be <= %zu", nmetricspins, uvar->setup_file, nuvarspins );
603 const size_t ninputspins =
UVAR_SET4(
f1dot, f2dot, f3dot, f4dot );
604 XLAL_CHECK_MAIN( ninputspins <= nmetricspins,
XLAL_EINVAL,
"Number of spindowns from user input (%zu) must be <= number of spindowns from metrics (%zu) computed in setup file '%s'", ninputspins, nmetricspins, uvar->setup_file );
607 const size_t ndim = 2 + 1 + nmetricspins;
612 const size_t ncohtiles = ( nsegments > 1 ) ? nsegments : 0;
615 const size_t ntiles = ncohtiles + 1;
618 const size_t isemi = ntiles - 1;
622 for (
size_t i = 0;
i < ntiles; ++
i ) {
630 for (
size_t i = 0;
i < nsegments; ++
i ) {
631 rssky_metric[
i] = setup.metrics->coh_rssky_metric[
i];
632 rssky_transf[
i] = setup.metrics->coh_rssky_transf[
i];
634 rssky_metric[isemi] = setup.metrics->semi_rssky_metric;
635 rssky_transf[isemi] = setup.metrics->semi_rssky_transf;
647 double semi_sky_area = 0.0;
648 if (
UVAR_SET( sky_patch_count ) ) {
650 LogPrintf(
LOG_NORMAL,
"Search sky parameter space sky patch = %u of %u\n", uvar->sky_patch_index, uvar->sky_patch_count );
651 semi_sky_area = 4.0 *
LAL_PI / uvar->sky_patch_count;
654 LogPrintf(
LOG_NORMAL,
"Search sky parameter space right ascension = [%.15g, %.15g] rad\n", uvar->alpha[0], uvar->alpha[1] );
655 LogPrintf(
LOG_NORMAL,
"Search sky parameter space declination = [%.15g, %.15g] rad\n", uvar->delta[0], uvar->delta[1] );
656 semi_sky_area = ( uvar->alpha[1] - uvar->alpha[0] ) * ( sin( uvar->delta[1] ) - sin( uvar->delta[0] ) );
661 LogPrintf(
LOG_NORMAL,
"Search frequency parameter space = [%.15g, %.15g] Hz\n", uvar->freq[0], uvar->freq[1] );
662 for (
size_t s = 1;
s <= nmetricspins; ++
s ) {
665 LogPrintf(
LOG_NORMAL,
"Search %zu-order spindown parameter space = [%.15g, %.15g] Hz/s^%zu %s padding\n",
s, uvarspins[
s - 1][0], uvarspins[
s - 1][1],
s, uvar->strict_spindown_bounds ?
"without" :
"with" );
669 if (
UVAR_SET( lattice_rand_offset ) ) {
686 for (
size_t i = 0;
i < ncohtiles; ++
i ) {
710 for (
size_t i = 0;
i < ncohtiles; ++
i ) {
716 if (
UVAR_SET( lattice_rand_offset ) ) {
749 if ( uvar->validate_sft_files ) {
757 }
else if (
UVAR_SET( sft_timebase ) ) {
761 if (
UVAR_SET( sft_timestamps_files ) ) {
764 XLAL_CHECK_MAIN( uvar->sft_timestamps_files->length == ndetectors,
XLAL_EINVAL,
"Number SFT timestamp files (%i) is inconsistent with number of detectors (%i) in setup file '%s'", uvar->sft_timestamps_files->length, ndetectors, uvar->setup_file );
769 for (
size_t i = 0;
i < ndetectors; ++
i ) {
770 sft_timestamps->
data[
i]->
deltaT = uvar->sft_timebase;
771 LogPrintf(
LOG_NORMAL,
"Loaded SFT timestamps for detector '%s' from file '%s'\n", setup.detectors->data[
i], uvar->sft_timestamps_files->data[
i] );
779 LogPrintf(
LOG_NORMAL,
"Generated SFT timestamps for %i detectors, timebase = %.15g sec\n", ndetectors, uvar->sft_timebase );
792 if ( sft_catalog != NULL ) {
799 XLAL_CHECK_MAIN( strcmp( sft_catalog_detectors_string, setup_detectors_string ) == 0,
XLAL_EINVAL,
"List of detectors '%s' in SFT catalog differs from list of detectors '%s' in setup file '%s'", sft_catalog_detectors_string, setup_detectors_string, uvar->setup_file );
806 for (
size_t j = 0;
j < sft_catalog_view->
length; ++
j ) {
818 XLALFree( sft_catalog_detectors_string );
837 }
else if (
UVAR_SET( random_injection ) ) {
843 strcpy( inj->
name,
"random_injection" );
848 gsl_matrix_view random_point_matrix = gsl_matrix_view_array( random_point, ndim, 1 );
850 gsl_vector_view random_point_vector = gsl_vector_view_array( random_point, ndim );
857 if ( uvar->random_injection->length == 1 ) {
858 const REAL8 h0 = uvar->random_injection->data[0];
863 inj->
Amp.
aPlus = uvar->random_injection->data[0];
864 inj->
Amp.
aCross = uvar->random_injection->data[1];
870 Fstat_opt_args.
randSeed = uvar->rand_seed;
871 Fstat_opt_args.
SSBprec = uvar->Fstat_SSB_precision;
872 Fstat_opt_args.
Dterms = uvar->Fstat_Dterms;
881 const LALStringVector *Fstat_assume_sqrtSX =
UVAR_SET( Fstat_assume_sqrtSX ) ? uvar->Fstat_assume_sqrtSX : NULL;
884 for (
size_t i = 0;
i < nsegments; ++
i ) {
885 statistics_params->coh_input[
i] =
XLALWeaveCohInputCreate( setup.detectors, simulation_level, sft_catalog,
i, &setup.segments->segs[
i], min_phys[
i], max_phys[
i],
dfreq, setup.ephemerides, sft_noise_sqrtSX, Fstat_assume_sqrtSX, &Fstat_opt_args, statistics_params, 0 );
889 for (
size_t i = 0;
i < ndetectors; ++
i ) {
890 XLAL_CHECK_MAIN( 0 < statistics_params->n2F_det[
i] && statistics_params->n2F_det[
i] <= nsegments,
XLAL_EFAILED,
"Invalid number of per-detector F-statistics (%u) for detector '%s'", statistics_params->n2F_det[
i], setup.detectors->data[
i] );
899 for (
size_t i = 0;
i < nsegments; ++
i ) {
900 const size_t cache_max_size = interpolation ? uvar->cache_max_size : 1;
901 const BOOLEAN cache_all_gc = interpolation ? uvar->cache_all_gc : 0;
902 coh_cache[
i] =
XLALWeaveCacheCreate(
tiling[
i], interpolation, rssky_transf[
i], rssky_transf[isemi], statistics_params->coh_input[
i], cache_max_size, cache_all_gc );
917 WeaveSemiResults *semi_res = NULL;
928 UINT4 ckpt_output_count = 0;
931 if (
UVAR_SET( ckpt_output_file ) ) {
934 LogPrintf(
LOG_NORMAL,
"Trying to open output checkpoint file '%s' for reading ...\n", uvar->ckpt_output_file );
939 LogPrintf(
LOG_NORMAL,
"Output checkpoint file '%s' does not exist; no checkpoint will be loaded\n", uvar->ckpt_output_file );
942 LogPrintf(
LOG_NORMAL,
"Output checkpoint file '%s' exists; checkpoint will be loaded\n", uvar->ckpt_output_file );
946 XLAL_CHECK_MAIN( ckpt_output_count > 0,
XLAL_EIO,
"Invalid output checkpoint file '%s'", uvar->ckpt_output_file );
949 UINT4 toplist_limit = 0;
970 double wall_ckpt_elapsed = 0;
973 double wall_prog_elapsed = 0;
974 double wall_prog_period = 5.0;
977 BOOLEAN wall_prog_remain_print = 0;
978 double wall_prog_total_prev = 0;
985 while ( !search_complete ) {
994 UINT8 semi_index = 0;
995 const gsl_vector *semi_rssky = NULL;
998 UINT4 freq_partition_index = 0;
1000 if ( search_complete ) {
1003 }
else if ( expire_cache ) {
1004 for (
size_t i = 0;
i < nsegments; ++
i ) {
1016 for (
size_t i = 0;
i < nsegments; ++
i ) {
1022 UINT4 semi_nfreqs = 0;
1024 if ( semi_nfreqs == 0 ) {
1036 for (
size_t i = 0;
i < nsegments; ++
i ) {
1069 double wall_elapsed = 0, cpu_elapsed = 0;
1073 if ( wall_elapsed - wall_prog_elapsed >= wall_prog_period ) {
1083 const double wall_prog_total = wall_elapsed + wall_prog_remain;
1084 if ( wall_prog_remain_print || fabs( wall_prog_total - wall_prog_total_prev ) <= 0.1 * wall_prog_total_prev ) {
1086 wall_prog_remain_print = 1;
1088 wall_prog_total_prev = wall_prog_total;
1096#ifdef LALPULSAR_CUDA_ENABLED
1098 size_t CUDA_free_mem_B = 0;
1099 size_t CUDA_tot_mem_B = 0;
1102 const size_t CUDA_used_mem_B = CUDA_tot_mem_B - CUDA_free_mem_B;
1103 const REAL4 CUDA_used_mem_MB = CUDA_used_mem_B / ( 1024.0 * 1024.0 );
1104 const REAL4 CUDA_tot_mem_MB = CUDA_tot_mem_B / ( 1024.0 * 1024.0 );
1111 REAL4 cache_mean_max_size = 0;
1120 wall_prog_elapsed = wall_elapsed;
1121 wall_prog_period = GSL_MIN( 1200, wall_prog_period * 1.5 );
1126 if (
UVAR_SET( ckpt_output_file ) ) {
1132 const BOOLEAN do_ckpt_output_period =
UVAR_SET( ckpt_output_period ) && wall_elapsed - wall_ckpt_elapsed >= uvar->ckpt_output_period;
1133 const BOOLEAN do_ckpt_output_exit =
UVAR_SET( ckpt_output_exit ) && prog_per_cent >= 100.0 * uvar->ckpt_output_exit;
1134 if ( do_ckpt_output_period || do_ckpt_output_exit ) {
1143 ++ckpt_output_count;
1156 LogPrintf(
LOG_NORMAL,
"Wrote output checkpoint to file '%s' at %.3g%% complete, elapsed %.1f sec\n", uvar->ckpt_output_file, prog_per_cent, wall_elapsed );
1159 if ( do_ckpt_output_exit ) {
1166 wall_ckpt_elapsed = wall_elapsed;
1178 for (
size_t i = 0;
i < nsegments; ++
i ) {
1183 double wall_main = 0, cpu_main = 0;
1191 statistics_params->coh_input_recalc =
XLALCalloc( nsegments,
sizeof( statistics_params->coh_input_recalc[0] ) );
1197 for (
size_t i = 0;
i < nsegments; ++
i ) {
1198 statistics_params->coh_input_recalc[
i] =
XLALWeaveCohInputCreate( setup.detectors, simulation_level, sft_catalog,
i, &setup.segments->segs[
i], min_phys[
i], max_phys[
i], 0, setup.ephemerides, sft_noise_sqrtSX, Fstat_assume_sqrtSX, &Fstat_opt_args_recalc, statistics_params, 1 );
1202 for (
size_t i = 0;
i < ndetectors; ++
i ) {
1203 XLAL_CHECK_MAIN( 0 < statistics_params->n2F_det[
i] && statistics_params->n2F_det[
i] <= nsegments,
XLAL_EFAILED,
"Invalid number of per-detector F-statistics (%u) for detector '%s'", statistics_params->n2F_det[
i], setup.detectors->data[
i] );
1218 double wall_total = 0, cpu_total = 0;
1224 if ( search_complete ) {
1249 for (
size_t s = 1;
s <= ninputspins; ++
s ) {
1252 snprintf( keyword,
sizeof( keyword ),
"semiparam minf%zudot [Hz/s^%zu]",
s,
s );
1253 snprintf(
comment,
sizeof(
comment ),
"minimum %zu-order spindown range",
s );
1255 snprintf( keyword,
sizeof( keyword ),
"semiparam maxf%zudot [Hz/s^%zu]",
s,
s );
1256 snprintf(
comment,
sizeof(
comment ),
"maximum %zu-order spindown range",
s );
1261 for (
size_t i = 0;
i < ndim; ++
i ) {
1267 snprintf( keyword,
sizeof( keyword ),
"nsemitmpl %s", semi_stats->
name );
1272 UINT8 coh_nres = 0, coh_ntmpl = 0, semi_ntmpl = 0;
1291 if ( simulation_level == 0 ) {
1301 if ( uvar->segment_info ) {
1327 for (
size_t i = 0;
i < nsegments; ++
i ) {
1335 for (
size_t i = 0;
i < ntiles; ++
i ) {
1341 XLALFree( setup_detectors_string );
1355 if ( search_complete ) {
1361 return EXIT_SUCCESS;
WeaveCache * XLALWeaveCacheCreate(const LatticeTiling *coh_tiling, const BOOLEAN interpolation, const SuperskyTransformData *coh_rssky_transf, const SuperskyTransformData *semi_rssky_transf, WeaveCohInput *coh_input, const UINT4 max_size, const BOOLEAN all_gc)
Create a cache.
void XLALWeaveCacheQueriesDestroy(WeaveCacheQueries *queries)
Destroy storage for a series of cache queries.
int XLALWeaveCacheQuery(const WeaveCache *cache, WeaveCacheQueries *queries, const UINT4 query_index)
Query a cache for the results nearest to a given coherent point.
int XLALWeaveCacheQueriesFinal(WeaveCacheQueries *queries, PulsarDopplerParams *semi_phys, UINT4 *semi_nfreqs)
Finalise a series of cache queries.
int XLALWeaveCacheQueriesInit(WeaveCacheQueries *queries, const UINT8 semi_index, const gsl_vector *semi_rssky, const INT4 semi_left, const INT4 semi_right, const UINT4 freq_partition_index)
Initialise a series of cache queries.
int XLALWeaveCacheExpire(WeaveCache *cache)
Expire all items in the cache.
int XLALWeaveGetCacheMeanMaxSize(REAL4 *cache_mean_max_size, const size_t ncache, WeaveCache *const *cache)
Determine the mean maximum size obtained by caches.
void XLALWeaveCacheDestroy(WeaveCache *cache)
Destroy a cache.
int XLALWeaveCacheRetrieve(WeaveCache *cache, const WeaveCacheQueries *queries, const UINT4 query_index, const WeaveCohResults **coh_res, UINT8 *coh_index, UINT4 *coh_offset, WeaveSearchTiming *tim)
Retrieve coherent results for a given query, or compute new coherent results if not found.
WeaveCacheQueries * XLALWeaveCacheQueriesCreate(const LatticeTiling *semi_tiling, const SuperskyTransformData *semi_rssky_transf, const double dfreq, const UINT4 nqueries, const UINT4 nfreq_partitions)
Create storage for a series of cache queries.
int XLALWeaveCacheQueriesGetCounts(const WeaveCacheQueries *queries, UINT8 *coh_nres, UINT8 *coh_ntmpl, UINT8 *semi_ntmpl)
Get number of computed coherent results, and number of coherent and semicoherent templates.
int XLALWeaveCacheClear(WeaveCache *cache)
Clear all items in the cache from memory.
int XLALWeaveCacheWriteInfo(FITSFile *file, const size_t ncache, WeaveCache *const *cache)
Write various information from caches to a FITS file.
Module which caches computed coherent results.
int XLALWeaveSemiResultsComputeMain(WeaveSemiResults *semi_res, WeaveSearchTiming *tim)
Compute all remaining toplist-ranking semicoherent statistics (ie 'mainloop-statistics').
int XLALWeaveCohInputWriteInfo(FITSFile *file, const size_t ncoh_input, WeaveCohInput *const *coh_input)
Write various information from coherent input data to a FITS file.
int XLALWeaveCohInputWriteSegInfo(FITSFile *file, const size_t ncoh_input, WeaveCohInput *const *coh_input)
Write various segment information from coherent input data to a FITS file.
int XLALWeaveSemiResultsInit(WeaveSemiResults **semi_res, const WeaveSimulationLevel simulation_level, const UINT4 ndetectors, const UINT4 nsegments, const UINT8 semi_index, const PulsarDopplerParams *semi_phys, const double dfreq, const UINT4 semi_nfreqs, const WeaveStatisticsParams *statistics_params)
Create and initialise semicoherent results.
void XLALWeaveSemiResultsDestroy(WeaveSemiResults *semi_res)
Destroy final semicoherent results.
WeaveCohInput * XLALWeaveCohInputCreate(const LALStringVector *setup_detectors, const WeaveSimulationLevel simulation_level, const SFTCatalog *sft_catalog, const UINT4 segment_index, const LALSeg *segment, const PulsarDopplerParams *min_phys, const PulsarDopplerParams *max_phys, const double dfreq, const EphemerisData *ephemerides, const LALStringVector *sft_noise_sqrtSX, const LALStringVector *Fstat_assume_sqrtSX, FstatOptionalArgs *Fstat_opt_args, WeaveStatisticsParams *statistics_params, BOOLEAN recalc_stage)
Create coherent input data.
int XLALWeaveSemiResultsComputeSegs(WeaveSemiResults *semi_res, const UINT4 nsegments, const WeaveCohResults **coh_res, const UINT8 *coh_index, const UINT4 *coh_offset, WeaveSearchTiming *tim)
Add a new set of coherent results to the semicoherent results.
Module which computes coherent and semicoherent results.
int XLALFITSHeaderWriteUINT4(FITSFile UNUSED *file, const CHAR UNUSED *key, const UINT4 UNUSED value, const CHAR UNUSED *comment)
int XLALFITSHeaderWriteStringVector(FITSFile UNUSED *file, const CHAR UNUSED *key, const LALStringVector UNUSED *values, const CHAR UNUSED *comment)
FITSFile * XLALFITSFileOpenWrite(const CHAR UNUSED *file_name)
int XLALFITSFileWriteVCSInfo(FITSFile UNUSED *file, const LALVCSInfoList UNUSED vcs_list)
int XLALFITSFileWriteUVarCmdLine(FITSFile UNUSED *file)
FITSFile * XLALFITSFileOpenRead(const CHAR UNUSED *file_name)
int XLALFITSHeaderWriteUINT8(FITSFile UNUSED *file, const CHAR UNUSED *key, const UINT8 UNUSED value, const CHAR UNUSED *comment)
void XLALFITSFileClose(FITSFile UNUSED *file)
int XLALFITSHeaderWriteREAL8(FITSFile UNUSED *file, const CHAR UNUSED *key, const REAL8 UNUSED value, const CHAR UNUSED *comment)
int XLALFITSHeaderReadUINT4(FITSFile UNUSED *file, const CHAR UNUSED *key, UINT4 UNUSED *value)
void LALCheckMemoryLeaks(void)
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
static double double delta
int XLALWeaveOutputResultsAdd(WeaveOutputResults *out, const WeaveSemiResults *semi_res, const UINT4 semi_nfreqs)
Add semicoherent results to output.
int XLALWeaveOutputResultsWrite(FITSFile *file, const WeaveOutputResults *out)
Write output results to a FITS file.
int XLALWeaveOutputResultsReadAppend(FITSFile *file, WeaveOutputResults **out, UINT4 toplist_limit)
Read results from a FITS file and append to new/existing output results.
void XLALWeaveOutputResultsDestroy(WeaveOutputResults *out)
Free output results.
int XLALWeaveOutputResultsCompletionLoop(WeaveOutputResults *out)
Compute all the missing 'completion-loop' statistics for all toplist entries.
WeaveOutputResults * XLALWeaveOutputResultsCreate(const LIGOTimeGPS *ref_time, const size_t nspins, WeaveStatisticsParams *statistics_params, const UINT4 toplist_limit, const BOOLEAN mean2F_hgrm)
Create output results.
Module which handles the output results.
int XLALWeaveSearchIteratorNext(WeaveSearchIterator *itr, BOOLEAN *iteration_complete, BOOLEAN *expire_cache, UINT8 *semi_index, const gsl_vector **semi_rssky, INT4 *semi_left, INT4 *semi_right, UINT4 *repetition_index)
Advance to next state of iterator.
REAL8 XLALWeaveSearchIteratorProgress(const WeaveSearchIterator *itr)
Return progress of iterator as a percentage.
void XLALWeaveSearchIteratorDestroy(WeaveSearchIterator *itr)
Destroy iterator.
int XLALWeaveSearchIteratorSave(const WeaveSearchIterator *itr, FITSFile *file)
Save state of iterator to a FITS file.
WeaveSearchIterator * XLALWeaveMainLoopSearchIteratorCreate(const LatticeTiling *semi_tiling, const UINT4 freq_partitions, const UINT4 f1dot_partitions)
Create iterator over the main loop search parameter space.
REAL8 XLALWeaveSearchIteratorRemainingTime(const WeaveSearchIterator *itr, const REAL8 elapsed_time)
Return estimate of time remaining for iteration to complete, assuming a equal dstribution in computat...
int XLALWeaveSearchIteratorRestore(WeaveSearchIterator *itr, FITSFile *file)
Restore state of iterator from a FITS file.
Module which implements iterators over search parameter spaces.
int XLALWeaveSearchTimingElapsed(WeaveSearchTiming *tim, double *wall_elapsed, double *cpu_elapsed)
Return elapsed wall and CPU times since start of search timing.
int XLALWeaveSearchTimingWriteInfo(FITSFile *file, const WeaveSearchTiming *tim, const WeaveCacheQueries *queries)
Write information from search timing to a FITS file.
int XLALWeaveSearchTimingStop(WeaveSearchTiming *tim, double *wall_total, double *cpu_total)
Stop timing of search.
int XLALWeaveSearchTimingSection(WeaveSearchTiming *tim, const WeaveSearchTimingSection prev_section, const WeaveSearchTimingSection next_section)
Change the search section currently being timed.
void XLALWeaveSearchTimingDestroy(WeaveSearchTiming *tim)
Destroy a search timing structure.
int XLALWeaveSearchTimingStart(WeaveSearchTiming *tim)
Start timing of search.
WeaveSearchTiming * XLALWeaveSearchTimingCreate(const BOOLEAN detailed_timing, const WeaveStatisticsParams *statistics_params)
Create a search timing structure.
Module which collects search timings and builds a timing model.
@ WEAVE_SEARCH_TIMING_COH
Computation of coherent results section.
@ WEAVE_SEARCH_TIMING_OUTPUT
Result output section.
@ WEAVE_SEARCH_TIMING_SEMISEG
Computation of per-segment semicoherent results section.
@ WEAVE_SEARCH_TIMING_ITER
Parameter space iteration section.
@ WEAVE_SEARCH_TIMING_QUERY
Cache queries section.
@ WEAVE_SEARCH_TIMING_CKPT
Checkpointing section.
@ WEAVE_SEARCH_TIMING_OTHER
Unaccounted section.
@ WEAVE_SEARCH_TIMING_CMPL
Completion-loop section.
@ WEAVE_SEARCH_TIMING_SEMI
Computation of semicoherent results section.
void XLALWeaveSetupDataClear(WeaveSetupData *setup)
Free contents of setup data.
int XLALWeaveSetupDataRead(FITSFile *file, WeaveSetupData *setup)
Read setup data from a FITS file.
Module which handles the setup data.
int main(int argc, char *argv[])
@ WEAVE_SIMULATE
Simulate search (implicitly with full memory allocation)
@ WEAVE_SIMULATE_MIN_MEM
Simulate search with minimal memory allocation.
enum tagWeaveSimulationLevel WeaveSimulationLevel
int XLALWeaveStatisticsParamsSetDependencyMap(WeaveStatisticsParams *statistics_params, const WeaveStatisticType toplist_stats, const WeaveStatisticType extra_output_stats, const WeaveStatisticType recalc_stats)
Fill StatisticsParams logic for given toplist and extra-output stats.
const char *const WeaveToplistHelpString
User input help string for toplist ranking statistics.
const UserChoices WeaveToplistChoices
User input choices for toplist ranking statistics.
const char *const WeaveStatisticHelpString
User input help string for all supported statistics.
const UserChoices WeaveStatisticChoices
User input choices for all supported statistics.
@ WEAVE_STATISTIC_COH2F_DET
Per segment per-detector F-statistic.
@ WEAVE_STATISTIC_BtSGLtL
(transient-)line robust log10(B_tS/GLtL) statistic
@ WEAVE_STATISTIC_MEAN2F
Multi-detector average (over segments) F-statistic.
@ WEAVE_STATISTIC_BSGLtL
(transient-)line robust log10(B_S/GLtL) statistic
@ WEAVE_STATISTIC_BSGL
Line-robust log10(B_S/GL) statistic.
PulsarParamsVector * XLALCreatePulsarParamsVector(UINT4 numPulsars)
Create zero-initialized PulsarParamsVector for numPulsars.
PulsarParamsVector * XLALPulsarParamsFromUserInput(const LALStringVector *UserInput, const LIGOTimeGPS *refTimeDef)
Function to determine the PulsarParamsVector input from a user-input defining CW sources.
const char *const InjectionSourcesHelpString
void XLALDestroyPulsarParamsVector(PulsarParamsVector *ppvect)
Destructor for PulsarParamsVector type.
int XLALFITSWritePulsarParamsVector(FITSFile *file, const CHAR *tableName, const PulsarParamsVector *list)
Write a PulsarParamsVector to a FITS file.
const FstatOptionalArgs FstatOptionalArgsDefaults
Global initializer for setting FstatOptionalArgs to default values.
const UserChoices * XLALFstatMethodChoices(void)
Return pointer to a static array of all (available) FstatMethodType choices.
@ FMETHOD_DEMOD_BEST
Demod: best guess of the fastest available hotloop
@ FMETHOD_RESAMP_BEST
Resamp: best guess of the fastest available implementation
@ FMETHOD_RESAMP_CUDA
Resamp: CUDA resampling
#define LAL_GPS_PRINT(gps)
struct tagFITSFile FITSFile
Representation of a FITS file.
#define XLAL_INIT_DECL(var,...)
void * XLALCalloc(size_t m, size_t n)
int XLALSetTiledLatticeDimensionsFromTiling(LatticeTiling *tiling, const LatticeTiling *ref_tiling)
Set the tiled (i.e.
REAL8 XLALLatticeTilingStepSize(const LatticeTiling *tiling, const size_t dim)
Return the step size of the lattice tiling in a given dimension, or 0 for non-tiled dimensions.
int XLALSetTilingLatticeAndMetric(LatticeTiling *tiling, const TilingLattice lattice, const gsl_matrix *metric, const double max_mismatch)
Set the tiling lattice, parameter-space metric, and maximum prescribed mismatch.
size_t XLALTiledLatticeTilingDimensions(const LatticeTiling *tiling)
Return the number of tiled dimensions of the lattice tiling.
int XLALPerformLatticeTilingCallbacks(const LatticeTiling *tiling)
Perform all registered lattice tiling callbacks.
void XLALDestroyLatticeTiling(LatticeTiling *tiling)
Destroy a lattice tiling.
LatticeTiling * XLALCreateLatticeTiling(const size_t ndim)
Create a new lattice tiling.
const LatticeTilingStats * XLALLatticeTilingStatistics(const LatticeTiling *tiling, const size_t dim)
Return statistics related to the number/value of lattice tiling points in a dimension.
const UserChoices TilingLatticeChoices
Static array of all :tagTilingLattice choices, for use by the UserInput module parsing routines.
int XLALSetLatticeTilingRandomOriginOffsets(LatticeTiling *tiling, RandomParams *rng)
Offset the physical parameter-space origin of the lattice tiling by a random fraction of the lattice ...
int XLALRandomLatticeTilingPoints(const LatticeTiling *tiling, const double scale, RandomParams *rng, gsl_matrix *random_points)
Generate random points within the parameter space of the lattice tiling.
@ TILING_LATTICE_ANSTAR
An-star ( ) lattice.
BSGLSetup * XLALCreateBSGLSetup(const UINT4 numDetectors, const REAL4 Fstar0sc, const REAL4 oLGX[PULSAR_MAX_DETECTORS], const BOOLEAN useLogCorrection, const UINT4 numSegments)
int XLALParseLinePriors(REAL4 oLGX[PULSAR_MAX_DETECTORS], const LALStringVector *oLGX_string)
Parse string-vectors (typically input by user) of N per-detector line-to-Gaussian prior ratios to a ...
REAL8 XLALGetPeakHeapUsageMB(void)
void void LogPrintfVerbatim(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
void LogPrintf(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
#define PULSAR_MAX_DETECTORS
maximal number of detectors we can handle (for static arrays of detector quantities)
RandomParams * XLALCreateRandomParams(INT4 seed)
REAL4 XLALUniformDeviate(RandomParams *params)
void XLALDestroyRandomParams(RandomParams *params)
void XLALDestroySFTCatalog(SFTCatalog *catalog)
Free an 'SFT-catalogue'.
void XLALDestroyMultiSFTCatalogView(MultiSFTCatalogView *multiView)
Destroys a MultiSFTCatalogView, without freeing the original catalog that the 'view' was referring to...
MultiLIGOTimeGPSVector * XLALMakeMultiTimestamps(LIGOTimeGPS tStart, REAL8 Tspan, REAL8 Tsft, REAL8 Toverlap, UINT4 numDet)
Same as XLALMakeTimestamps() just for several detectors, additionally specify the number of detectors...
CHAR * XLALGetChannelPrefix(const CHAR *name)
Find the valid CW detector prefix.
SFTCatalog * XLALMultiAddToFakeSFTCatalog(SFTCatalog *catalog, const LALStringVector *detectors, const MultiLIGOTimeGPSVector *timestamps)
Multi-detector and multi-timestamp wrapper of XLALAddToFakeSFTCatalog().
int XLALCheckCRCSFTCatalog(BOOLEAN *crc_check, SFTCatalog *catalog)
This function reads in the SFTs in the catalog and validates their CRC64 checksums.
MultiSFTCatalogView * XLALGetMultiSFTCatalogView(const SFTCatalog *catalog)
Return a MultiSFTCatalogView generated from an input SFTCatalog.
LALStringVector * XLALListIFOsInCatalog(const SFTCatalog *catalog)
Return a sorted string vector listing the unique IFOs in the given catalog.
SFTCatalog * XLALSFTdataFind(const CHAR *file_pattern, const SFTConstraints *constraints)
Find the list of SFTs matching the file_pattern and satisfying the given constraints,...
void XLALDestroyMultiTimestamps(MultiLIGOTimeGPSVector *multiTS)
Destroy a MultiLIGOTimeGPSVector timestamps vector.
MultiLIGOTimeGPSVector * XLALReadMultiTimestampsFiles(const LALStringVector *fnames)
backwards compatible wrapper to XLALReadMultiTimestampsFilesConstrained() without GPS-time constraint...
const UserChoices SSBprecisionChoices
Static array of all SSBprecision choices, for use by the UserInput module parsing routines.
int XLALSegListRange(const LALSegList *seglist, LIGOTimeGPS *start, LIGOTimeGPS *end)
void XLALDestroyStringVector(LALStringVector *vect)
char * XLALConcatStringVector(const LALStringVector *strings, const char *sep)
INT4 XLALFindStringInVector(const char *needle, const LALStringVector *haystack)
LALStringVector * XLALCopyStringVector(const LALStringVector *vect)
int XLALSetSuperskyPhysicalSkyBounds(LatticeTiling *tiling, gsl_matrix *rssky_metric, SuperskyTransformData *rssky_transf, const double alpha1, const double alpha2, const double delta1, const double delta2)
Set parameter-space bounds on the physical sky position for a lattice tiling using the reduced super...
int XLALSetSuperskyEqualAreaSkyBounds(LatticeTiling *tiling, const gsl_matrix *rssky_metric, const double max_mismatch, const UINT4 patch_count, const UINT4 patch_index)
Divide the reduced supersky parameter space into patch_count equal-area patches, and set parameter-sp...
int XLALSuperskyMetricsDimensions(const SuperskyMetrics *metrics, size_t *spindowns)
Return dimensions of the supersky metrics.
int XLALEqualizeReducedSuperskyMetricsFreqSpacing(SuperskyMetrics *metrics, const double coh_max_mismatch, const double semi_max_mismatch)
Project and rescale the reduced supersky metrics in the frequency dimension, such that all reduced su...
int XLALScaleSuperskyMetricsFiducialFreq(SuperskyMetrics *metrics, const double new_fiducial_freq)
Scale all supersky metrics and their coordinate transform data to a new fiducial frequency.
int XLALConvertSuperskyToPhysicalPoint(PulsarDopplerParams *out_phys, const gsl_vector *in_rssky, const gsl_vector *ref_rssky, const SuperskyTransformData *rssky_transf)
Convert a point from supersky to physical coordinates.
int XLALSetSuperskyRangeBounds(LatticeTiling *tiling, const gsl_vector *min_rssky, const gsl_vector *max_rssky)
Set parameter-space bounds on an entire lattice tiling given minimum and maximum ranges in reduced su...
int XLALRegisterSuperskyLatticePhysicalRangeCallback(LatticeTiling *tiling, const SuperskyTransformData *rssky_transf, const PulsarDopplerParams **min_phys, const PulsarDopplerParams **max_phys)
Register a lattice tiling callback function which computes the physical range covered by a reduced su...
int XLALSetSuperskyPhysicalSpinBoundPadding(LatticeTiling *tiling, const SuperskyTransformData *rssky_transf, const size_t s, const bool padding)
Set parameter-space bound padding on the physical frequency/spindowns for a lattice tiling using the...
int XLALSetSuperskyPhysicalSpinBound(LatticeTiling *tiling, const SuperskyTransformData *rssky_transf, const size_t s, const double bound1, const double bound2)
Set parameter-space bounds on the physical frequency/spindowns for a lattice tiling using the reduce...
int XLALRegisterSuperskyLatticeSuperskyRangeCallback(LatticeTiling *tiling, const SuperskyTransformData *rssky_transf, const SuperskyTransformData *rssky2_transf, const gsl_vector **min_rssky2, const gsl_vector **max_rssky2)
Register a lattice tiling callback function which computes the range covered by a reduced supersky la...
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_MAIN(assertion,...)
#define XLAL_TRY(statement, errnum)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
LALDetector detectors[LAL_NUM_DETECTORS]
Struct of optional 'advanced level' and (potentially method-specific) arguments to be passed to the ...
UINT4 randSeed
Random-number seed value used in case of fake Gaussian noise generation (injectSqrtSX)
PulsarParamsVector * injectSources
Vector of parameters of CW signals to simulate and inject.
UINT4 runningMedianWindow
If SFT noise weights are calculated from the SFTs, the running median window length to use.
FstatInput * prevInput
An FstatInput structure from a previous call to XLALCreateFstatInput(); may contain common workspace ...
BOOLEAN collectTiming
a flag to turn on/off the collection of F-stat-method-specific timing-data
UINT4 Dterms
Number of Dirichlet kernel terms, used by some Demod methods; see FstatMethodType.
FstatMethodType FstatMethod
Method to use for computing the -statistic.
SSBprecision SSBprec
Barycentric transformation precision.
REAL8 deltaT
'length' of each timestamp (e.g.
Statistics related to the number/value of lattice tiling points in a dimension.
UINT8 total_points
Total number of points up to this dimension.
const char * name
Name of parameter-space dimension.
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
LIGOTimeGPSVector ** data
timestamps vector for each ifo
A multi-SFT-catalogue "view": a multi-IFO vector of SFT-catalogs.
SFTCatalog * data
array of SFT-catalog pointers
UINT4 length
number of detectors
REAL8 aCross
Signal amplitude (cross)
REAL8 psi
polarization angle psi
REAL8 aPlus
Signal amplitude (plus)
REAL8 phi0
initial signal-phase (at some reference time)
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
Type defining the parameters of a pulsar-source of CW Gravitational waves.
PulsarAmplitudeParams Amp
'Amplitude-parameters': h0, cosi, phi0, psi
CHAR name[LALNameLength]
'name' for this sources, can be an empty string
PulsarDopplerParams Doppler
'Phase-evolution parameters': {skypos, fkdot, orbital params }
Straightforward vector type of N PulsarParams structs.
An "SFT-catalogue": a vector of SFTdescriptors, as returned by XLALSFTdataFind()
SFTDescriptor * data
array of data-entries describing matched SFTs
UINT4 length
number of SFTs in catalog
SFTtype header
SFT-header info.