Astronomy


Data Structures

struct  psPlane
 Euclidiean Coordinate System. More...
struct  psSphere
 Angular Coordinate System. More...
struct  psCube
 3-Dimensional Euclidean Coordinate System More...
struct  psPlaneTransform
 2D Polynomial Transform More...
struct  psPlaneDistort
 4D Polynomial Transform More...
struct  psProjection
 Parameter set for projection/deprojection. More...
struct  psEarthPole
 Structure for respresenting the Earth's pole at any moment or determine velocity at the pole. More...
struct  psSphereRot
 Spherical Rotation Definition. More...
struct  psTime
 Definition of psTime. More...

Defines

#define PS_PRINT_PLANE_TRANSFORM(NAME)

Enumerations

enum  psProjectionType {
  PS_PROJ_LIN, PS_PROJ_PLY, PS_PROJ_WRP, PS_PROJ_TAN, PS_PROJ_DIS, PS_PROJ_SIN, PS_PROJ_STG, PS_PROJ_ZEA, PS_PROJ_ZPL, PS_PROJ_AIT,
  PS_PROJ_PAR, PS_PROJ_GLS, PS_PROJ_CAR, PS_PROJ_MER, PS_PROJ_NTYPE
}
 Projection type for projection/deprojection. More...
enum  psPrecessMethod { PS_PRECESS_ROUGH, PS_PRECESS_COMPLETE_A, PS_PRECESS_COMPLETE_B, PS_PRECESS_IAU2000A }
 Method for spherical precession used to specify the level of detail used in calculation. More...
enum  psSphereOffsetMode { PS_SPHERICAL, PS_LINEAR }
 Mode for Offset calculation between two sky positions. More...
enum  psSphereOffsetUnit { PS_ARCSEC, PS_ARCMIN, PS_DEGREE, PS_RADIAN }
 The units of the offset. More...
enum  psTimeType { PS_TIME_TAI, PS_TIME_UTC, PS_TIME_UT1, PS_TIME_TT }
 Time type. More...
enum  psTimeBulletin { PS_IERS_A, PS_IERS_B }
 Time Bulletin type. More...

Functions

psPlanepsPlaneAlloc (void)
 Allocates a psPlane.
psSpherepsSphereAlloc (void)
 Allocates a psSphere.
psCubepsCubeAlloc (void)
 Allocates a psCube.
psPlaneTransformpsPlaneTransformAlloc (int order1, int order2)
 Allocates a psPlaneTransform transform.
psPlanepsPlaneTransformApply (psPlane *out, const psPlaneTransform *transform, const psPlane *coords)
 Applies the psPlaneTransform transform to a specified coordinate.
psPlaneDistortpsPlaneDistortAlloc (int order1, int order2, int order3, int order4)
 Allocates a psPlaneDistort transform.
psPlanepsPlaneDistortApply (psPlane *out, const psPlaneDistort *distort, const psPlane *coords, float mag, float color)
 Applies the psPlaneDistort transform to a specified coordinate.
psProjectionpsProjectionAlloc (double R, double D, double Xs, double Ys, psProjectionType type)
 Allocates memory for a psProjection structure.
