#include <math.h>
#include <gsl/gsl_sys.h>
#include <lal/LALStdlib.h>
#include <lal/DetectorSite.h>
#include <lal/LALError.h>
#include <lal/LatticeCovering.h>
#include <lal/LogPrintf.h>
#include <lal/FlatPulsarMetric.h>
#include <lal/DopplerFullScan.h>
#include <lal/DopplerLatticeCovering.h>
Include dependency graph for DopplerLatticeCovering.c:

Go to the source code of this file.
Data Structures | |
| struct | vect2Dlist_t |
| 2D-polygon of points {nX, nY} on a single hemisphere of ecliptic sky-sphere More... | |
| struct | vect3Dlist_t |
| List of 3D vectors. More... | |
| struct | dopplerParams_t |
| 'standard' representation of Doppler-paremeters More... | |
| struct | dopplerBoundary_t |
| boundary of (single-hemisphere) search region in Doppler-space More... | |
| struct | tagDopplerLatticeScan |
Defines | |
| #define | EPS_REAL8 1e-10 |
| relative error used in REAL8 comparisons | |
| #define | TRUE (1==1) |
| #define | FALSE (1==0) |
| #define | NUM_SPINS PULSAR_MAX_SPINS |
| #define | DIM_CANONICAL (2 + NUM_SPINS) |
| dimension of 'canonical' Doppler-space | |
| #define | MIN(x, y) (x < y ? x : y) |
| #define | MAX(x, y) (x > y ? x : y) |
| #define | SIGN(x) ( x < 0 ? -1 : ( x > 0 ? 1 : 0 ) ) |
| #define | SQUARE(x) ( (x) * (x) ) |
| #define | VECT_NORM(x) sqrt( SQUARE((x)[0]) + SQUARE((x)[1]) + SQUARE((x)[2]) ) |
| #define | VECT_ADD(x, y) do { (x)[0] += (y)[0]; (x)[1] += (y)[1]; (x)[2] += (y)[2]; } while(0) |
| #define | VECT_MULT(x, k) do { (x)[0] *= k; (x)[1] *= k; (x)[2] *= k; } while(0) |
| #define | VECT_COPY(dst, src) do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0) |
| #define | VECT_HEMI(x) ( (x)[2] < 0 ? HEMI_SOUTH : ( (x)[2] > 0 ? HEMI_NORTH : 0 ) ) |
Typedefs | |
| typedef REAL8 | vect2D_t [2] |
| 2D vector | |
| typedef REAL8 | vect3D_t [3] |
| 3D vector | |
Enumerations | |
| enum | hemisphere_t { HEMI_BOTH = 0, HEMI_NORTH = 1, HEMI_SOUTH = 2 } |
Functions | |
| NRCSID (DOPPLERLATTICECOVERING,"$Id: DopplerLatticeCovering.c,v 1.1 2007/10/26 16:03:10 reinhard Exp $") | |
| void | skyRegionString2vect3D (LALStatus *status, vect3Dlist_t **skyRegion,const CHAR *skyRegionString) |
| Convert a sky-region string into a list of vectors in ecliptic 2D coords {nX, nY}. | |
| void | setupSearchRegion (LALStatus *status, DopplerLatticeScan *scan, const DopplerRegion *searchRegion) |
| Translate the input 'DopplerRegion' into an internal representation for the scan. | |
| hemisphere_t | onWhichHemisphere (const vect3Dlist_t *skypoints) |
| Check whether given list of skypoint lie on a single hemisphere. | |
| int | skyposToVect3D (vect3D_t *eclVect, const SkyPosition *skypos) |
| Convert a 'SkyPosition' {alpha, delta} into a 3D unit vector in ecliptic coordinates Return: 0=OK, -1=ERROR. | |
| int | vect2DToSkypos (SkyPosition *skypos, const vect2D_t *vect2D, hemisphere_t hemi) |
| Convert (ecliptic) vector pointing to a skypos back into (alpha, delta). | |
| int | findCenterOfMass (vect3D_t *center, const vect3Dlist_t *points) |
| Find the "center of mass" of the given list of 3D points Return: 0=OK, -1 on ERROR. | |
| int | IndexToCanonical (gsl_vector **canonical, const gsl_vector_int *Index, const DopplerLatticeScan *scan) |
| Convert Index-vector {i0, i1, i2, . | |
| int | XLALIndexToDoppler (dopplerParams_t *doppler, const gsl_vector_int *Index, const DopplerLatticeScan *scan) |
| Convert given Index into doppler-params Return: 0=OK, -1=ERROR. | |
| int | isIndexInsideBoundary (const gsl_vector_int *Index, const DopplerLatticeScan *scan) |
| Determine whether the given lattice-Index corresponds to a Doppler-point that lies within the search-boundary Return: TRUE, FALSE, -1 = ERROR. | |
| int | convertDoppler2Canonical (gsl_vector **canonical, const dopplerParams_t *doppler, const gsl_vector *dopplerUnits) |
| Convert Doppler-parameters from {nX, nY, nZ, fkdot} into internal 'canonical' form {w0, kX, kY, w1, w1, . | |
| int | convertCanonical2Doppler (dopplerParams_t *doppler, const gsl_vector *canonical, const gsl_vector *dopplerUnits) |
| Convert a 'canonical' parameter-space point back into a 'physical' Doppler units: a unit (ecliptic) sky-vector 'vn' and spin-vector 'fkdot'. | |
| int | vect2DInPolygon (const vect2D_t *point, const vect2Dlist_t *polygon) |
| Function for checking if a given vect2D-point lies inside or outside a given vect2D-polygon. | |
| int | isDopplerInsideBoundary (const dopplerParams_t *doppler, const dopplerBoundary_t *boundary) |
| Determine whether the given Doppler-point lies within the search-boundary Return: TRUE, FALSE, -1 = ERROR. | |
| int | fprintf_vect2D (FILE *fp, const vect2D_t *vect, hemisphere_t hemi) |
| int | fprintf_vect2Dlist (FILE *fp, const vect2Dlist_t *list, hemisphere_t hemi) |
| DopplerLatticeScan * | XLALDuplicateDopplerLatticeScan (const DopplerLatticeScan *scan) |
| Return a copy a full DopplerLatticeScan state, useful as a backup while counting the lattice. | |
| void | InitDopplerLatticeScan (LALStatus *status, DopplerLatticeScan **scan, const DopplerLatticeInit *init) |
| Initialize search-grid using optimal lattice-covering. | |
| int | XLALFreeDopplerLatticeScan (DopplerLatticeScan **scan) |
| Free an allocated DopplerLatticeScan. | |
| int | XLALgetCurrentLatticeIndex (gsl_vector_int **Index, const DopplerLatticeScan *scan) |
| Return current lattice Index of the scan: allocate Index here if *Index == NULL, otherwise use given vector [has to have right dimension]. | |
| int | XLALsetCurrentLatticeIndex (DopplerLatticeScan *scan, const gsl_vector_int *Index) |
| Set the current index of the scan. | |
| REAL8 | XLALCountLatticeTemplates (const DopplerLatticeScan *scan) |
| Count number of templates in lattice-grid by stepping through the whole grid. | |
| int | XLALadvanceLatticeIndex (DopplerLatticeScan *scan) |
| The central "lattice-stepping" function: advance to the 'next' Index-point, taking care not to leave the boundary, and to cover the whole (convex!) search-region eventually! | |
| int | XLALgetCurrentDopplerPos (PulsarDopplerParams *pos, const DopplerLatticeScan *scan, CoordinateSystem skyCoords) |
| Return the current doppler-position {Freq, Alpha, Delta, f1dot, f2dot, . | |
Variables | |
| dopplerParams_t | empty_dopplerParams |
| INT4 | lalDebugLevel |
| DECLARE AND SET GLOBAL DEBUG LEVEL. | |
Definition in file DopplerLatticeCovering.c.
| #define EPS_REAL8 1e-10 |
| #define TRUE (1==1) |
Definition at line 52 of file DopplerLatticeCovering.c.
| #define FALSE (1==0) |
Definition at line 53 of file DopplerLatticeCovering.c.
| #define NUM_SPINS PULSAR_MAX_SPINS |
Definition at line 55 of file DopplerLatticeCovering.c.
| #define DIM_CANONICAL (2 + NUM_SPINS) |
Definition at line 60 of file DopplerLatticeCovering.c.
Definition at line 62 of file DopplerLatticeCovering.c.
Definition at line 63 of file DopplerLatticeCovering.c.
Definition at line 64 of file DopplerLatticeCovering.c.
Definition at line 65 of file DopplerLatticeCovering.c.
| #define VECT_COPY | ( | dst, | |||
| src | ) | do { (dst)[0] = (src)[0]; (dst)[1] = (src)[1]; (dst)[2] = (src)[2]; } while(0) |
Definition at line 66 of file DopplerLatticeCovering.c.
Definition at line 68 of file DopplerLatticeCovering.c.
| enum hemisphere_t |
| HEMI_BOTH | points lie on both hemispheres |
| HEMI_NORTH | all points on northern hemisphere |
| HEMI_SOUTH | all points on southern hemisphere |
Definition at line 71 of file DopplerLatticeCovering.c.
| NRCSID | ( | DOPPLERLATTICECOVERING | , | |
| "$Id: DopplerLatticeCovering. | c, | |||
| v 1.1 2007/10/26 16:03:10 reinhard Exp $" | ||||
| ) |
| void skyRegionString2vect3D | ( | LALStatus * | , | |
| vect3Dlist_t ** | skyRegionEcl, | |||
| const CHAR * | skyRegionString | |||
| ) |
Convert a sky-region string into a list of vectors in ecliptic 2D coords {nX, nY}.
| skyRegion | [out] list of skypoints in 3D-ecliptic coordinates {nX, nY, nZ} |
| skyRegionString | [in] string of equatorial-coord. sky-positions |
Definition at line 974 of file DopplerLatticeCovering.c.
| void setupSearchRegion | ( | LALStatus * | status, | |
| DopplerLatticeScan * | scan, | |||
| const DopplerRegion * | searchRegion | |||
| ) |
Translate the input 'DopplerRegion' into an internal representation for the scan.
Definition at line 717 of file DopplerLatticeCovering.c.
| hemisphere_t onWhichHemisphere | ( | const vect3Dlist_t * | skypoints | ) |
Check whether given list of skypoint lie on a single hemisphere.
Definition at line 1045 of file DopplerLatticeCovering.c.
| int skyposToVect3D | ( | vect3D_t * | eclVect, | |
| const SkyPosition * | skypos | |||
| ) |
Convert a 'SkyPosition' {alpha, delta} into a 3D unit vector in ecliptic coordinates Return: 0=OK, -1=ERROR.
Definition at line 1071 of file DopplerLatticeCovering.c.
| int vect2DToSkypos | ( | SkyPosition * | skypos, | |
| const vect2D_t * | vect2D, | |||
| hemisphere_t | hemi | |||
| ) |
Convert (ecliptic) vector pointing to a skypos back into (alpha, delta).
NOTE: The coordinate-system of the result is determined by the 'system'-setting in the output 'skypos'
return: 0=OK, -1=ERROR
Definition at line 1117 of file DopplerLatticeCovering.c.
| int findCenterOfMass | ( | vect3D_t * | center, | |
| const vect3Dlist_t * | points | |||
| ) |
Find the "center of mass" of the given list of 3D points Return: 0=OK, -1 on ERROR.
Definition at line 1182 of file DopplerLatticeCovering.c.
| int IndexToCanonical | ( | gsl_vector ** | canonical, | |
| const gsl_vector_int * | Index, | |||
| const DopplerLatticeScan * | scan | |||
| ) |
Convert Index-vector {i0, i1, i2, .
.} into canonical param-vector {w0, kX, kY, w1, w2, ...}
Definition at line 859 of file DopplerLatticeCovering.c.
| int XLALIndexToDoppler | ( | dopplerParams_t * | doppler, | |
| const gsl_vector_int * | Index, | |||
| const DopplerLatticeScan * | scan | |||
| ) |
Convert given Index into doppler-params Return: 0=OK, -1=ERROR.
Definition at line 623 of file DopplerLatticeCovering.c.
| int isIndexInsideBoundary | ( | const gsl_vector_int * | Index, | |
| const DopplerLatticeScan * | scan | |||
| ) |
Determine whether the given lattice-Index corresponds to a Doppler-point that lies within the search-boundary Return: TRUE, FALSE, -1 = ERROR.
Definition at line 653 of file DopplerLatticeCovering.c.
| int convertDoppler2Canonical | ( | gsl_vector ** | canonical, | |
| const dopplerParams_t * | doppler, | |||
| const gsl_vector * | dopplerUnits | |||
| ) |
Convert Doppler-parameters from {nX, nY, nZ, fkdot} into internal 'canonical' form {w0, kX, kY, w1, w1, .
.. }
Definition at line 910 of file DopplerLatticeCovering.c.
| int convertCanonical2Doppler | ( | dopplerParams_t * | doppler, | |
| const gsl_vector * | canonical, | |||
| const gsl_vector * | dopplerUnits | |||
| ) |
Convert a 'canonical' parameter-space point back into a 'physical' Doppler units: a unit (ecliptic) sky-vector 'vn' and spin-vector 'fkdot'.
Return: 0=OK, -1=ERROR
Definition at line 948 of file DopplerLatticeCovering.c.
| int vect2DInPolygon | ( | const vect2D_t * | point, | |
| const vect2Dlist_t * | polygon | |||
| ) |
Function for checking if a given vect2D-point lies inside or outside a given vect2D-polygon.
This is basically indentical to 'pointInPolygon()' only using different data-types.
Definition at line 1228 of file DopplerLatticeCovering.c.
| int isDopplerInsideBoundary | ( | const dopplerParams_t * | doppler, | |
| const dopplerBoundary_t * | boundary | |||
| ) |
Determine whether the given Doppler-point lies within the search-boundary Return: TRUE, FALSE, -1 = ERROR.
Definition at line 672 of file DopplerLatticeCovering.c.
| int fprintf_vect2D | ( | FILE * | fp, | |
| const vect2D_t * | vect, | |||
| hemisphere_t | hemi | |||
| ) |
Definition at line 1291 of file DopplerLatticeCovering.c.
| int fprintf_vect2Dlist | ( | FILE * | fp, | |
| const vect2Dlist_t * | list, | |||
| hemisphere_t | hemi | |||
| ) |
Definition at line 1308 of file DopplerLatticeCovering.c.
| DopplerLatticeScan * XLALDuplicateDopplerLatticeScan | ( | const DopplerLatticeScan * | scan | ) |
Return a copy a full DopplerLatticeScan state, useful as a backup while counting the lattice.
Return: NULL=ERROR
Definition at line 533 of file DopplerLatticeCovering.c.
| void InitDopplerLatticeScan | ( | LALStatus * | status, | |
| DopplerLatticeScan ** | scan, | |||
| const DopplerLatticeInit * | init | |||
| ) |
Initialize search-grid using optimal lattice-covering.
| scan | [out] initialized scan-state for lattice-scan |
| init | [in] scan init parameters |
Definition at line 159 of file DopplerLatticeCovering.c.
| int XLALFreeDopplerLatticeScan | ( | DopplerLatticeScan ** | scan | ) |
Free an allocated DopplerLatticeScan.
Return: 0=OK, -1=ERROR
Definition at line 273 of file DopplerLatticeCovering.c.
| int XLALgetCurrentLatticeIndex | ( | gsl_vector_int ** | Index, | |
| const DopplerLatticeScan * | scan | |||
| ) |
Return current lattice Index of the scan: allocate Index here if *Index == NULL, otherwise use given vector [has to have right dimension].
Definition at line 312 of file DopplerLatticeCovering.c.
| int XLALsetCurrentLatticeIndex | ( | DopplerLatticeScan * | scan, | |
| const gsl_vector_int * | Index | |||
| ) |
| REAL8 XLALCountLatticeTemplates | ( | const DopplerLatticeScan * | scan | ) |
Count number of templates in lattice-grid by stepping through the whole grid.
NOTE: original scan-state isn't modified.
Return: > 0: OK, -1=ERROR
Definition at line 358 of file DopplerLatticeCovering.c.
| int XLALadvanceLatticeIndex | ( | DopplerLatticeScan * | scan | ) |
The central "lattice-stepping" function: advance to the 'next' Index-point, taking care not to leave the boundary, and to cover the whole (convex!) search-region eventually!
Return: 0=OK, -1=ERROR, +1=No more lattice points left
Definition at line 403 of file DopplerLatticeCovering.c.
| int XLALgetCurrentDopplerPos | ( | PulsarDopplerParams * | pos, | |
| const DopplerLatticeScan * | scan, | |||
| CoordinateSystem | skyCoords | |||
| ) |
Return the current doppler-position {Freq, Alpha, Delta, f1dot, f2dot, .
.. } of the lattice-scan NOTE: the skyposition coordinate-system is chosen via 'skyCoords' in [EQUATORIAL, ECLIPTIC]
Definition at line 492 of file DopplerLatticeCovering.c.
Definition at line 122 of file DopplerLatticeCovering.c.
DECLARE AND SET GLOBAL DEBUG LEVEL.
see the section (currently 7.4.1) of the LSD on "Status-reporting objects" for a list of predefined debug levels
Definition at line 62 of file BCVSpinTemplates.c.
1.5.2