Changeset 1393 for trunk/psLib/src/astro
- Timestamp:
- Aug 5, 2004, 9:38:52 AM (22 years ago)
- Location:
- trunk/psLib/src/astro
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astro/psCoord.c
r1385 r1393 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-05 19:38:51 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 27 27 #include <float.h> 28 28 29 static float cot( float x ); 30 static float arg( float x, float y ); 31 29 32 // This is the only function in this file which I understand. 30 33 psPlane *psPlaneTransformApply( psPlane *out, … … 88 91 89 92 return ( tmp ); 90 }91 92 // I understand this one too.93 void p_psSphereTransformFree( psSphereTransform *trans )94 {95 psFree( trans );96 93 } 97 94 -
trunk/psLib/src/astro/psCoord.h
r1385 r1393 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-08-0 4 23:37:39$12 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-08-05 19:38:51 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 /// @{ 30 30 31 /** Euclidiean Coordinate System. 32 * 33 * Both detector and sky positions will be used extensively in the IPP. One 34 * coordinate system to be used is linear coordinates which conform to 35 * Euclidean geometry. 36 * 37 */ 31 38 typedef struct 32 39 { … … 38 45 psPlane; 39 46 47 /** Angular Coordinate System 48 * 49 * Both detector and sky positions will be used extensively in the IPP. One 50 * coordinate system to be used is angular coordinates for which additional 51 * care must often be taken in comparison to a euclidiean coordinate system. 52 * 53 */ 40 54 typedef struct 41 55 { … … 47 61 psSphere; 48 62 49 typedef struct 50 { 51 psDPolynomial2D *x; 52 psDPolynomial2D *y; 63 /** 2D Polynomial Transform 64 * 65 * A transform between coordinate systems that consists simply of two 2D 66 * polynomials to transform both components - the output coordinates depend 67 * only on the input coordinates and no other quantities of objects at those 68 * coordinates. 69 * 70 */ 71 typedef struct 72 { 73 psDPolynomial2D *x; ///< 2D polynomial transform of X coordinates 74 psDPolynomial2D *y; ///< 2D polynomial transform of Y coordinates 53 75 } 54 76 psPlaneTransform; 55 77 56 typedef struct 57 { 58 psDPolynomial4D *x; 59 psDPolynomial4D *y; 78 /** 4D Polynomial Transform 79 * 80 * A transform between coordinate systems that consists of two 4D polynomials 81 * in which the output coordinates are also specified to be a function of the 82 * magnitude and color of the object with the given coordinates. This type of 83 * coordinate transformation is necessary to represent the (color-dependent) 84 * optical distortions caused by the atmosphere and camera optics, and the 85 * possibly effects of charge transfer inefficiency. 86 * 87 * The lowest two terms are the x and y axis of the target system. The higher 88 * two terms may represent magnitude and color terms. 89 */ 90 typedef struct 91 { 92 psDPolynomial4D *x; ///< 4D polynomial transform of X coordinates 93 psDPolynomial4D *y; ///< 4D polynomial transform of Y coordinates 60 94 } 61 95 psPlaneDistort; 62 96 97 /** Spherical Transform Definition 98 * 99 * We need to be able to convert between ICRS, Galactic and Ecliptic 100 * coordinates, and potentially between arbitrary spherical coordinate 101 * systems. All of these basic spherical transformations represent rotations 102 * of the spherical coordinate reference. We specify a general 103 * transformation function which takes a structure, psSphereTransform, 104 * defining the transformation between two spherical coordinate systems 105 * 106 */ 63 107 typedef struct 64 108 { … … 70 114 psSphereTransform; 71 115 116 /** Projection type for projection/deprojection 117 * 118 * @seealso psProject, psDeproject 119 * 120 */ 72 121 typedef enum { 73 122 PS_PROJ_TAN, ///< Tangent projection … … 81 130 } psProjectionType; 82 131 132 /** Parameter set for projection/deprojection 133 * 134 * @seealso psProject, psDeproject 135 * 136 */ 83 137 typedef struct 84 138 { … … 91 145 psProjection; 92 146 147 /** Mode for Offset calculation between two sky positions 148 * 149 * @seealso psSphereGetOffset, psSphereSetOffset 150 * 151 */ 93 152 typedef enum { 94 PS_SPHERICAL, 95 PS_LINEAR 153 PS_SPHERICAL, ///< offset corresponds to an angular offset 154 PS_LINEAR ///< offset corresponds to a linear offset 96 155 } psSphereOffsetMode; 97 156 157 /** The units of the offset 158 * 159 * @seealso psSphereGetOffset, psSphereSetOffset 160 * 161 */ 98 162 typedef enum { 99 PS_ARCSEC, 100 PS_ARCMIN, 101 PS_DEGREE, 102 PS_RADIAN 163 PS_ARCSEC, ///< Arcseconds 164 PS_ARCMIN, ///< Arcminutes 165 PS_DEGREE, ///< Degrees 166 PS_RADIAN ///< Radians 103 167 } psSphereOffsetUnit; 104 168 105 psPlane *psPlaneTransformApply( psPlane *out, 106 const psPlaneTransform *transform, 107 const psPlane *coords ); 108 109 psPlane *psPlaneDistortApply( psPlane *out, 110 const psPlaneDistort *transform, 111 const psPlane *coords, 112 float term3, 113 float term4 ); 114 115 116 // New function prototype. 117 psSphereTransform *psSphereTransformAlloc( double NPlat, 118 double Xo, 119 double xo ); 120 121 void p_psSphereTransformFree( psSphereTransform *trans ); 122 123 psSphere *psSphereTransformApply( psSphere *out, 124 const psSphereTransform *transform, 125 const psSphere *coord ); 126 127 psSphereTransform *psSphereTransformICRStoEcliptic( psTime time ); 128 psSphereTransform *psSphereTransformEcliptictoICRS( psTime time ); 169 /** Applies the psPlaneTransform transform to a specified coordinate 170 * 171 */ 172 psPlane *psPlaneTransformApply( 173 psPlane *out, ///< a psPlane to recycle. If NULL, a new one is generated. 174 const psPlaneTransform *transform, ///< the transform to apply 175 const psPlane *coords ///< the coordinate to apply the transform above. 176 ); 177 178 /** Applies the psPlaneDistort transform to a specified coordinate 179 * 180 */ 181 psPlane *psPlaneDistortApply( 182 psPlane *out, ///< a psPlane to recycle. If NULL, a new one is generated. 183 const psPlaneDistort *transform, ///< the transform to apply 184 const psPlane *coords, ///< the coordinate to apply the transform above. 185 float term3, ///< third term -- maybe magnitude 186 float term4 ///< forth term -- maybe color 187 ); 188 189 /** Allocator for psSphereTransform 190 * 191 */ 192 psSphereTransform *psSphereTransformAlloc( 193 double NPlat, ///< north pole latitude 194 double Xo, ///< First PT of Ares lon 195 double xo ///< First PT of Ares equiv lon 196 ); 197 198 199 /** Applies the psSphereTransform transform for a specified coordinate 200 * 201 */ 202 psSphere *psSphereTransformApply( 203 psSphere *out, ///< a psSphere to recycle. If NULL, a new one is generated. 204 const psSphereTransform *transform,///< the transform to apply 205 const psSphere *coord ///< the coordinate to apply the transform above.x 206 ); 207 208 psSphereTransform *psSphereTransformICRStoEcliptic( 209 psTime time 210 ); 211 212 psSphereTransform *psSphereTransformEcliptictoICRS( 213 psTime time 214 ); 215 129 216 psSphereTransform *psSphereTransformICRStoGalatic( void ); 217 130 218 psSphereTransform *psSphereTransformGalatictoICRS( void ); 131 219 132 psPlane *psProject( const psSphere *coord, 133 const psProjection *projection ); 134 135 psSphere *psDeproject( const psPlane *coord, 136 const psProjection *projection ); 137 138 psSphere *psSphereGetOffset( const psSphere *restrict position1, 139 const psSphere *restrict position2, 140 psSphereOffsetMode mode, 141 psSphereOffsetUnit unit ); 142 143 psSphere *psSphereSetOffset( const psSphere *restrict position, 144 const psSphere *restrict offset, 145 psSphereOffsetMode mode, 146 psSphereOffsetUnit unit ); 220 psPlane *psProject( 221 const psSphere *coord, 222 const psProjection *projection 223 ); 224 225 psSphere *psDeproject( 226 const psPlane *coord, 227 const psProjection *projection 228 ); 229 230 psSphere *psSphereGetOffset( 231 const psSphere *restrict position1, 232 const psSphere *restrict position2, 233 psSphereOffsetMode mode, 234 psSphereOffsetUnit unit 235 ); 236 237 psSphere *psSphereSetOffset( 238 const psSphere *restrict position, 239 const psSphere *restrict offset, 240 psSphereOffsetMode mode, 241 psSphereOffsetUnit unit 242 ); 147 243 148 244 /// @} -
trunk/psLib/src/astro/psTime.c
r1385 r1393 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 4 23:37:39$14 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-05 19:38:51 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 34 34 /* DEFINE STATEMENTS */ 35 35 /******************************************************************************/ 36 37 /** Number of available leapsecond updates */ 38 #define NUM_LEAPSECOND_UPDATES 23 39 40 /** Maximum length of time string */ 41 #define MAX_TIME_STRING_LENGTH 256 42 43 /** Seconds per minute */ 44 #define SEC_PER_MINUTE 60.0 45 46 /** Seconds per hour */ 47 #define SEC_PER_HOUR (60.0*SEC_PER_MINUTE) 48 49 /** Seconds per day */ 50 #define SEC_PER_DAY (24.0*SEC_PER_HOUR) 51 52 /** Seconds per year */ 53 #define SEC_PER_YEAR (365.0*SEC_PER_DAY) 54 55 /** Microseconds per day */ 56 #define USEC_PER_DAY 86400000000.0 36 57 37 58 /** Preprocessor macro to generate error for negative time in struct */ -
trunk/psLib/src/astro/psTime.h
r1385 r1393 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-08-0 4 23:37:39$14 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-08-05 19:38:51 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 29 29 /// @addtogroup Time 30 30 /// @{ 31 32 /******************************************************************************/33 /* DEFINE STATEMENTS */34 /******************************************************************************/35 36 /** Number of available leapsecond updates */37 #define NUM_LEAPSECOND_UPDATES 2338 39 /** Maximum length of time string */40 #define MAX_TIME_STRING_LENGTH 25641 42 /** Seconds per minute */43 #define SEC_PER_MINUTE 60.044 45 /** Seconds per hour */46 #define SEC_PER_HOUR (60.0*SEC_PER_MINUTE)47 48 /** Seconds per day */49 #define SEC_PER_DAY (24.0*SEC_PER_HOUR)50 51 /** Seconds per year */52 #define SEC_PER_YEAR (365.0*SEC_PER_DAY)53 54 /** Microseconds per day */55 #define USEC_PER_DAY 86400000000.056 31 57 32 /******************************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.
