28#include <lal/LALInitBarycenter.h>
29#include <lal/LogPrintf.h>
30#include <lal/UserInput.h>
32int main(
int argc,
char *argv[] )
42 CHAR *metric_type_str, *segment_list, *sft_files, *detector_motion, *ephem_earth, *ephem_sun, *
output_file;
47 UINT4 segment_count, spindowns;
64 "Output file while stores the segment list, parameter-space metrics, and other data required by lalpulsar_Weave, e.g. ephemerides. "
71 segment_list,
STRING,
'L', OPTIONAL,
72 "Loads the start and end times of each segment from this file. "
74 " # comment\n <segment-start-time-GPS> <segment-end-time-GPS> [number-of-SFTs-in-segment]\n ..."
77 first_segment, EPOCHRange,
't', OPTIONAL,
78 "Generate segments; the range of the first segment is specified by this option. "
81 segment_count,
UINT4,
'n', OPTIONAL,
82 "Generate this many segments by translating the first segment in time by its span, i.e. so that segments are contiguous and non-overlapping. "
83 "Must be at least 1. "
86 segment_gap,
REAL8,
'g', DEVELOPER,
87 "When generating segments, increase the translation of the first segment by this amount (in seconds). "
88 "A positive value gives non-contiguous segments; a negative value gives overlapping segments. "
91 sft_files,
STRING,
'I', NODEFAULT,
92 "Pattern matching the SFT files to be analysed; used to discard empty segments. Possibilities are:\n"
93 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'"
100 metric_type_str,
STRING,
'T', OPTIONAL,
101 "The type of metrics to be computed (all-sky/directed search)."
104 ref_time, EPOCH,
'r', NODEFAULT,
105 "Reference time for the search, including the parameter-space metrics computed here, and the parameter space and output of lalpulsar_Weave. "
106 "If omitted, the mid-point between the start of the first segment and the end of the last segment is used. "
110 "Comma-separated list of 2-character detector names (e.g. H1,L1,...) for which the parameter-space metrics are computed. "
111 "Note that the detector names are always sorted, since their order impacts the interpretation of some options to lalpulsar_Weave. "
114 detector_motion,
STRING,
'm', DEVELOPER,
115 "Specify what detector motion to assume when computing the parameter-space metrics. "
116 "The only interesting options are:\n"
117 " - 'spin+orbit' use the full ephemeris of the Earth's orbit;\n"
118 " - 'spin+ptoleorbit': use a Ptolemaic approximation of the Earth's orbit."
121 ephem_earth,
STRING,
'E', DEVELOPER,
122 "Earth ephemeris file, used to compute the parameter-space metrics and by lalpulsar_Weave. "
125 ephem_sun,
STRING,
'S', DEVELOPER,
126 "Sun ephemeris file, used to compute the parameter-space metrics and by lalpulsar_Weave. "
129 spindowns,
UINT4,
's', OPTIONAL,
130 "Maximum number of spindowns for which the parameter-space metrics are computed. "
131 "Must be at least 1. "
132 "This option limits the size of the spindown parameter space given to lalpulsar_Weave. "
152 UVAR_SET2( segment_list, first_segment ) == 1,
153 "Exactly one of " UVAR_STR2OR( segment_list, first_segment )
" must be specified" );
156 "At most one of " UVAR_STR2AND( segment_list, segment_gap )
" may be specified" );
159 "At most one of " UVAR_STR2AND( segment_list, segment_count )
" may be specified" );
161 uvar->segment_count > 0,
162 UVAR_STR( segment_count )
" must be strictly positive" );
168 UVAR_STR( spindowns )
" must be strictly positive" );
170 strcmp( uvar->metric_type_str,
"all-sky" ) || strcmp( uvar->metric_type_str,
"directed" ),
171 UVAR_STR( metric_type_str )
" must be 'all-sky' or 'directed'" );
194 LogPrintf(
LOG_NORMAL,
"Loading ephemerides from '%s' and '%s' ...\n", uvar->ephem_earth, uvar->ephem_sun );
215 XLALSegSet( &seg, &uvar->first_segment[0], &uvar->first_segment[1], 0 );
221 for (
UINT4 n = 0;
n < uvar->segment_count; ++
n ) {
242 for (
UINT4 n = 0;
n < setup.segments->length; ++
n ) {
243 const LALSeg *seg = &setup.segments->segs[
n];
246 if ( sft_catalog_seg.length > 0 ) {
254 setup.segments = nonempty_segments;
268 setup.ref_time = uvar->ref_time;
270 setup.ref_time = segments_start;
277 LIGOTimeGPS ephem_start = segments_start, ephem_end = segments_end;
300 const double fiducial_freq = 100.0;
303 setup.metrics =
XLALComputeSuperskyMetrics( metric_type, uvar->spindowns, &setup.ref_time, setup.segments, fiducial_freq, &detector_info, NULL, detector_motion, setup.ephemerides );
FITSFile * XLALFITSFileOpenWrite(const CHAR UNUSED *file_name)
int XLALFITSFileWriteVCSInfo(FITSFile UNUSED *file, const LALVCSInfoList UNUSED vcs_list)
int XLALFITSFileWriteUVarCmdLine(FITSFile UNUSED *file)
void XLALFITSFileClose(FITSFile UNUSED *file)
void LALCheckMemoryLeaks(void)
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
void XLALWeaveSetupDataClear(WeaveSetupData *setup)
Free contents of setup data.
int XLALWeaveSetupDataWrite(FITSFile *file, const WeaveSetupData *setup)
Write setup data to a FITS file.
Module which handles the setup data.
int main(int argc, char *argv[])
#define LAL_GPS_PRINT(gps)
int XLALParseMultiLALDetector(MultiLALDetector *detInfo, const LALStringVector *detNames)
Parse string-vectors (typically input by user) of N detector-names for detectors ,...
struct tagFITSFile FITSFile
Representation of a FITS file.
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 XLALRestrictEphemerisData(EphemerisData *edat, const LIGOTimeGPS *startGPS, const LIGOTimeGPS *endGPS)
Restrict the EphemerisData 'edat' to the smallest number of entries required to cover the GPS time ra...
#define XLAL_INIT_DECL(var,...)
char char * XLALStringDuplicate(const char *s)
void LogPrintf(LogLevel_t, const char *format,...) _LAL_GCC_PRINTF_FORMAT_(2
void XLALDestroySFTCatalog(SFTCatalog *catalog)
Free an 'SFT-catalogue'.
LALSegList * XLALReadSegmentsFromFile(const char *fname)
Function to read a segment list from given filename, returns a sorted LALSegList.
SFTCatalog * XLALSFTdataFind(const CHAR *file_pattern, const SFTConstraints *constraints)
Find the list of SFTs matching the file_pattern and satisfying the given constraints,...
int XLALSFTCatalogTimeslice(SFTCatalog *slice, const SFTCatalog *catalog, const LIGOTimeGPS *minStartGPS, const LIGOTimeGPS *maxStartGPS)
Set a SFT catalog 'slice' to a timeslice of a larger SFT catalog 'catalog', with entries restricted t...
LALSegList * XLALSegListCreate(void)
int XLALSegListFree(LALSegList *seglist)
int XLALSegListAppend(LALSegList *seglist, const LALSeg *seg)
int XLALSegSet(LALSeg *seg, const LIGOTimeGPS *start, const LIGOTimeGPS *end, const INT4 id)
int XLALSegListRange(const LALSegList *seglist, LIGOTimeGPS *start, LIGOTimeGPS *end)
int XLALSortStringVector(LALStringVector *strings)
char * XLALConcatStringVector(const LALStringVector *strings, const char *sep)
LALStringVector * XLALCopyStringVector(const LALStringVector *vect)
SuperskyMetricType
Type of supersky metric to compute.
SuperskyMetrics * XLALComputeSuperskyMetrics(const SuperskyMetricType metric_type, const size_t spindowns, const LIGOTimeGPS *ref_time, const LALSegList *segments, const double fiducial_freq, const MultiLALDetector *detectors, const MultiNoiseFloor *detector_weights, const DetectorMotionType detector_motion, const EphemerisData *ephemerides)
Compute the supersky metrics, which are returned in a SuperskyMetrics struct.
@ SUPERSKY_METRIC_TYPE
Metric for all-sky searches.
@ SUPERSKY_DIRECTED_METRIC_TYPE
Metric for directed searches.
DetectorMotionType
Bitfield of different types of detector-motion to use in order to compute the Doppler-metric.
int XLALParseDetectorMotionString(const CHAR *detMotionString)
Parse a detector-motion type string into the corresponding enum-number,.
#define XLAL_CHECK(assertion,...)
#define XLAL_CHECK_MAIN(assertion,...)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
LALDetector detectors[LAL_NUM_DETECTORS]
array of detectors definitions 'LALDetector'
An "SFT-catalogue": a vector of SFTdescriptors, as returned by XLALSFTdataFind()
UINT4 length
number of SFTs in catalog