Functions for generating search-grids for CFS. More...
Prototypes | |
void | getRange (LALStatus *, meshREAL y[2], meshREAL x, void *params) |
void | getMetric (LALStatus *, meshREAL g[3], meshREAL skypos[2], void *params) |
REAL8 | getDopplermax (EphemerisData *edat) |
some temp test-code outputting the maximal possible dopper-shift |vE| + |vS| over the ephemeris More... | |
DopplerSkyGrid * | ConvertTwoDMesh2SkyGrid (const meshNODE *mesh2d, const SkyRegion *region) |
BOOLEAN | pointInPolygon (const SkyPosition *point, const SkyRegion *polygon) |
Function for checking if a given point lies inside or outside a given polygon, which is specified by a list of points in a SkyPositionVector. More... | |
void | gridFlipOrder (meshNODE *grid) |
DopplerSkyGrid * | buildFlatSkyGrid (const SkyRegion *region, REAL8 dAlpha, REAL8 dDelta) |
DopplerSkyGrid * | buildIsotropicSkyGrid (const SkyRegion *skyRegion, REAL8 dAlpha, REAL8 dDelta) |
DopplerSkyGrid * | buildMetricSkyGrid (SkyRegion *skyRegion, const DopplerSkyScanInit *init) |
Build the skygrid using a specified metric. More... | |
DopplerSkyGrid * | loadSkyGridFile (const CHAR *fname) |
Load skygrid from file, clipped to searchRegion. More... | |
void | plotSkyGrid (LALStatus *, DopplerSkyGrid *skygrid, const SkyRegion *region, const DopplerSkyScanInit *init) |
void | freeSkyGrid (DopplerSkyGrid *skygrid) |
int | getGridSpacings (PulsarDopplerParams *spacings, PulsarDopplerParams gridpoint, const DopplerSkyScanInit *params) |
determine the 'canonical' stepsizes in all parameter-space directions, either from the metric (if –gridType==GRID_METRIC) or using {dAlpha,dDelta} and rough guesses dfkdot=1/T^{k+1} otherwise More... | |
void | printFrequencyShifts (LALStatus *, const DopplerSkyScanState *skyScan, const DopplerSkyScanInit *init) |
const char * | va (const char *format,...) |
int | XLALNextDopplerSkyPos (PulsarDopplerParams *pos, DopplerSkyScanState *skyScan) |
NextDopplerSkyPos(): step through sky-grid return 0 = OK, -1 = ERROR. More... | |
int | XLALInitDopplerSkyScan (DopplerSkyScanState *skyScan, const DopplerSkyScanInit *init) |
Initialize the Doppler sky-scanner. More... | |
void | InitDopplerSkyScan (LALStatus *status, DopplerSkyScanState *skyScan, const DopplerSkyScanInit *init) |
void | XLALDestroyDopplerSkyScan (DopplerSkyScanState *skyScan) |
Destroy the DopplerSkyScanState structure. More... | |
void | FreeDopplerSkyScan (LALStatus *status, DopplerSkyScanState *skyScan) |
void | getRange (LALStatus *status, meshREAL y[2], meshREAL UNUSED x, void *params) |
This is the parameter range function as required by TwoDMesh(). More... | |
void | writeSkyGridFile (LALStatus *status, const DopplerSkyGrid *skyGrid, const CHAR *fname) |
Write the given sky-grid to a file. More... | |
int | XLALParseSkyRegionString (SkyRegion *region, const CHAR *input) |
parse a skyRegion-string into a SkyRegion structure: the expected string-format is " (longitude1, latitude1), (longitude2, latitude2), (longitude3, latitude3), ... " More... | |
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 form '(a1,d1), (a2,d2),...' More... | |
void | getMetricEllipse (LALStatus *status, MetricEllipse *ellipse, REAL8 mismatch, const REAL8Vector *metric, UINT4 dim0) |
get "metric-ellipse" for given metric. More... | |
int | fprintfDopplerParams (FILE *fp, const PulsarDopplerParams *params) |
Debug-output of PulsarDopplerParams struct. More... | |
DopplerSkyGrid * | XLALEquiPartitionSkygrid (const DopplerSkyGrid *skygrid, UINT4 partitionIndex, UINT4 numPartitions) |
Equi-partition (approximately) a given skygrid into numPartitions, and return partition 0<= partitionIndex < numPartitions. More... | |
Functions for generating search-grids for CFS.
Definition in file DopplerScan.c.
Go to the source code of this file.
Macros | |
#define | INDEX_f0_f0 PMETRIC_INDEX(0,0) |
#define | INDEX_f0_A PMETRIC_INDEX(0,1) |
#define | INDEX_f0_D PMETRIC_INDEX(0,2) |
#define | INDEX_f0_f1 PMETRIC_INDEX(0,3) |
#define | INDEX_A_A PMETRIC_INDEX(1,1) |
#define | INDEX_D_D PMETRIC_INDEX(2,2) |
#define | INDEX_A_D PMETRIC_INDEX(1,2) |
#define | INDEX_A_f1 PMETRIC_INDEX(1,3) |
#define | INDEX_D_f1 PMETRIC_INDEX(2,3) |
#define | INDEX_f1_f1 PMETRIC_INDEX(3,3) |
#define | DELTA_0 "-1.570796" |
#define | DELTA_1 "1.570796" |
#define | ALPHA_0 "1e-6" |
#define | ALPHA_1 "6.283185" |
#define | SKYREGION_ALLSKY "(" ALPHA_0 ", " DELTA_0 "),(" ALPHA_1 ", " DELTA_0 "),(" ALPHA_1 ", " DELTA_1 "),(" ALPHA_0 ", " DELTA_1 ")" |
#define | EPS4 1e-6 |
#define | SPOKES 60 /* spokes for ellipse-plots */ |
#define | NUM_SPINDOWN 0 /* Number of spindown parameters */ |
#define | mymax(a, b) ((a) > (b) ? (a) : (b)) |
Typedefs | |
typedef REAL4 | meshREAL |
typedef TwoDMeshNode | meshNODE |
typedef TwoDMeshParamStruc | meshPARAMS |
Enumerations | |
enum | { ORDER_ALPHA_DELTA , ORDER_DELTA_ALPHA } |
TwoDMesh() can have either of two preferred directions of meshing: More... | |
Variables | |
static int | meshOrder = ORDER_DELTA_ALPHA |
#define INDEX_f0_f0 PMETRIC_INDEX(0,0) |
Definition at line 56 of file DopplerScan.c.
#define INDEX_f0_A PMETRIC_INDEX(0,1) |
Definition at line 57 of file DopplerScan.c.
#define INDEX_f0_D PMETRIC_INDEX(0,2) |
Definition at line 58 of file DopplerScan.c.
#define INDEX_f0_f1 PMETRIC_INDEX(0,3) |
Definition at line 59 of file DopplerScan.c.
#define INDEX_A_A PMETRIC_INDEX(1,1) |
Definition at line 61 of file DopplerScan.c.
#define INDEX_D_D PMETRIC_INDEX(2,2) |
Definition at line 62 of file DopplerScan.c.
#define INDEX_A_D PMETRIC_INDEX(1,2) |
Definition at line 63 of file DopplerScan.c.
#define INDEX_A_f1 PMETRIC_INDEX(1,3) |
Definition at line 64 of file DopplerScan.c.
#define INDEX_D_f1 PMETRIC_INDEX(2,3) |
Definition at line 66 of file DopplerScan.c.
#define INDEX_f1_f1 PMETRIC_INDEX(3,3) |
Definition at line 68 of file DopplerScan.c.
#define DELTA_0 "-1.570796" |
Definition at line 71 of file DopplerScan.c.
#define DELTA_1 "1.570796" |
Definition at line 72 of file DopplerScan.c.
#define ALPHA_0 "1e-6" |
Definition at line 73 of file DopplerScan.c.
#define ALPHA_1 "6.283185" |
Definition at line 74 of file DopplerScan.c.
#define SKYREGION_ALLSKY "(" ALPHA_0 ", " DELTA_0 "),(" ALPHA_1 ", " DELTA_0 "),(" ALPHA_1 ", " DELTA_1 "),(" ALPHA_0 ", " DELTA_1 ")" |
Definition at line 76 of file DopplerScan.c.
#define EPS4 1e-6 |
Definition at line 81 of file DopplerScan.c.
#define SPOKES 60 /* spokes for ellipse-plots */ |
Definition at line 503 of file DopplerScan.c.
#define NUM_SPINDOWN 0 /* Number of spindown parameters */ |
Definition at line 504 of file DopplerScan.c.
Definition at line 92 of file DopplerScan.c.
typedef TwoDMeshNode meshNODE |
Definition at line 93 of file DopplerScan.c.
typedef TwoDMeshParamStruc meshPARAMS |
Definition at line 94 of file DopplerScan.c.
anonymous enum |
TwoDMesh() can have either of two preferred directions of meshing:
Enumerator | |
---|---|
ORDER_ALPHA_DELTA | |
ORDER_DELTA_ALPHA |
Definition at line 85 of file DopplerScan.c.
Definition at line 414 of file DopplerScan.c.
REAL8 getDopplermax | ( | EphemerisData * | edat | ) |
some temp test-code outputting the maximal possible dopper-shift |vE| + |vS| over the ephemeris
Definition at line 1167 of file DopplerScan.c.
DopplerSkyGrid * ConvertTwoDMesh2SkyGrid | ( | const meshNODE * | mesh2d, |
const SkyRegion * | region | ||
) |
Definition at line 736 of file DopplerScan.c.
BOOLEAN pointInPolygon | ( | const SkyPosition * | point, |
const SkyRegion * | polygon | ||
) |
Function for checking if a given point lies inside or outside a given polygon, which is specified by a list of points in a SkyPositionVector.
The list of polygon-points must not close on itself, the last point is automatically assumed to be connected to the first
Count the number of intersections of rays emanating to the right from the point with the lines of the polygon: even => outside, odd => inside
we try to get this algorith to count all boundary-points as 'inside' we do this by counting intersection to the left AND to the right and consider the point inside if either of those says its inside...
Definition at line 680 of file DopplerScan.c.
void gridFlipOrder | ( | meshNODE * | grid | ) |
DopplerSkyGrid * buildFlatSkyGrid | ( | const SkyRegion * | region, |
REAL8 | dAlpha, | ||
REAL8 | dDelta | ||
) |
Definition at line 789 of file DopplerScan.c.
DopplerSkyGrid * buildIsotropicSkyGrid | ( | const SkyRegion * | skyRegion, |
REAL8 | dAlpha, | ||
REAL8 | dDelta | ||
) |
Definition at line 841 of file DopplerScan.c.
DopplerSkyGrid * buildMetricSkyGrid | ( | SkyRegion * | skyRegion, |
const DopplerSkyScanInit * | init | ||
) |
Build the skygrid using a specified metric.
In order for this not to clip boundary-points only due to numerical fluctuations, we push the enclosing rectangle boundaries inside by about EPS~1e-6 [as REAL4-arithmetic is used in TwoDMesh()].
Definition at line 905 of file DopplerScan.c.
DopplerSkyGrid * loadSkyGridFile | ( | const CHAR * | fname | ) |
Load skygrid from file, clipped to searchRegion.
Definition at line 979 of file DopplerScan.c.
void plotSkyGrid | ( | LALStatus * | status, |
DopplerSkyGrid * | skygrid, | ||
const SkyRegion * | region, | ||
const DopplerSkyScanInit * | init | ||
) |
Definition at line 507 of file DopplerScan.c.
void freeSkyGrid | ( | DopplerSkyGrid * | skygrid | ) |
Definition at line 340 of file DopplerScan.c.
int getGridSpacings | ( | PulsarDopplerParams * | spacings, |
PulsarDopplerParams | gridpoint, | ||
const DopplerSkyScanInit * | params | ||
) |
determine the 'canonical' stepsizes in all parameter-space directions, either from the metric (if –gridType==GRID_METRIC) or using {dAlpha,dDelta} and rough guesses dfkdot=1/T^{k+1} otherwise
In the metric case, the metric is evaluated at the given gridpoint.
NOTE: currently only 1 spindown is supported!
spacings | OUT: grid-spacings in gridpoint |
gridpoint | IN: gridpoint to get spacings for |
params | IN: Doppler-scan parameters |
Definition at line 1343 of file DopplerScan.c.
void printFrequencyShifts | ( | LALStatus * | status, |
const DopplerSkyScanState * | skyScan, | ||
const DopplerSkyScanInit * | init | ||
) |
Definition at line 1060 of file DopplerScan.c.
int XLALNextDopplerSkyPos | ( | PulsarDopplerParams * | pos, |
DopplerSkyScanState * | skyScan | ||
) |
NextDopplerSkyPos(): step through sky-grid return 0 = OK, -1 = ERROR.
Definition at line 127 of file DopplerScan.c.
int XLALInitDopplerSkyScan | ( | DopplerSkyScanState * | skyScan, |
const DopplerSkyScanInit * | init | ||
) |
Initialize the Doppler sky-scanner.
[out] | skyScan | the initialized scan-structure |
[in] | init | init-params |
Definition at line 170 of file DopplerScan.c.
void InitDopplerSkyScan | ( | LALStatus * | status, |
DopplerSkyScanState * | skyScan, | ||
const DopplerSkyScanInit * | init | ||
) |
status | pointer to LALStatus structure | |
[out] | skyScan | the initialized scan-structure |
[in] | init | init-params |
Definition at line 273 of file DopplerScan.c.
void XLALDestroyDopplerSkyScan | ( | DopplerSkyScanState * | skyScan | ) |
Destroy the DopplerSkyScanState structure.
Definition at line 294 of file DopplerScan.c.
void FreeDopplerSkyScan | ( | LALStatus * | status, |
DopplerSkyScanState * | skyScan | ||
) |
Definition at line 324 of file DopplerScan.c.
This is the parameter range function as required by TwoDMesh().
NOTE: for the moment we only provide a trival range as defined by the rectangular parameter-area [ a1, a2 ] x [ d1, d2 ]
In order to avoid later cliping of boundary-points only due to numerical fluctuations, we push the enclosing rectangle boundaries inside by about EPS~1e-6 [as REAL4-arithmetic is used in TwoDMesh()].
Definition at line 379 of file DopplerScan.c.
void writeSkyGridFile | ( | LALStatus * | status, |
const DopplerSkyGrid * | skyGrid, | ||
const CHAR * | fname | ||
) |
Write the given sky-grid to a file.
Possibly including some comments containing the parameters of the grid (?).
Definition at line 1023 of file DopplerScan.c.
parse a skyRegion-string into a SkyRegion structure: the expected string-format is " (longitude1, latitude1), (longitude2, latitude2), (longitude3, latitude3), ... "
If input == NULL or input == "allsky":==> sky-region covering the whole sky.
Definition at line 1203 of file DopplerScan.c.
parse a 'classical' sky-square (Alpha, Delta, AlphaBand, DeltaBand) into a "SkyRegion"-string of the form '(a1,d1), (a2,d2),...'
[in] | Alpha | longitude of first point |
[in] | Delta | latitude of first point |
[in] | AlphaBand | longitude-interval |
[in] | DeltaBand | latitude-interval |
Definition at line 1295 of file DopplerScan.c.
void getMetricEllipse | ( | LALStatus * | status, |
MetricEllipse * | ellipse, | ||
REAL8 | mismatch, | ||
const REAL8Vector * | metric, | ||
UINT4 | dim0 | ||
) |
get "metric-ellipse" for given metric.
Definition at line 1434 of file DopplerScan.c.
int fprintfDopplerParams | ( | FILE * | fp, |
const PulsarDopplerParams * | params | ||
) |
Debug-output of PulsarDopplerParams struct.
Definition at line 1484 of file DopplerScan.c.
DopplerSkyGrid* XLALEquiPartitionSkygrid | ( | const DopplerSkyGrid * | skygrid, |
UINT4 | partitionIndex, | ||
UINT4 | numPartitions | ||
) |
Equi-partition (approximately) a given skygrid into numPartitions, and return partition 0<= partitionIndex < numPartitions.
Definition at line 1508 of file DopplerScan.c.
|
static |
Definition at line 90 of file DopplerScan.c.