28#include <lal/LALInitBarycenter.h>
29#include <lal/LogPrintf.h>
30#include <lal/UserInput.h>
31#include <lal/UserInputPrint.h>
33int main(
int argc,
char *argv[] )
43 CHAR *segment_list, *sft_files, *detector_motion, *ephem_earth, *ephem_sun, *
output_file;
48 UINT4 segment_count, spindowns;
66 "Output file while stores the segment list, parameter-space metrics, and other data required by lalpulsar_Weave, e.g. ephemerides. "
73 segment_list,
STRING,
'L', OPTIONAL,
74 "Loads the start and end times of each segment from this file. "
76 " # comment\n <segment-start-time-GPS> <segment-end-time-GPS> [number-of-SFTs-in-segment]\n ..."
79 first_segment, EPOCHRange,
't', OPTIONAL,
80 "Generate segments; the range of the first segment is specified by this option. "
83 segment_count,
UINT4,
'n', OPTIONAL,
84 "Generate this many segments by translating the first segment in time by its span, i.e. so that segments are contiguous and non-overlapping. "
85 "Must be at least 1. "
88 segment_gap,
REAL8,
'g', DEVELOPER,
89 "When generating segments, increase the translation of the first segment by this amount (in seconds). "
90 "A positive value gives non-contiguous segments; a negative value gives overlapping segments. "
93 sft_files,
STRING,
'I', NODEFAULT,
94 "Pattern matching the SFT files to be analysed; used to discard empty segments. Possibilities are:\n"
95 " - '<SFT file>;<SFT file>;...', where <SFT file> may contain wildcards\n - 'list:<file containing list of SFT files>'"
103 "The type of metric to be computed (all-sky/directed)."
106 ref_time, EPOCH,
'r', NODEFAULT,
107 "Reference time for the search, including the parameter-space metrics computed here, and the parameter space and output of lalpulsar_Weave. "
108 "If omitted, the mid-point between the start of the first segment and the end of the last segment is used. "
112 "Comma-separated list of 2-character detector names (e.g. H1,L1,...) for which the parameter-space metrics are computed. "
113 "Note that the detector names are always sorted, since their order impacts the interpretation of some options to lalpulsar_Weave. "
116 detector_motion,
STRING,
'm', DEVELOPER,
117 "Specify what detector motion to assume when computing the parameter-space metrics. "
118 "The only interesting options are:\n"
119 " - 'spin+orbit' use the full ephemeris of the Earth's orbit;\n"
120 " - 'spin+ptoleorbit': use a Ptolemaic approximation of the Earth's orbit."
123 ephem_earth,
STRING,
'E', DEVELOPER,
124 "Earth ephemeris file, used to compute the parameter-space metrics and by lalpulsar_Weave. "
127 ephem_sun,
STRING,
'S', DEVELOPER,
128 "Sun ephemeris file, used to compute the parameter-space metrics and by lalpulsar_Weave. "
131 spindowns,
UINT4,
's', OPTIONAL,
132 "Maximum number of spindowns for which the parameter-space metrics are computed. "
133 "Must be at least 1. "
134 "This option limits the size of the spindown parameter space given to lalpulsar_Weave. "
154 UVAR_SET2( segment_list, first_segment ) == 1,
155 "Exactly one of " UVAR_STR2OR( segment_list, first_segment )
" must be specified" );
158 "At most one of " UVAR_STR2AND( segment_list, segment_gap )
" may be specified" );
161 "At most one of " UVAR_STR2AND( segment_list, segment_count )
" may be specified" );
163 uvar->segment_count > 0,
164 UVAR_STR( segment_count )
" must be strictly positive" );
170 UVAR_STR( spindowns )
" must be strictly positive" );
193 LogPrintf(
LOG_NORMAL,
"Loading ephemerides from '%s' and '%s' ...\n", uvar->ephem_earth, uvar->ephem_sun );
214 XLALSegSet( &seg, &uvar->first_segment[0], &uvar->first_segment[1], 0 );
220 for (
UINT4 n = 0;
n < uvar->segment_count; ++
n ) {
241 for (
UINT4 n = 0;
n < setup.segments->length; ++
n ) {
242 const LALSeg *seg = &setup.segments->segs[
n];
245 if ( sft_catalog_seg.length > 0 ) {
253 setup.segments = nonempty_segments;
267 setup.ref_time = uvar->ref_time;
269 setup.ref_time = segments_start;
276 LIGOTimeGPS ephem_start = segments_start, ephem_end = segments_end;
299 const double fiducial_freq = 100.0;
303 setup.metrics =
XLALComputeSuperskyMetrics( uvar->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
const UserChoices WeaveMetricTypeChoices
Definitions of search type choices.
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 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.
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