38#include <lal/LALDatatypes.h>
39#include <lal/SkyCoordinates.h>
40#include <lal/PtoleMetric.h>
41#include <lal/LALBarycenter.h>
42#include <lal/PulsarDataTypes.h>
43#include <lal/ComputeFstat.h>
47#define DOPPLERSCANH_ENULL 1
48#define DOPPLERSCANH_ENOTREADY 2
49#define DOPPLERSCANH_ESYS 3
50#define DOPPLERSCANH_E2DSKY 4
51#define DOPPLERSCANH_E2DSTEP 5
52#define DOPPLERSCANH_EGRIDCRPT 6
53#define DOPPLERSCANH_ESKYPARAM 7
54#define DOPPLERSCANH_EMETRICTYPE 8
55#define DOPPLERSCANH_ENONULL 9
56#define DOPPLERSCANH_EMEM 10
57#define DOPPLERSCANH_ESKYREGION 11
58#define DOPPLERSCANH_EINPUT 12
59#define DOPPLERSCANH_ENEGMETRIC 13
60#define DOPPLERSCANH_EXLAL 14
63#define DOPPLERSCANH_MSGENULL "Arguments contained an unexpected null pointer"
64#define DOPPLERSCANH_MSGENOTREADY "Doppler scan is uninitialized or has finished"
65#define DOPPLERSCANH_MSGESYS "System call failed (probably file IO)"
66#define DOPPLERSCANH_MSGE2DSKY "Either need one sky-point or a polygon. (2 sky-points where given)"
67#define DOPPLERSCANH_MSGE2DSTEP "If not using the metric, you need to specify _both_ dDelta and dAlpha"
68#define DOPPLERSCANH_MSGEGRIDCRPT "Unexpected NULL in grid-list. This points to a bug in the code... "
69#define DOPPLERSCANH_MSGESKYPARAM "Invalid sky region! We need 0<= alpha < 2Pi and -Pi/2 <= delta <= PI/2"
70#define DOPPLERSCANH_MSGEMETRICTYPE "Unknown type of metric specified."
71#define DOPPLERSCANH_MSGENONULL "Output pointer is not NULL"
72#define DOPPLERSCANH_MSGEMEM "Out of memory"
73#define DOPPLERSCANH_MSGESKYREGION "Could not parse sky-region correctly"
74#define DOPPLERSCANH_MSGEINPUT "Invald input parameter"
75#define DOPPLERSCANH_MSGENEGMETRIC "Negative metric encountered"
76#define DOPPLERSCANH_MSGEXLAL "XLAL call failed"
81typedef enum tagscan_state_t {
89typedef enum tagDopplerGridType {
108typedef struct tagSkyRegion {
115typedef struct tagDopplerRegion {
124typedef struct tagDopplerSkyGrid {
127 struct tagDopplerSkyGrid *
next;
132SWIGLAL( IMMUTABLE_MEMBERS( tagDopplerSkyScanInit, Detector, ephemeris, skyGridFile ) );
134typedef struct tagDopplerSkyScanInit {
152typedef struct tagDopplerSkyScanState {
162typedef struct tagMetricEllipse {
int fprintfDopplerParams(FILE *fp, const PulsarDopplerParams *params)
Debug-output of PulsarDopplerParams struct.
void writeSkyGridFile(LALStatus *, const DopplerSkyGrid *grid, const CHAR *fname)
Write the given sky-grid to a file.
int XLALParseSkyRegionString(SkyRegion *region, const CHAR *input)
parse a skyRegion-string into a SkyRegion structure: the expected string-format is " (longitude1,...
CHAR * XLALSkySquare2String(REAL8 Alpha, REAL8 Delta, REAL8 AlphaBand, REAL8 DeltaBand)
parse a 'classical' sky-square (Alpha, Delta, AlphaBand, DeltaBand) into a "SkyRegion"-string of the ...
int XLALInitDopplerSkyScan(DopplerSkyScanState *skyScan, const DopplerSkyScanInit *init)
Initialize the Doppler sky-scanner.
void getMetricEllipse(LALStatus *, MetricEllipse *ellipse, REAL8 mismatch, const REAL8Vector *metric, UINT4 dim0)
get "metric-ellipse" for given metric.
int XLALNextDopplerSkyPos(PulsarDopplerParams *pos, DopplerSkyScanState *skyScan)
NextDopplerSkyPos(): step through sky-grid return 0 = OK, -1 = ERROR.
scan_state_t
Different 'states' a Doppler-scan can be in.
@ STATE_READY
initialized and ready
@ STATE_FINISHED
all templates have been read
@ STATE_IDLE
not initialized yet
DopplerSkyGrid * XLALEquiPartitionSkygrid(const DopplerSkyGrid *skygrid, UINT4 jPart, UINT4 numPartitions)
Equi-partition (approximately) a given skygrid into numPartitions, and return partition 0<= partition...
void FreeDopplerSkyScan(LALStatus *, DopplerSkyScanState *skyScan)
void InitDopplerSkyScan(LALStatus *, DopplerSkyScanState *skyScan, const DopplerSkyScanInit *init)
void XLALDestroyDopplerSkyScan(DopplerSkyScanState *skyScan)
Destroy the DopplerSkyScanState structure.
DopplerGridType
different types of grids:
@ GRID_METRIC
generate grid using a 2D sky-metric
@ GRID_SPINDOWN_SQUARE
spindown tiling for a single sky position and square parameter space
@ GRID_FLAT
"flat" sky-grid: fixed step-size (dAlpha,dDelta)
@ GRID_FILE_SKYGRID
read skygrid from a file
@ GRID_FILE_FULLGRID
load the full D-dim grid from a file
@ GRID_METRIC_SKYFILE
'hybrid' grid-construction: use skygrid from file, metric for others
@ GRID_SKY_LAST
end-marker for factored grid types
@ GRID_ISOTROPIC
approximately isotropic sky-grid
@ GRID_SPINDOWN_AGEBRK
spindown tiling for a single sky position and non-square parameter space defined by spindown age and ...
LALPulsarMetricType
Constants defining different types of pulsar-metrics.
REAL8 PulsarSpins[PULSAR_MAX_SPINS]
Typedef for fixed-size array holding GW frequency and derivatives fk = d^k Freq/dt^k|(tau_ref)
PulsarSpins fkdotBand
spin-intervals
CHAR * skyRegionString
sky-region string '(a1,d1), (a2,d2), ..'
PulsarSpins fkdot
reference time of definition of Doppler parameters
struct tagDopplerSkyGrid * next
initialization-structure passed to InitDopplerSkyScan()
const EphemerisData * ephemeris
ephemeris-data for "exact" metric
BOOLEAN projectMetric
project the metric orthogonal to Freq?
UINT4 numSkyPartitions
number of (roughly) equal partitions to split sky-grid into
UINT4 partitionIndex
index of requested sky-grid partition: in [0, numPartitions - 1]
const CHAR * skyGridFile
file containing a sky-grid (list of points) if GRID_FILE
LIGOTimeGPS obsBegin
GPS start-time of time-series.
REAL8 Freq
Frequency for which to build the skyGrid.
DopplerGridType gridType
which type of skygrid to generate
REAL8 obsDuration
length of time-series in seconds
REAL8 metricMismatch
for GRID_METRIC
LALPulsarMetricType metricType
which metric to use if GRID_METRIC
CHAR * skyRegionString
sky-region to search: format polygon '(a1,d1), (a2,d2), ..'
const LALDetector * Detector
Current detector.
this structure reflects the current state of a DopplerSkyScan
UINT4 numSkyGridPoints
how many skygrid-points
PulsarSpins dfkdot
fixed-size steps in spins
DopplerSkyGrid * skyNode
pointer to current grid-node in skygrid
scan_state_t state
idle, ready or finished
DopplerSkyGrid * skyGrid
head of linked list of skygrid nodes
SkyRegion skyRegion
polygon (and bounding square) defining sky-region
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
a "sky-ellipse", described by the two major axes and it's angle wrt x-axis
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
structure describing a polygon-region in the sky
UINT4 numVertices
number of polygon-vertices
SkyPosition lowerLeft
lower-left point of bounding square
SkyPosition * vertices
array of vertices
SkyPosition upperRight
upper-right point of bounding square