bool psMemCheckPlane (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckSphere (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckCube (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckPlaneTransform (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckPlaneDistort (psPtr ptr)
 Checks the type of a particular pointer.
bool psMemCheckProjection (psPtr ptr)
 Checks the type of a particular pointer.
psPlanepsProject (psPlane *out, const psSphere *coord, const psProjection *projection)
 Projects a spherical coordinate to a linear coordinate system.
psSpherepsDeproject (psSphere *outSphere, const psPlane *coord, const psProjection *projection)
 Reverse projection of a linear coordinate to a spherical coordinate system.
psPlaneTransformp_psPlaneTransformLinearInvert (psPlaneTransform *transform)
 Takes a given transform and inverts it linearly if possible.
psBool p_psIsProjectionLinear (psPlaneTransform *transform)
 Takes a transform and tests whether or not it is a linear projection.
psPlaneTransformpsPlaneTransformInvert (psPlaneTransform *out, const psPlaneTransform *in, psRegion region, int nSamples)
 inverts a given transformation.
psPlaneTransformpsPlaneTransformCombine (psPlaneTransform *out, const psPlaneTransform *trans1, const psPlaneTransform *trans2, psRegion region, int nSamples)
 Creates a single transformation that has the effect of performing trans1 followed by trans2.
bool psPlaneTransformFit (psPlaneTransform *trans, const psArray *source, const psArray *dest, int nRejIter, float sigmaClip)
 takes two arrays containing matched coordinates and returns the best-fitting transformation.
psSpherepsCubeToSphere (const psCube *cube)
 Converts from a 3-dimensional coordinate system to an angular coordinate system.
psCubepsSphereToCube (const psSphere *sphere)
 Converts from an angular coordinate system to a 3-dimensional coordinate system.
psPlanepsPlaneTransformDeriv (psPlane *out, const psPlaneTransform *transformation, const psPlane *coord)
 Calculates the derivative of the specified psPlaneTransform with respect to x and y.
psPixelspsPixelsTransform (psPixels *out, const psPixels *input, const psPlaneTransform *inToOut)
 Generates a list of pixels in the output coordinate frame that overlap the input pixels in the input coordinate frame through the specified transformation, inToOut.
char * psProjectTypeToString (psProjectionType type, char *prefix)
psProjectionType psProjectTypeFromString (char *name)
bool p_psEOCInit (void)
 Initialize EOC.
bool p_psEOCFinalize (void)
 Finalize EOC after using functions that make calls to eocInit for time table data.
psEarthPolepsEarthPoleAlloc (void)
 Allocates a new psEarthPole structure.
psSpherepsAberration (psSphere *apparent, const psSphere *actual, const psSphere *direction, double speed)
 Calculates the apparent position of a star, given its actual position and the velocity vector of the observer.
psSpherepsGravityDeflection (psSphere *apparent, psSphere *actual, psSphere *sun)
 Calculates the apparent position of a star, given its actual position and the position of the sun.
psEarthPolepsEOC_PrecessionModel (const psTime *time)
 Calculates the components of the rotation between the CEO and GCRS frames, X, Y, and s, using the IAU2000A precession & nutation model.
psEarthPolepsEOC_PrecessionCorr (const psTime *time, psTimeBulletin bulletin)
 Provides interpolated corrections to the X and Y components of the polar coordinates from the tables provided by the IERS, just as it does for UT1 and polar motion.
psSphereRotpsSphereRot_CEOtoGCRS (const psEarthPole *pole)
 Constructs the spherical rotation for transforming from CEO to GCRS coordinates.
psSphereRotpsSphereRot_TEOtoCEO (const psTime *time, psEarthPole *tidalCorr)
 Calculates the rotation of the Earth about the CIP.
psEarthPolepsEOC_GetPolarMotion (const psTime *time, psTimeBulletin bulletin)
 Provides interpolated values of the polar motion components extracted from the IERS tables.
psEarthPolepsEOC_PolarTideCorr (const psTime *time)
 Provides tidal corrections to the polar motion components using the Ray model of Simon et al.
psEarthPolepsEOC_NutationCorr (psTime *time)
 Provides the additional corrections due to nutation terms with periods less than or equal to two days, as well as the correction to the s-prime component of polar motion.
psSphereRotpsSphereRot_ITRStoTEO (const psEarthPole *motion)
 Converts the polar motion corrections to a spherical rotation.
psSphereRotpsSpherePrecess (const psTime *fromTime, const psTime *toTime, psPrecessMethod mode)
 Generates the complete spherical rotation to account for precession between two times.
psSphereRotpsSphereRotAlloc (double alphaP, double deltaP, double phiP)
 Allocator for psSphereRot.
bool psMemCheckSphereRot (psPtr ptr)
 Checks the type of a particular pointer.
psSphereRotpsSphereRotQuat (double q0, double q1, double q2, double q3)
 Allocator for psSphereRot given quaternions.
psSpherepsSphereRotApply (psSphere *out, const psSphereRot *transform, const psSphere *coord)
 Applies the psSphereTransform transform for a specified coordinate.
psSphereRotpsSphereRotCombine (psSphereRot *out, const psSphereRot *rot1, const psSphereRot *rot2)
 Combines two rotations.
psSphereRotpsSphereRotConjugate (psSphereRot *out, const psSphereRot *in)
 Returns the conjugate of a specified rotation.
psSphereRotpsSphereRotInvert (double alphaP, double deltaP, double phiP)
 Inverts the rotation.
psSpherepsSphereGetOffset (const psSphere *position1, const psSphere *position2, psSphereOffsetMode mode, psSphereOffsetUnit unit)
 Determines the offset (RA,Dec) on the sky between two positions.
psSpherepsSphereSetOffset (const psSphere *position, const psSphere *offset, psSphereOffsetMode mode, psSphereOffsetUnit unit)
 Applies the given offset to a coordinate.
psSphereRotpsSphereRotICRSToEcliptic (const psTime *time)
 Creates the appropriate transform for converting from ICRS to Ecliptic coordinate systems.
psSphereRotpsSphereRotEclipticToICRS (const psTime *time)
 Creates the appropriate transform for converting from Ecliptic to ICRS coordinate systems.
psSphereRotpsSphereRotICRSToGalactic (void)
 Creates the appropriate transform for converting from ICRS to Galactic coordinate systems.
psSphereRotpsSphereRotGalacticToICRS (void)
 Creates the appropriate transform for converting from Galactic to ICRS coordinate systems.
const char * p_psTimeConfigFileName ()
psBool p_psTimeInit (const char *fileName)
 Initialize time data.
void psTimeInitialize (const char *timeConfig)
 Initialize time data.
psBool p_psTimeFinalize (void)
 Free memory persistant time data.
void psTimeFinalize (void)
 Frees memory that was allocated by psTime functions.
psTimepsTimeAlloc (psTimeType type)
 Allocate time struct.
bool psMemCheckTime (psPtr ptr)
 Checks the type of a particular pointer.
psTimepsTimeGetNow (psTimeType type)
 Get current time.
psTimepsTimeConvert (psTime *time, psTimeType type)
 Convert psTime to UTC, TAI, UT1, or TT time.
double psTimeToLMST (psTime *time, double longitude)
 Convert psTime to Local Mean Sidereal Time (LMST).
double psTimeGetUT1Delta (const psTime *time, psTimeBulletin bulletin)
 Determine UT1 - UTC from table lookup.
psTimepsTime_TideUT1Corr (const psTime *time)
 Provides tidal corrections to UT1-UTC.
psF64 p_psTimeGetTAIDelta (const psTime *time)
 Determine TAI - UTC from table lookup.
psSpherep_psTimeGetPoleCoords (const psTime *time)
 Determine polar coordinates at a given time.
long psTimeLeapSecondDelta (const psTime *time1, const psTime *time2)
 Calculate the number of leapseconds between two times.
bool psTimeIsLeapSecond (const psTime *utc)
 Determine if UTC time is a leapsecond.
double psTimeToJD (const psTime *time)
 Convert psTime to Julian date time.
double psTimeToMJD (const psTime *time)
 Convert psTime to modified Julian date time.
psString psTimeToISO (const psTime *time)
 Convert psTime to ISO8601 formatted string.
tm * psTimeToTM (const psTime *time)
 Convert psTime to struct tm time.
timeval * psTimeToTimeval (const psTime *time)
 Convert psTime to timeval time.
psTimepsTimeFromJD (double jd)
 Convert JD to psTime.
psTimepsTimeFromMJD (double mjd)
 Convert MJD to psTime.
psTimepsTimeFromISO (const char *input, psTimeType type)
 Convert ISO to psTime.
psTimepsTimeFromTimeval (const struct timeval *input)
 Convert timeval to psTime.
psTimepsTimeFromTT (psS64 sec, psU32 nsec)
 Convert Terrestrial Time to psTime.
psTimepsTimeFromUTC (psS64 sec, psU32 nsec, bool leapsecond)
 Convert UTC time to psTime.
psTimepsTimeFromTM (const struct tm *time)
 Convert tm time to psTime.
psTimepsTimeStrptime (const char *s, const char *format)
 Convert an arbitrary string into a psTime.
psString psTimeStrftime (const psTime *time, const char *format)
 Convert a psTime into a formated string.
psTimepsTimeMath (const psTime *time, double delta)
 Adds delta to time.
double psTimeDelta (const psTime *time1, const psTime *time2)
 Determine difference between two times.
psF64 p_psTimeSearchTables (psF64 index, psU64 column, char *metadataTableNames[], psU32 nTables, psLookupStatusType *status)
 Searches the IERS time tables for a specified entry location.
bool psTimerStart (char *name)
 Stores the current time in a psHash of timers, under the supplied name.
psF64 psTimerClear (char *name)
 Resets the named timer.
psF64 psTimerMark (char *name)
 Returns the elapsed time, in seconds, for the timer specified by name.
bool psTimerStop (void)
 Frees all memory associated with all timers and returns the expended time.
psTimepsTimeCopy (const psTime *inTime)
 Copy a psTime.


Define Documentation

#define PS_PRINT_PLANE_TRANSFORM ( NAME   ) 

Value:

{ \
    printf("---------------------- Plane Transform ----------------------\n"); \
    printf("x:\n"); \
    PS_POLY_PRINT_2D(NAME->x); \
    printf("y:\n"); \
    PS_POLY_PRINT_2D(NAME->y); \
} \

Definition at line 448 of file psCoord.h.


Enumeration Type Documentation

enum psPrecessMethod

Method for spherical precession used to specify the level of detail used in calculation.

See also:
psSpherePrecess
Enumerator:
PS_PRECESS_ROUGH  roughest, lowest level of detail
PS_PRECESS_COMPLETE_A  complete level of detail using IERS A
PS_PRECESS_COMPLETE_B  complete level of detail using IERS B
PS_PRECESS_IAU2000A  highest level of detail

Definition at line 42 of file psEarthOrientation.h.

enum psProjectionType

Projection type for projection/deprojection.

See also:
psProject, psDeproject
Enumerator:
PS_PROJ_LIN  Linear projection.
PS_PROJ_PLY  Linear polynomial projection.
PS_PROJ_WRP  Linear polynomial projection.
PS_PROJ_TAN  Tangent projection.
PS_PROJ_DIS  Sine projection.
PS_PROJ_SIN  Sine projection.
PS_PROJ_STG  Sine projection.
PS_PROJ_ZEA  Sine projection.
PS_PROJ_ZPL  Sine projection.
PS_PROJ_AIT  Aitoff projection.
PS_PROJ_PAR  Par projection.
PS_PROJ_GLS  GLS projection.
PS_PROJ_CAR  CAR projection.
PS_PROJ_MER  MER projection.
PS_PROJ_NTYPE  Number of types; must be last.

Definition at line 120 of file psCoord.h.

enum psSphereOffsetMode

Mode for Offset calculation between two sky positions.

See also:
psSphereGetOffset, psSphereSetOffset
Enumerator:
PS_SPHERICAL  offset corresponds to an angular offset
PS_LINEAR  offset corresponds to a linear offset

Definition at line 44 of file psSphereOps.h.

enum psSphereOffsetUnit

The units of the offset.

See also:
psSphereGetOffset, psSphereSetOffset
Enumerator:
PS_ARCSEC  Arcseconds.
PS_ARCMIN  Arcminutes.
PS_DEGREE  Degrees.
PS_RADIAN  Radians.

Definition at line 54 of file psSphereOps.h.

enum psTimeBulletin

Time Bulletin type.

Enumeration for psTimeBulletin type, A or B.

Enumerator:
PS_IERS_A  IERS Bulletin A.
PS_IERS_B  IERS Bulletin B.

Definition at line 55 of file psTime.h.

enum psTimeType

Time type.

Enumeration for psTime types, TAI or UTC time.

Enumerator:
PS_TIME_TAI  Temps Atomique International (TAI) time (time with leapseconds).
PS_TIME_UTC  Universal Time Coordinated (UTC) time (time without leapseconds).
PS_TIME_UT1  Universal Time corrected for polar motion.
PS_TIME_TT  Terrestrial Time.

Definition at line 44 of file psTime.h.


Function Documentation

bool p_psEOCFinalize ( void   ) 

Finalize EOC after using functions that make calls to eocInit for time table data.

Returns:
bool: True if successful, otherwise false.

bool p_psEOCInit ( void   ) 

Initialize EOC.

Parses IERS table data and creates the polynomials used by certain EOC functions.

Returns:
bool: True if successful, otherwise false.

psBool p_psIsProjectionLinear ( psPlaneTransform transform  ) 

Takes a transform and tests whether or not it is a linear projection.

Returns:
psS32 the order of the projection
Parameters:
transform  transform to test for linearity

psPlaneTransform* p_psPlaneTransformLinearInvert ( psPlaneTransform transform  ) 

Takes a given transform and inverts it linearly if possible.

Returns:
psPlaneTransform the linearly inverted transform
Parameters:
transform  transform to invert

const char* p_psTimeConfigFileName (  ) 

psBool p_psTimeFinalize ( void   ) 

Free memory persistant time data.

Frees time data to be held in memory until the end of successful program execution.

Returns:
void: void.

psSphere* p_psTimeGetPoleCoords ( const psTime time  ) 

Determine polar coordinates at a given time.

Determines the orientation of the polar axis at the given time.

Returns:
psSphere*: Spherical coordinates of Earth's polar axias.
Parameters:
time  psTime determine polar orientation.

psF64 p_psTimeGetTAIDelta ( const psTime time  ) 

Determine TAI - UTC from table lookup.

This function is necessary to for various psTime functions.

Returns:
psF64: Time difference.
Parameters:
time  psTime to be looked up.

psBool p_psTimeInit ( const char *  fileName  ) 

Initialize time data.

Reads config and data files associated with various time conversions.

Returns:
bool: True for success, false for failure.
Parameters:
fileName  File name containing config/data info

psF64 p_psTimeSearchTables ( psF64  index,
psU64  column,
char *  metadataTableNames[],
psU32  nTables,
psLookupStatusType status 
)

Searches the IERS time tables for a specified entry location.

Returns the interpolated double precision (arcsec) value at the specified entry location. Inputs to specify are the time index in mjd, the column number corresponding to Xp, Yp, or Sp (UT1-UTC) in IERS A or B, the time table names, and the number of time tables.

Returns:
psF64: Resulting table entry for specified parameters.
Parameters:
index  time index for which to search
column  column number of specified index
metadataTableNames  names of IERS tables to search
nTables  number of IERS tables to search
status  status of table search

psSphere* psAberration ( psSphere apparent,
const psSphere actual,
const psSphere direction,
double  speed 
)

Calculates the apparent position of a star, given its actual position and the velocity vector of the observer.

The actual and apparent positions are represented as psSphere entries, as is the direction of motion. The speed in that direction is given in units of the speed of light. If the value of apparent is NULL, a new psSphere is allocated, otherwise the point to apparent is used for the result.

Returns:
psSphere*: the actual position of a star.
Parameters:
apparent  apparent position of star
actual  actual position of star
direction  direction of motion of observer
speed  speed of motion of observer

psCube* psCubeAlloc ( void   ) 

Allocates a psCube.

Returns:
psCube* resulting cubic structure.

psSphere* psCubeToSphere ( const psCube cube  ) 

Converts from a 3-dimensional coordinate system to an angular coordinate system.

Returns:
psSphere* The former psCube in terms of a psSphere.
Parameters:
cube  psCube to convert

psSphere* psDeproject ( psSphere outSphere,
const psPlane coord,
const psProjection projection 
)

Reverse projection of a linear coordinate to a spherical coordinate system.

Returns:
psPlane* projected coordinate
Parameters:
coord  coordinate to project
projection  parameters of the projection

psEarthPole* psEarthPoleAlloc ( void   ) 

Allocates a new psEarthPole structure.

psEarthPole* psEOC_GetPolarMotion ( const psTime time,
psTimeBulletin  bulletin 
)

Provides interpolated values of the polar motion components extracted from the IERS tables.

Returns:
psEarthPole*: interpolated polar motion components.
Parameters:
time  specified time
bulletin  IERS tables for polar coordinate components.

psEarthPole* psEOC_NutationCorr ( psTime time  ) 

Provides the additional corrections due to nutation terms with periods less than or equal to two days, as well as the correction to the s-prime component of polar motion.

Returns:
psEarthPole*: corrected polar motion components.
Parameters:
time  specified time

psEarthPole* psEOC_PolarTideCorr ( const psTime time  ) 

Provides tidal corrections to the polar motion components using the Ray model of Simon et al.

Returns:
psEarthPole*: corrected polar motion components.
Parameters:
time  specified time

psEarthPole* psEOC_PrecessionCorr ( const psTime time,
psTimeBulletin  bulletin 
)

Provides interpolated corrections to the X and Y components of the polar coordinates from the tables provided by the IERS, just as it does for UT1 and polar motion.

Returns:
psEarthPole*: interpolated corrections to the precession components.
Parameters:
time  specified time
bulletin  IERS tables for polar coordinate components.

psEarthPole* psEOC_PrecessionModel ( const psTime time  ) 

Calculates the components of the rotation between the CEO and GCRS frames, X, Y, and s, using the IAU2000A precession & nutation model.

The input time may be represented in any format other than UT1. This routine must give results identical to the IERS XYS2000A subroutine.

Returns:
psEarthPole*: the calculated components of the rotation.
Parameters:
time  specified time

psSphere* psGravityDeflection ( psSphere apparent,
psSphere actual,
psSphere sun 
)

Calculates the apparent position of a star, given its actual position and the position of the sun.

The actual and apparent positions are represented as psSphere entries, as is position of the sun. If the value of apparent is NULL, a new psSphere is allocated, otherwise the point to apparent is used for the result.

Returns:
psSphere*: the apparent position of a star.
Parameters:
apparent  apparent position of star
actual  actual position of star
sun  position of the sun

bool psMemCheckCube ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psCube structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckPlane ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPlane structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckPlaneDistort ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPlaneDistort structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckPlaneTransform ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psPlaneTransform structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckProjection ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psProjection structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckSphere ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psSphere structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckSphereRot ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psSphereRot structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

bool psMemCheckTime ( psPtr  ptr  ) 

Checks the type of a particular pointer.

Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.

Returns:
bool: True if the pointer matches a psTime structure, false otherwise.
Parameters:
ptr  the pointer whose type to check

psPixels* psPixelsTransform ( psPixels out,
const psPixels input,
const psPlaneTransform inToOut 
)

Generates a list of pixels in the output coordinate frame that overlap the input pixels in the input coordinate frame through the specified transformation, inToOut.

psPixelsTransform is more complicated than simply transforming the input pixels, but requires the evaluation of the derivatives of the transformation in order to obtain the list of all pixels in the output coordinate frame that possibly overlap the pixel in the input coordinate frame. In the event that input or inToOut are NULL, the function shall generate an error and return NULL. If out is non-NULL it shall be modified and returned; otherwise a new psPixels shall be allocated and returned.

Returns:
psPixels*: the list of overlapping pixels.
Parameters:
out  output list of overlapping pixels
input  input list of pixels
inToOut  specified transformation

psPlane* psPlaneAlloc ( void   ) 

Allocates a psPlane.

Returns:
psPlane* resulting plane structure.

psPlaneDistort* psPlaneDistortAlloc ( int  order1,
int  order2,
int  order3,
int  order4 
)

Allocates a psPlaneDistort transform.

Returns:
psPlaneDistort* resulting plane distort transform
Parameters:
order1  The order of the w term in the transform.
order2  The order of the x term in the transform.
order3  The order of the y term in the transform.
order4  The order of the z term in the transform.

psPlane* psPlaneDistortApply ( psPlane out,
const psPlaneDistort distort,
const psPlane coords,
float  mag,
float  color 
)

Applies the psPlaneDistort transform to a specified coordinate.

Returns:
psPlane* resulting coordinate based on transform
Parameters:
out  a psPlane to recycle. If NULL, a new one is generated.
distort  the transform to apply
coords  the coordinate to apply the transform above.
mag  third term -- maybe magnitude
color  forth term -- maybe color

psPlaneTransform* psPlaneTransformAlloc ( int  order1,
int  order2 
)

Allocates a psPlaneTransform transform.

Returns:
psPlaneTransform* resulting plane transform
Parameters:
order1  The order of the x term in the transform.
order2  The order of the y term in the transform.

psPlane* psPlaneTransformApply ( psPlane out,
const psPlaneTransform transform,
const psPlane coords 
)

Applies the psPlaneTransform transform to a specified coordinate.

Returns:
psPlane* resulting coordinate based on transform
Parameters:
out  a psPlane to recycle. If NULL, a new one is generated.
transform  the transform to apply
coords  the coordinate to apply the transform above.

psPlaneTransform* psPlaneTransformCombine ( psPlaneTransform out,
const psPlaneTransform trans1,
const psPlaneTransform trans2,
psRegion  region,
int  nSamples 
)

Creates a single transformation that has the effect of performing trans1 followed by trans2.

psPlaneTransformCombine takes two transformations (trans1 and trans2) and returns a single transformation that has the effect of performing trans1 followed by trans2. In the event that the input transformation is linear, an exact solution may be calculated; otherwise nSamples samples in each axis, covering the region specified by region shall be used as a grid to fit the best inverse transformation. The function shall return NULL if it was unable to generate the transformation; otherwise it shall return the transformation.

Returns:
psPlaneTransform* resulting transformation
Parameters:
out  a transform to recycle, or NULL if one is to be created.
trans1  first transform to combine
trans2  first transform to combine
region  region to cover (for non-linear transforms)
nSamples  number of samples on each axis (for non-linear transforms)

psPlane* psPlaneTransformDeriv ( psPlane out,
const psPlaneTransform transformation,
const psPlane coord 
)

Calculates the derivative of the specified psPlaneTransform with respect to x and y.

Returns:
psPlane* The derivative.

bool psPlaneTransformFit ( psPlaneTransform trans,
const psArray source,
const psArray dest,
int  nRejIter,
float  sigmaClip 
)

takes two arrays containing matched coordinates and returns the best-fitting transformation.

psPlaneTransformFit takes two arrays containing matched coordinates (i.e., coordinates in the source array correspond to the coordinates in the dest array) and returns the best-fitting transformation. The source and dest will contain psCoords. In the event that the number of coordinates in each is not identical, the function shall generate a warning, and extra coordinates in the longer of the two shall be ignored. The trans transform may not be NULL, since it specifies the desired order, polynomial type and any polynomial terms to mask. nRejIter rejection iterations shall be performed, wherein coordinates lying more than sigmaClip standard deviations from the fit shall be rejected.

Returns:
bool TRUE if successful, otherwise FALSE.
Parameters:
trans  desired order, polynomial type, & polynomial mask terms
source  coordinates matching those in dest
dest  coordinates matching those in source
nRejIter  number of rejection iterations to be performed
sigmaClip  coordinates above this number of standard deviations will be rejected

psPlaneTransform* psPlaneTransformInvert ( psPlaneTransform out,
const psPlaneTransform in,
psRegion  region,
int  nSamples 
)

inverts a given transformation.

It may assume that the input transformation is one-to-one, and that the inverse transformation may be specified through using polynomials of the same type and order as the forward transformation. In the event that the input transformation is linear, an exact solution may be calculated; otherwise nSamples samples in each axis, covering the region specified by region shall be used as a grid to fit the best inverse transformation. The function shall return NULL if it was unable to generate the inverse transformation; otherwise it shall return the inverse transformation. In the event that out is NULL, a new psPlaneTransform shall be allocated and returned.

Returns:
psPlaneTransform* the resulting inverted transform
Parameters:
out  a transform to recycle, or NULL if one is to be created.
in  transform to invert
region  region to fit for non-linear transform inversion
nSamples  number of samples in each axis for fit

psPlane* psProject ( psPlane out,
const psSphere coord,
const psProjection projection 
)

Projects a spherical coordinate to a linear coordinate system.

Returns:
psPlane* projected coordinate
Parameters:
coord  coordinate to project
projection  parameters of the projection

psProjection* psProjectionAlloc ( double  R,
double  D,
double  Xs,
double  Ys,
psProjectionType  type 
)

Allocates memory for a psProjection structure.

Returns:
psProjection* psProjection structure
Parameters:
R  Right-ascension of projection center.
D  Declination of projection center.
Xs  Scale in x-dimension
Ys  Scale in y-dimension

psProjectionType psProjectTypeFromString ( char *  name  ) 

char* psProjectTypeToString ( psProjectionType  type,
char *  prefix 
)

psSphere* psSphereAlloc ( void   ) 

Allocates a psSphere.

Returns:
psSphere* resulting sphere structure.

psSphere* psSphereGetOffset ( const psSphere position1,
const psSphere position2,
psSphereOffsetMode  mode,
psSphereOffsetUnit  unit 
)

Determines the offset (RA,Dec) on the sky between two positions.

Both an offset mode and an offset unit may be defined. The mode may be either PS_SPHERICAL, in which case the specified offset corresponds to an offset in angles, or it may be PS_LINEAR, in which case the offset corresponds to a linear offset in a local projection. The offset unit may be in one of PS_ARCSEC, PS_ARCMIN, PS_DEGREE, and PS_RADIAN, which specifies the units of the offset only.

Returns:
psSphere* the offset between position1 and position2
Parameters:
position1  first position for calculating offset
position2  second position for calculating offset
mode  type of offset can be PS_SPHERICAL or PS_LINEAR
unit  specifies the units of offset only

psSphereRot* psSpherePrecess ( const psTime fromTime,
const psTime toTime,
psPrecessMethod  mode 
)

Generates the complete spherical rotation to account for precession between two times.

The equinoxes shall be Julian equinoxes.

If NULL is provided for either time, it is assumed to have the reference equinox value of J2000. The mode argument is used to specify the level of detail used in the calculation.

Returns:
psSphere*: the resulting spherical rotation
Parameters:
fromTime  equinox of coords input
toTime  equinox of coords output
mode  level of detail to use

psSphereRot* psSphereRot_CEOtoGCRS ( const psEarthPole pole  ) 

Constructs the spherical rotation for transforming from CEO to GCRS coordinates.

The resulting psSphereRot may be used to determine the rotation from CIP/CEO to GCRS. This function must give results identical to the IERS BPN2000.

Returns:
psSphereRot*: spherical rotation for CEO to GCRS transformation.
Parameters:
pole  input coordinates to transform

psSphereRot* psSphereRot_ITRStoTEO ( const psEarthPole motion  ) 

Converts the polar motion corrections to a spherical rotation.

This function should give identical results to the IERS POM2000 subroutine.

Returns:
psSphereRot*: ITRS to TEO sphere rotation.
Parameters:
motion  corrected polar motion components

psSphereRot* psSphereRot_TEOtoCEO ( const psTime time,
psEarthPole tidalCorr 
)

Calculates the rotation of the Earth about the CIP.

If tidalCorr is non-NULL, use the S-component to provide tidal corrections to the UT1 time. If tidalCorr is NULL, no corrections are made & this step is skipped.

Returns:
psSphereRot*: spherical rotation of the Earth about the CIP.
Parameters:
time  specified time
tidalCorr  UT1 polar tide correction or NULL

psSphereRot* psSphereRotAlloc ( double  alphaP,
double  deltaP,
double  phiP 
)

Allocator for psSphereRot.

Returns:
psSphereRot* newly allocated psSphereRot
Parameters:
alphaP  north pole latitude
deltaP  north pole longitude
phiP  defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).

psSphere* psSphereRotApply ( psSphere out,
const psSphereRot transform,
const psSphere coord 
)

Applies the psSphereTransform transform for a specified coordinate.

Returns:
psSphere* resulting coordinate based on transform
Parameters:
out  a psSphere to recycle. If NULL, a new one is generated.
transform  the transform to apply
coord  the coordinate to apply the transform above.x

psSphereRot* psSphereRotCombine ( psSphereRot out,
const psSphereRot rot1,
const psSphereRot rot2 
)

Combines two rotations.

Combines two rotations to produce a single rotation which is the equivalent of applying the rst rotation and then the second. The output rotation may be supplied, or will be allocated if NULL.

Returns:
psSphereRot* New psSphereRot that is the combination of the input psSphereRots
Parameters:
out  a psSphereRot to recycle or NULL
rot1  first rotation to combine
rot2  second rotation to combine

psSphereRot* psSphereRotConjugate ( psSphereRot out,
const psSphereRot in 
)

Returns the conjugate of a specified rotation.

Stores the conjugate of a specified rotation in an existing psSphereRot* or creates a new psSphereRot* if NULL. The conjugate of a rotation given in quaternions is -q0, -q1, -q2, q3.

Returns:
psSphereRot* the Conjugate of the specified psSphereRot, in.
Parameters:
out  a psSphereRot to recycle or NULL
in  the psSphereRot from which to obtain the conjugate

psSphereRot* psSphereRotEclipticToICRS ( const psTime time  ) 

Creates the appropriate transform for converting from Ecliptic to ICRS coordinate systems.

Returns:
psSphereRot* transform for Ecliptic->ICRS coordinate systems
Parameters:
time  the time for which the resulting transform will be valid

psSphereRot* psSphereRotGalacticToICRS ( void   ) 

Creates the appropriate transform for converting from Galactic to ICRS coordinate systems.

Returns:
psSphereRot* new sphere rotation for Galactic to ICRS transformations.

psSphereRot* psSphereRotICRSToEcliptic ( const psTime time  ) 

Creates the appropriate transform for converting from ICRS to Ecliptic coordinate systems.

Returns:
psSphereRot* transform for ICRS->Ecliptic coordinate systems
Parameters:
time  the time for which the resulting transform will be valid

psSphereRot* psSphereRotICRSToGalactic ( void   ) 

Creates the appropriate transform for converting from ICRS to Galactic coordinate systems.

Returns:
psSphereRot* new sphere rotation for ICRS to Galactic transformations.

psSphereRot* psSphereRotInvert ( double  alphaP,
double  deltaP,
double  phiP 
)

Inverts the rotation.

A given rotation is inverted by creating a psSphereRot using -phiP, -deltaP, -alphaP.

Returns:
psSphereRot* Inverted input psSphereRot
Parameters:
alphaP  north pole latitude
deltaP  north pole longitude
phiP  defines the longitude in the input system of the equatorial intersection between the two systems (e.g, the first point of Ares).

psSphereRot* psSphereRotQuat ( double  q0,
double  q1,
double  q2,
double  q3 
)

Allocator for psSphereRot given quaternions.

Normalizes a given quaternion and returns the cooresponding newly allocated psSphereRot object.

Returns:
psSphereRot* newly allocated psSphereRot
Parameters:
q0  q0
q1  q1
q2  q2
q3  q3

psSphere* psSphereSetOffset ( const psSphere position,
const psSphere offset,
psSphereOffsetMode  mode,
psSphereOffsetUnit  unit 
)

Applies the given offset to a coordinate.

Both an offset mode and an offset unit may be defined. The mode may be either PS_SPHERICAL, in which case the specified offset corresponds to an offset in angles, or it may be PS_LINEAR, in which case the offset corresponds to a linear offset in a local projection. The offset unit may be in one of PS_ARCSEC, PS_ARCMIN, PS_DEGREE, and PS_RADIAN, which specifies the units of the offset only.

Returns:
psSphere* the original position with the given offset applied.
Parameters:
position  coordinate of origin
offset  coordinate of offset to apply
mode  corresponds to an offset in angles or local projection
unit  specifies the units of offset only

psCube* psSphereToCube ( const psSphere sphere  ) 

Converts from an angular coordinate system to a 3-dimensional coordinate system.

Returns:
psCube* The former psSphere in terms of a psCube.
Parameters:
sphere  psSphere to convert

psTime* psTime_TideUT1Corr ( const psTime time  ) 

Provides tidal corrections to UT1-UTC.

Uses the Ray model of Simon et al.

Returns:
psTime*: The corrected time in UT1.
Parameters:
time  psTime to be corrected.

psTime* psTimeAlloc ( psTimeType  type  ) 

Allocate time struct.

Allocates an empty time struct. User must specify the psTimeType (PS_TIME_TAI or PS_TIME_UTC) in the argument. The seconds and microseconds members of the struct are set to zero.

Returns:
psTime*: Struct with empty time.
Parameters:
type  Type of time to create (UTC or TAI).

psTime* psTimeConvert ( psTime time,
psTimeType  type 
)

Convert psTime to UTC, TAI, UT1, or TT time.

Converts psTime to UTC, TAI, UT1, or TT time based on the psTimeType argument.

Returns:
psTime*: Pointer to psTime.
Parameters:
time  Time to be converted.
type  Type to be converted to.

psTime* psTimeCopy ( const psTime inTime  ) 

Copy a psTime.

Returns:
psTime*: New copy of existing psTime.
Parameters:
inTime  input time to copy.

double psTimeDelta ( const psTime time1,
const psTime time2 
)

Determine difference between two times.

Result is in TAI time.

Determine difference between two times. Input times are converted to TAI format if necessary.

Returns:
double: Time difference.
Parameters:
time1  First time.
time2  Second time.

void psTimeFinalize ( void   ) 

Frees memory that was allocated by psTime functions.

Allows a subsequent search for leaked memory.

psTime* psTimeFromISO ( const char *  input,
psTimeType  type 
)

Convert ISO to psTime.

Converts ISO time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime*: time
Parameters:
input  Input time to be converted.
type  Time type.

psTime* psTimeFromJD ( double  jd  ) 

Convert JD to psTime.

Converts JD time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime: time.
Parameters:
jd  Input time to be converted.

psTime* psTimeFromMJD ( double  mjd  ) 

Convert MJD to psTime.

Converts MJD time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime: time.
Parameters:
mjd  Input time to be converted.

psTime* psTimeFromTimeval ( const struct timeval *  input  ) 

Convert timeval to psTime.

Converts timeval time to psTime. This function does not add or subtract leapseconds.

Returns:
psTime*: time.
Parameters:
input  Input time to be converted.

psTime* psTimeFromTM ( const struct tm *  time  ) 

Convert tm time to psTime.

Converts tm time to psTime. This function is based on a Perl algorithm availble in the Pan-STARRS Image processing Algorithm Design Description (ADD). This function does not add or subtract leapseconds.

Returns:
psTime*: time.
Parameters:
time  Input time to be converted.

psTime* psTimeFromTT ( psS64  sec,
psU32  nsec 
)

Convert Terrestrial Time to psTime.

Converts Terrestial Time to psTime. This function assumes resultant time is of type TT.

Returns:
psTime*: time (TT)
Parameters:
sec  Input terrestrial time in seconds
nsec  Input terrestrial time fraction of seconds (nanoseconds)

psTime* psTimeFromUTC ( psS64  sec,
psU32  nsec,
bool  leapsecond 
)

Convert UTC time to psTime.

Converts UTC time to psTime. It will verify if time specified is a leapsecond.

Returns:
psTime*: time (UTC)time
Parameters:
sec  Input time in seconds
nsec  Input time fraction of seconds (nanoseconds)
leapsecond  Input time is a leapsecond

psTime* psTimeGetNow ( psTimeType  type  ) 

Get current time.

Gets current time from the system clock. User must specify the psTimeType (PS_TIME_TAI or PS_TIME_UTC) in the argument.

Returns:
psTime*: Struct with current time.
Parameters:
type  Type of time to get (UTC or TAI).

double psTimeGetUT1Delta ( const psTime time,
psTimeBulletin  bulletin 
)

Determine UT1 - UTC from table lookup.

This function is necessary to for various SLALIB functions.

Returns:
double: Time difference.
Parameters:
time  psTime to be looked up.
bulletin  IERS bulletin to use

void psTimeInitialize ( const char *  timeConfig  ) 

Initialize time data.

Reads the configuration file and sets up the appropriate psTimeTables and predictions.

Parameters:
timeConfig  psTime configuration file

bool psTimeIsLeapSecond ( const psTime utc  ) 

Determine if UTC time is a leapsecond.

Determines if the specified UTC time is a valid leapsecond.

Returns:
bool: valid leap second
Parameters:
utc  UTC to verify if leap second

long psTimeLeapSecondDelta ( const psTime time1,
const psTime time2 
)

Calculate the number of leapseconds between two times.

Calculates the number of leapseconds between two times.

Returns:
long: leapseconds added between given times
Parameters:
time1  First input time.
time2  Second input time.

psTime* psTimeMath ( const psTime time,
double  delta 
)

Adds delta to time.

Result is in TAI time.

Adds delta to time. Input time is converted to TAI format if necessary.

Returns:
psTime*: time.
Parameters:
time  Time.
delta  Time delta.

psF64 psTimerClear ( char *  name  ) 

Resets the named timer.

Returns:
psF64: The time elapsed since start.
Parameters:
name  timer name to clear

psF64 psTimerMark ( char *  name  ) 

Returns the elapsed time, in seconds, for the timer specified by name.

Returns:
psF64: The elapsed time in seconds since timer start.
Parameters:
name  timer name to mark

bool psTimerStart ( char *  name  ) 

Stores the current time in a psHash of timers, under the supplied name.

Returns:
bool: True if successful, otherwise false.
Parameters:
name  timer name to start

bool psTimerStop ( void   ) 

Frees all memory associated with all timers and returns the expended time.

Returns:
psF64: The maximum time expended.

psString psTimeStrftime ( const psTime time,
const char *  format 
)

Convert a psTime into a formated string.

Converts a psTime, using a strftime(3) format, into a formatted string. See strftime(3) for documentation on this format.

Returns:
psString: string.
Parameters:
time  Time to be formatted.
format  strftime(3) format

psTime* psTimeStrptime ( const char *  s,
const char *  format 
)

Convert an arbitrary string into a psTime.

Converts a string, using a strptime(3) format, into a psTime. See strptime(3) for documentation on this format.

Returns:
psTime*: time.
Parameters:
s  string to be converted
format  strptime(3) format

psString psTimeToISO ( const psTime time  ) 

Convert psTime to ISO8601 formatted string.

Converts psTime to a null terminated string in the form of YYYY-MM-DDThh:mm:ss.sss. This function does not add or subtract leapseconds.

Returns:
psString: Pointer null terminated array of chars in ISO time.
Parameters:
time  Input time to be converted.

double psTimeToJD ( const psTime time  ) 

Convert psTime to Julian date time.

Converts psTime to Julian date (JD) time. This function does not add or subtract leapseconds.

Returns:
double: Julian Date (JD) time.
Parameters:
time  Input time to be converted.

double psTimeToLMST ( psTime time,
double  longitude 
)

Convert psTime to Local Mean Sidereal Time (LMST).

Converts psTime at the given longitude to LMST time. If the input time is not in UTC format, then it is converted.

Returns:
double: LST Time.
Parameters:
time  psTime to be converted.
longitude  Longitude.

double psTimeToMJD ( const psTime time  ) 

Convert psTime to modified Julian date time.

Converts psTime to modified Julian date (MJD) time. This function does not add or subtract leapseconds.

Returns:
double: Modified Julian Days (MJD) time.
Parameters:
time  Input time to be converted.

struct timeval* psTimeToTimeval ( const psTime time  ) 

Convert psTime to timeval time.

Converts psTime to timeval time. This function does not add or subtract leapseconds.

Returns:
timeval*: timeval struct time.
Parameters:
time  Input time to be converted.

struct tm* psTimeToTM ( const psTime time  ) 

Convert psTime to struct tm time.

Converts psTime to struct tm time. This function should handle UTC leapseconds correctly.

Returns:
tm*: tm struct.
Parameters:
time  Input time to be converted.


Generated on Fri Feb 2 22:25:49 2007 for pslib by  doxygen 1.5.1