28#include <lal/LALInitBarycenter.h>
29#include <lal/LogPrintf.h>
30#include <lal/UserInput.h>
32int main(
int argc,
char *argv[] )
42 CHAR *segment_list, *sft_files, *detector_motion, *ephem_earth, *ephem_sun, *
output_file;
47 UINT4 segment_count, spindowns;
63 "Output file while stores the segment list, parameter-space metrics, and other data required by lalpulsar_Weave, e.g. ephemerides. "
70 segment_list,
STRING,
'L', OPTIONAL,
71 "Loads the start and end times of each segment from this file. "
73 " # comment\n <segment-start-time-GPS> <segment-end-time-GPS> [number-of-SFTs-in-segment]\n ..."
76 first_segment, EPOCHRange,
't', OPTIONAL,
77 "Generate segments; the range of the first segment is specified by this option. "
80 segment_count,
UINT4,
'n', OPTIONAL,
81 "Generate this many segments by translating the first segment in time by its span, i.e. so that segments are contiguous and non-overlapping. "
82 "Must be at least 1. "
85 segment_gap,
REAL8,
'g', DEVELOPER,
86 "When generating segments, increase the translation of the first segment by this amount (in seconds). "
87 "A positive value gives non-contiguous segments; a negative value gives overlapping segments. "
90 sft_files,
STRING,
'I', NODEFAULT,
91 "Pattern matching the SFT files to be analysed; used to discard empty segments. Possibilities are:\n"
92 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'"
99 ref_time, EPOCH,
'r', NODEFAULT,
100 "Reference time for the search, including the parameter-space metrics computed here, and the parameter space and output of lalpulsar_Weave. "
101 "If omitted, the mid-point between the start of the first segment and the end of the last segment is used. "
105 "Comma-separated list of 2-character detector names (e.g. H1,L1,...) for which the parameter-space metrics are computed. "
106 "Note that the detector names are always sorted, since their order impacts the interpretation of some options to lalpulsar_Weave. "
109 detector_motion,
STRING,
'm', DEVELOPER,
110 "Specify what detector motion to assume when computing the parameter-space metrics. "
111 "The only interesting options are:\n"
112 " - 'spin+orbit' use the full ephemeris of the Earth's orbit;\n"
113 " - 'spin+ptoleorbit': use a Ptolemaic approximation of the Earth's orbit."
116 ephem_earth,
STRING,
'E', DEVELOPER,
117 "Earth ephemeris file, used to compute the parameter-space metrics and by lalpulsar_Weave. "
120 ephem_sun,
STRING,
'S', DEVELOPER,
121 "Sun ephemeris file, used to compute the parameter-space metrics and by lalpulsar_Weave. "
124 spindowns,
UINT4,
's', OPTIONAL,
125 "Maximum number of spindowns for which the parameter-space metrics are computed. "
126 "Must be at least 1. "
127 "This option limits the size of the spindown parameter space given to lalpulsar_Weave. "
147 UVAR_SET2( segment_list, first_segment ) == 1,
148 "Exactly one of " UVAR_STR2OR( segment_list, first_segment )
" must be specified" );
151 "At most one of " UVAR_STR2AND( segment_list, segment_gap )
" may be specified" );
154 "At most one of " UVAR_STR2AND( segment_list, segment_count )
" may be specified" );
156 uvar->segment_count > 0,
157 UVAR_STR( segment_count )
" must be strictly positive" );
163 UVAR_STR( spindowns )
" must be strictly positive" );
182 LogPrintf(
LOG_NORMAL,
"Loading ephemerides from '%s' and '%s' ...\n", uvar->ephem_earth, uvar->ephem_sun );
203 XLALSegSet( &seg, &uvar->first_segment[0], &uvar->first_segment[1], 0 );
209 for (
UINT4 n = 0;
n < uvar->segment_count; ++
n ) {
230 for (
UINT4 n = 0;
n < setup.segments->length; ++
n ) {
231 const LALSeg *seg = &setup.segments->segs[
n];
234 if ( sft_catalog_seg.length > 0 ) {
242 setup.segments = nonempty_segments;
256 setup.ref_time = uvar->ref_time;
258 setup.ref_time = segments_start;
265 LIGOTimeGPS ephem_start = segments_start, ephem_end = segments_end;
288 const double fiducial_freq = 100.0;
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)
SuperskyMetrics * XLALComputeSuperskyMetrics(const SuperskyMetricType 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.
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