Changeset 2058 for trunk/psLib/src/astronomy
- Timestamp:
- Oct 12, 2004, 10:53:02 AM (22 years ago)
- Location:
- trunk/psLib/src/astronomy
- Files:
-
- 3 edited
-
psAstrometry.c (modified) (5 diffs)
-
psAstrometry.h (modified) (2 diffs)
-
psCoord.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psAstrometry.c
r2052 r2058 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-10-12 19:10:00$10 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-12 20:53:02 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include "psMemory.h" 25 25 #include "psAbort.h" 26 #include "psError.h" 27 #include "psConstants.h" 26 28 #include "slalib.h" 27 29 … … 199 201 { 200 202 if (fp != NULL) { 201 for (int i = 0; i < fp-> nX; i++) {203 for (int i = 0; i < fp->p_ps_xRows; i++) { 202 204 psFree(fp->x[i]); 203 205 } 204 206 205 for (int j = 0; j < fp-> nY; j++) {207 for (int j = 0; j < fp->p_ps_yRows; j++) { 206 208 psFree(fp->y[j]); 207 209 } … … 221 223 * XXX: Verify that you interpreted the SDR correctly. 222 224 * 225 * XXX: This assumes that x,y must be of type F64 223 226 */ 224 227 psFixedPattern* psFixedPatternAlloc(double x0, … … 233 236 int j; 234 237 238 PS_CHECK_NULL_IMAGE_RETURN_NULL(x); 239 PS_CHECK_NULL_IMAGE_RETURN_NULL(y); 240 PS_CHECK_IMAGE_TYPE_RETURN_NULL(x, PS_TYPE_F64); 241 PS_CHECK_IMAGE_TYPE_RETURN_NULL(y, PS_TYPE_F64); 242 235 243 tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern)); 236 tmp->nX = x->numCols; 237 tmp->nY = y->numRows; 244 // XXX: Is this correct? 245 tmp->nX = (x->numCols * x->numRows); 246 tmp->nY = (y->numCols * y->numRows); 238 247 tmp->x0 = x0; 239 248 tmp->y0 = y0; 240 249 tmp->xScale = xScale; 241 250 tmp->yScale = yScale; 242 tmp->x = (double **) psAlloc(x->numRows * sizeof(float *)); 251 tmp->p_ps_xRows = x->numRows; 252 tmp->p_ps_xCols = x->numCols; 253 tmp->p_ps_yRows = y->numRows; 254 tmp->p_ps_yCols = y->numCols; 255 tmp->x = (double **) psAlloc(x->numRows * sizeof(double *)); 243 256 for (i=0;i<x->numRows;i++) { 244 (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof( float));257 (tmp->x)[i] = (double *) psAlloc(x->numCols * sizeof(double)); 245 258 } 246 259 for (i=0;i<x->numRows;i++) { 247 for (j=0;j<x->num Rows;j++) {260 for (j=0;j<x->numCols;j++) { 248 261 (tmp->x)[i][j] = x->data.F64[i][j]; 249 262 } 250 263 } 251 264 252 tmp->y = (double **) psAlloc(y->numRows * sizeof( float*));265 tmp->y = (double **) psAlloc(y->numRows * sizeof(double *)); 253 266 for (i=0;i<y->numRows;i++) { 254 (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof( float));267 (tmp->y)[i] = (double *) psAlloc(y->numCols * sizeof(double)); 255 268 } 256 269 for (i=0;i<y->numRows;i++) { 257 for (j=0;j<y->num Rows;j++) {270 for (j=0;j<y->numCols;j++) { 258 271 (tmp->y)[i][j] = y->data.F64[i][j]; 259 272 } -
trunk/psLib/src/astronomy/psAstrometry.h
r2048 r2058 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-10-12 01:34:09$10 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-12 20:53:02 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 78 78 double xScale; ///< Scale of the grid in x direction 79 79 double yScale; ///< Scale of the grid in x direction 80 /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures. 81 int p_ps_xRows; ///< Number of rows in the x member 82 int p_ps_xCols; ///< Number of cols in the x member 83 int p_ps_yRows; ///< Number of rows in the y member 84 int p_ps_yCols; ///< Number of cols in the y member 80 85 double **x; ///< The grid of offsets in x 81 86 double **y; ///< The grid of offsets in y -
trunk/psLib/src/astronomy/psCoord.c
r1615 r2058 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 0$ $Name: not supported by cvs2svn $13 * @date $Date: 2004- 08-25 01:38:30$12 * @version $Revision: 1.21 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-12 20:53:02 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 32 32 /******************************************************************************/ 33 33 34 #define PS_COT(X) (1.0 / atan(X)) 35 36 /******************************************************************************/ 37 /* TYPE DEFINITIONS */ 38 /******************************************************************************/ 39 34 40 // None 35 41 36 /***************************************************************************** */37 /* TYPE DEFINITIONS*/38 /***************************************************************************** */42 /*****************************************************************************/ 43 /* GLOBAL VARIABLES */ 44 /*****************************************************************************/ 39 45 40 46 // None 41 47 42 48 /*****************************************************************************/ 43 /* GLOBAL VARIABLES*/49 /* FILE STATIC VARIABLES */ 44 50 /*****************************************************************************/ 45 51 … … 47 53 48 54 /*****************************************************************************/ 49 /* FILE STATIC VARIABLES */50 /*****************************************************************************/51 52 // None53 54 /*****************************************************************************/55 55 /* FUNCTION IMPLEMENTATION - LOCAL */ 56 56 /*****************************************************************************/ 57 57 58 static float p_psCot(float x);59 58 static float p_psArg(float x, float y); 60 59 61 60 /****************************************************************************** 62 XXX: Do this with a macro.63 *****************************************************************************/64 float p_psCot(float x)65 {66 return (1.0 / atan(x));67 }68 69 /******************************************************************************70 61 XXX: Verify this arc tan function. 71 *****************************************************************************/ 62 XXX: macro 63 *****************************************************************************/ 64 72 65 float p_psArg(float x, 73 66 float y) … … 240 233 241 234 if (projection->type == PS_PROJ_TAN) { 242 R = p_psCot(coord->r) * (180.0 / M_PI);235 R = PS_COT(coord->r) * (180.0 / M_PI); 243 236 tmp->x = R * sin(coord->d); 244 237 tmp->y = R * cos(coord->d);
Note:
See TracChangeset
for help on using the changeset viewer.
