SkyCoordinates.c File Reference

Author:
Creighton, T.Automatically converts among sky coordinate systems.
More...

#include <math.h>
#include <lal/LALStdlib.h>
#include <lal/LALConstants.h>
#include <lal/SkyCoordinates.h>

Include dependency graph for SkyCoordinates.c:

Go to the source code of this file.

Defines

#define LAL_ALPHAGAL   (3.366032942)
#define LAL_DELTAGAL   (0.473477302)
#define LAL_LGAL   (0.576)

Functions

 NRCSID (SKYCOORDINATESC,"$Id: SkyCoordinates.c,v 1.12 2007/06/08 14:41:47 bema Exp $")
void LALConvertSkyCoordinates (LALStatus *stat, SkyPosition *output, SkyPosition *input, ConvertSkyParams *params)
void LALNormalizeSkyPosition (LALStatus *stat, SkyPosition *posOut, const SkyPosition *posIn)
 LAL interface to XLALNormalizeSkyPosition().
int XLALNormalizeSkyPosition (SkyPosition *posInOut)
 If sky-position is not in the canonical range $(\alpha,\delta)\in [0,2\pi]\times[-\pi/2, \pi/2]$, normalize it by mapping it into this coordinate-interval.


Detailed Description

Author:
Creighton, T.Automatically converts among sky coordinate systems.

D.

Date:
Date
2007/06/08 14:41:47
Id
SkyCoordinates.c,v 1.12 2007/06/08 14:41:47 bema Exp

Description
The function LALConvertSkyCoordinates() transforms the contents of *input to the system specified in *params, storing the result in *output (which may point to the same object as *input for an in-place transformation). The routine makes calls to the functions in CelestialCoordinates.c and TerrestrialCoordinates.c as required; the *params object must store any data fields required by these functions, or an error will occur.

The function LALNormalizeSkyPosition() ``normalizes'' any given (spherical) sky-position (in radians), which means it projects the angles into $[0, 2\pi) \times [-\pi/2, \pi/2]$ if they lie outside.

Algorithm
LALConvertSkyCoordinates() is structured as a simple loop over transformations, each of which moves the output sky position one step closer to the desired final coordinates system. The usual ``flow'' of the algorithm is:
inject_ConvFlow.png
although one can also convert directly between equatorial and horizon coordinate systems if params->zenith is given in equatorial coordinates (i.e. if its longitudinal coordinate is the local mean sidereal time rather than the geographic longitude of the observer). This leads to the only error checking done within this function: when transforming to horizon coordinates, it checks that params->zenith is either in sky-fixed equatorial or Earth-fixed geographic coordinates. Other than this, error checking is left to the secondary function call; if a parameter is absent or poorly formatted, the called function will return an error.

Uses

Definition in file SkyCoordinates.c.


Define Documentation

#define LAL_ALPHAGAL   (3.366032942)

Definition at line 181 of file SkyCoordinates.c.

#define LAL_DELTAGAL   (0.473477302)

Definition at line 182 of file SkyCoordinates.c.

#define LAL_LGAL   (0.576)

Definition at line 183 of file SkyCoordinates.c.


Function Documentation

NRCSID ( SKYCOORDINATESC  ,
"$Id: SkyCoordinates.  c,
v 1.12 2007/06/08 14:41:47 bema Exp $"   
)

void LALConvertSkyCoordinates ( LALStatus stat,
SkyPosition output,
SkyPosition input,
ConvertSkyParams params 
)

Definition at line 189 of file SkyCoordinates.c.

void LALNormalizeSkyPosition ( LALStatus stat,
SkyPosition posOut,
const SkyPosition posIn 
)

LAL interface to XLALNormalizeSkyPosition().

Parameters:
posOut  [out] normalized sky-position
posIn  [in] general sky-position

Definition at line 281 of file SkyCoordinates.c.

int XLALNormalizeSkyPosition ( SkyPosition posInOut  ) 

If sky-position is not in the canonical range $(\alpha,\delta)\in [0,2\pi]\times[-\pi/2, \pi/2]$, normalize it by mapping it into this coordinate-interval.

Based on Alicia's function with some additional "unwinding" added. return 0 = OK, -1 = ERROR

Parameters:
posInOut  [in,out] sky-position to normalize

Definition at line 310 of file SkyCoordinates.c.


Generated on Sun Sep 7 03:08:09 2008 for LAL by  doxygen 1.5.2