Changeset 753 for trunk/archive/pslib/include/psPosition.h
- Timestamp:
- May 20, 2004, 6:12:37 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/archive/pslib/include/psPosition.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/include/psPosition.h
r710 r753 8 8 9 9 /** Structures *********************/ 10 11 /** projection types */ 12 typedef enum { ///< type of val is: 13 PS_PROJ_TAN, ///< Tangent projection 14 PS_PROJ_SIN, ///< Sine projection 15 PS_PROJ_AIT, ///< Aitoff projection 16 PS_PROJ_PAR, ///< Par projection 17 PS_PROJ_GLS, ///< GLS projection 18 PS_PROJ_NTYPE ///< Number of types; must be last 19 } psProjectionType; 10 20 11 21 /** A point in 2-D space, with errors. */ … … 15 25 double xErr; ///< Error in x position 16 26 double yErr; ///< Error in y position 17 } psPlane Coord;27 } psPlane; 18 28 19 29 /** A point on the surface of a sphere, with errors */ … … 23 33 double rErr; ///< Error in RA 24 34 double dErr; ///< Error in Dec 25 } psSphere Coord;35 } psSphere; 26 36 27 37 /** A polynomial transformation between coordinate frames. This may be a linear relationship, or may … … 31 41 psDPolynomial2D *x; 32 42 psDPolynomial2D *y; 33 } psPlane CoordXform;43 } psPlaneTransform; 34 44 35 45 /** The optical distortion terms. The lowest two terms are the x and y axis of the target system. The higher … … 39 49 psDPolynomial4D *x; 40 50 psDPolynomial4D *y; 41 } psPlaneDistortion; 51 } psPlaneDistort; 52 53 /** General spherical transformation */ 54 typedef struct { 55 double sinNPlon; ///< sin of North Pole longitude 56 double cosNPlon; ///< cos of North Pole longitude 57 double sinNPlat; ///< sin of North Pole lattitude 58 double cosNPlat; ///< cos of North Pole lattitude 59 double sinZP; ///< sin of First PT of Ares lon 60 double cosZP; ///< cos of First PT of Ares lon 61 } psSphereTransform; 62 63 /** Spherical <-> Linear projections */ 64 typedef struct { 65 double R, D; ///< coordinates of projection center 66 double Xs, Ys; ///< plate-scale in X and Y directions 67 psProjectionType type; ///< projection type 68 } psProjection; 42 69 43 70 /** Functions **************************************************************/ … … 47 74 48 75 /** apply the coordinate transformation to the given coordinate */ 49 psPlane Coord *psPlaneCoordXformApply (psPlaneCoord*out, ///< Output coordinates, or NULL50 const psPlaneCoordXform *frame, ///< coordinate transformation51 const psPlaneCoord *coords///< input coordiate52 );76 psPlane *psPlaneTransformApply (psPlane *out, ///< Output coordinates, or NULL 77 const psPlaneTransform *frame, ///< coordinate transformation 78 const psPlane *coords) ///< input coordiate 79 ; 53 80 54 81 /** apply the optical distortion to the given coordinate, magnitude, color */ 55 psPlaneCoord *psPlaneDistortionApply (psPlaneCoord *out, ///< Output coordinates, or NULL 56 const psPlaneDistortion *pattern, ///< optical distortion pattern 57 const psPlaneCoord *coords, ///< input coordinate 58 float mag, ///< magnitude of object 59 float color ///< color of object 60 ); 82 psPlane *psPlaneDistortApply (psPlane *out, ///< Output coordinates, or NULL 83 const psPlaneDistort *pattern, ///< optical distortion pattern 84 const psPlane *coords, ///< input coordinate 85 float mag, ///< magnitude of object 86 float color) ///< color of object 87 ; 88 89 /* Celestial coordinate conversions */ 90 91 /** Constructor */ 92 psSphereTransform * 93 psSphereTransformAlloc(double pole1, ///< First location of pole 94 double pole2, ///< Second location of pole 95 double rotation) ///< Rotation between systems 96 ; 97 98 /** Destructor */ 99 void psSphereTransformFree(psSphereTransform *trans) ///< Transform to destroy 100 ; 101 102 /** Apply general spherical transformation */ 103 psSphere * 104 psSphereTransformApply(const psSphere *coord, ///< Coordinates to convert 105 const psSphereTransform *sys) ///< System to use to convert 106 ; 107 108 /** Return transformation structure to convert ICRS to Ecliptic */ 109 psSphereTransform *psSphereTransformItoE(void); 110 111 /** Return transformation structure to convert Ecliptic to ICRS */ 112 psSphereTransform *psSphereTransformEtoI(void); 113 114 /** Return transformation structure to convert ICRS to Galactic */ 115 psSphereTransform *psSphereTransformItoG(void); 116 117 /** Return transformation structure to convert Galactic to ICRS */ 118 psSphereTransform *psSphereTransformGtoI(void); 119 120 /***********************************************************************************************************/ 121 122 123 /** Project spherical system onto a plane */ 124 psPlane * 125 psCoordProject(const psSphere *coord, ///< Spherical coordinates to project 126 const psProjection *projection) ///< Projection to use 127 ; 128 129 /** Deproject plane onto spherical system */ 130 psSphere * 131 psCoordDeproject(const psPlane *coord, ///< Plane coordinates to deproject 132 const psProjection *projection) ///< Projection to use 133 ; 61 134 62 135 /** Get offset (RA,Dec) on the sky between two positions position1 and position2 may not be identical */ 63 psSphereCoord * 64 psSphereCoordGetOffset(const psSphereCoord *restrict position1, ///< Position 1 65 const psSphereCoord *restrict position2, ///< Position 2 66 const char *type ///< Type of offset: Linear, Spherical/Arcsec, 67 ///< Spherical/Degreees etc 68 ); 136 psSphere * 137 psSphereGetOffset(const psSphere *restrict position1, ///< Position 1 138 const psSphere *restrict position2, ///< Position 2 139 const char *type) ///< Type of offset: Spherical/Arcsec, Spherical/Degreees etc 140 ; 69 141 70 142 /** Apply an offset to a position */ 71 psSphereCoord * 72 psSphereCoordApplyOffset(const psSphereCoord *restrict position, ///< Position 73 const psSphereCoord *restrict offset, ///< Offset 74 const char *type ///< Type of offset: Linear, Spherical/Arcsec, 75 ///< Spherical/Degreees etc 76 ); 143 psSphere * 144 psSphereApplyOffset(const psSphere *restrict position, ///< Position 145 const psSphere *restrict offset, ///< Offset 146 const char *type) ///< Type of offset: Spherical/Arcsec, Spherical/Degreees etc 147 ; 77 148 78 149 /* Positions of well-known objects */ 79 150 80 151 /** Get Sun Position */ 81 psSphereCoord * 82 psGetSunPos(float mjd ///< MJD to get position for 83 ); 84 85 /** Get Moon position */ 86 psSphereCoord * 87 psGetMoonPos(float mjd, ///< MJD to get position for 88 double latitude, ///< Latitude for apparent position 89 double longitude ///< Longitude for apparent position 90 ); 152 psSphere * 153 psSunGetPos(psTime time) ///< MJD to get position for 154 ; 155 156 /** Get Sun Rise time */ 157 psSphere * 158 psSunGetRise(psTime *twi15, ///< corresponding 15 deg twilight 159 psTime *twi18, ///< corresponding 18 deg twilight 160 psTime time) ///< get rise closest to this time 161 ; 162 163 /** Get Sun Set time */ 164 psSphere * 165 psSunGetSet(psTime *twi15, ///< corresponding 15 deg twilight 166 psTime *twi18, ///< corresponding 18 deg twilight 167 psTime time) ///< get set closest to this time 168 ; 169 170 /** Get Length of closest night */ 171 float 172 psNightLength(psTime time) ///< MJD to get position for 173 ; 174 175 /** Get Moon Position */ 176 psSphere * 177 psMoonGetPos(psTime time) ///< MJD to get position for 178 ; 179 180 /** Get Moon Rise time */ 181 psSphere * 182 psMoonGetRise(psTime time) ///< get rise closest to this time 183 ; 184 185 /** Get Moon Set time */ 186 psSphere * 187 psMoonGetSet(psTime time) ///< get set closest to this time 188 ; 91 189 92 190 /** Get Moon phase */ 93 191 float 94 ps GetMoonPhase(float mjd///< MJD to get phase for95 );192 psMoonGetPhase(psTime time) ///< MJD to get phase for 193 ; 96 194 97 195 /** Get Planet positions */ 98 psSphere Coord*99 ps GetSolarSystemPos(const char *solarSystemObject, ///< Named S.S. object100 float mjd///< MJD to get position for101 );196 psSphere * 197 psPlanetGetPos(const char *solarSystemObject, ///< Named S.S. object 198 psTime time) ///< MJD to get position for 199 ; 102 200 103 201 /***********************************************************************************************************/ 104 202 105 /* Celestial coordinate conversions */106 107 /** General spherical transformation */108 typedef struct {109 double sin1, sin2, sin3, cos1, cos2, cos3; ///< Sines and cosines for transformation110 } psSphereCoordTransformation;111 112 /** Constructor */113 psSphereCoordTransformation *114 psSphereCoordTransformationAlloc(double pole1, ///< First location of pole115 double pole2, ///< Second location of pole116 double rotation ///< Rotation between systems117 );118 119 /** Destructor */120 void psSphereCoordTranformationFree(psSphereCoordTransformation *trans ///< Transformation to destroy121 );122 123 /** Apply general spherical transformation */124 psSphereCoord *125 psSphereCoordTransform(const psSphereCoord *coord, ///< Coordinates to convert126 const psSphereCoordTransformation *sys ///< System to use to convert127 );128 129 /** Return transformation structure to convert ICRS to Ecliptic */130 psSphereCoordTransformation *psSphereCoordTransformationItoE(void);131 132 /** Return transformation structure to convert Ecliptic to ICRS */133 psSphereCoordTransformation *psSphereCoordTransformationEtoI(void);134 135 /** Return transformation structure to convert ICRS to Galactic */136 psSphereCoordTransformation *psSphereCoordTransformationItoG(void);137 138 /** Return transformation structure to convert Galactic to ICRS */139 psSphereCoordTransformation *psSphereCoordTransformationGtoI(void);140 141 /***********************************************************************************************************/142 143 144 /** Project spherical system onto a plane */145 psPlaneCoord *146 psCoordProject(const psSphereCoord *coord, ///< Spherical coordinates to project147 const char *projection ///< Projection to use148 );149 150 /** Deproject plane onto spherical system */151 psSphereCoord *152 psCoordDeproject(const psPlaneCoord *coord, ///< Plane coordinates to deproject153 const char *projection ///< Projection to use154 );155 156 203 /* \} */ // End of AstroGroup Functions 157 204
Note:
See TracChangeset
for help on using the changeset viewer.
