Changeset 1981 for trunk/psLib/src/astronomy/psAstrometry.c
- Timestamp:
- Oct 6, 2004, 11:30:14 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/astronomy/psAstrometry.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psAstrometry.c
r1967 r1981 1 1 /** @file psAstrometry.c 2 * 3 * @brief This file defines the basic types for astronomical coordinate 4 * transformation 5 * 6 * @ingroup AstroImage 7 * 8 * @author George Gusciora, MHPCC 9 * 10 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-06 00:44:16 $ 12 * 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 14 */ 2 * 3 * @brief This file defines the basic types for astronomical coordinate 4 * transformation 5 * 6 * @ingroup AstroImage 7 * 8 * @author George Gusciora, MHPCC 9 * 10 * @version $Revision: 1.31 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-06 21:30:14 $ 12 * 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 14 */ 15 15 16 /******************************************************************************/ 16 17 /* INCLUDE FILES */ 17 18 /******************************************************************************/ 18 #include "slalib.h"19 20 #include<math.h> 19 #include <string.h> 20 #include <math.h> 21 21 22 #include "psFunctions.h" 22 23 #include "psAstrometry.h" 23 24 #include "psMemory.h" 24 25 #include "psAbort.h" 25 /******************************************************************************/ 26 /* DEFINE STATEMENTS */ 27 /******************************************************************************/ 28 29 // None 30 31 /******************************************************************************/ 32 /* TYPE DEFINITIONS */ 33 /******************************************************************************/ 34 35 // None 36 37 /*****************************************************************************/ 38 /* GLOBAL VARIABLES */ 39 /*****************************************************************************/ 40 41 // None 42 43 /*****************************************************************************/ 44 /* FILE STATIC VARIABLES */ 45 /*****************************************************************************/ 46 47 // None 48 49 /*****************************************************************************/ 50 /* FUNCTION IMPLEMENTATION - LOCAL */ 51 /*****************************************************************************/ 26 #include "slalib.h" 52 27 53 28 /***************************************************************************** … … 204 179 } 205 180 181 static void observatoryFree(psObservatory* obs) 182 { 183 if (obs != NULL) { 184 psFree((void*)obs->name); 185 } 186 } 187 188 static void fixedPatternFree(psFixedPattern* fp) 189 { 190 if (fp != NULL) { 191 for (int i = 0; i < fp->nX; i++) { 192 psFree(fp->x[i]); 193 } 194 195 for (int j = 0; j < fp->nY; j++) { 196 psFree(fp->y[j]); 197 } 198 199 psFree(fp->x); 200 psFree(fp->y); 201 } 202 } 203 206 204 /*****************************************************************************/ 207 205 /* FUNCTION IMPLEMENTATION - PUBLIC */ … … 213 211 * XXX: Verify that you interpreted the SDR correctly. 214 212 * 215 * XXX: Must add memory deallocater.216 213 */ 217 psFixedPattern *psFixedPatternAlloc(double x0,214 psFixedPattern* psFixedPatternAlloc(double x0, 218 215 double y0, 219 216 double xScale, … … 227 224 228 225 tmp = (psFixedPattern *) psAlloc(sizeof(psFixedPattern)); 229 tmp->nX = x->num Rows * x->numCols;230 tmp->nY = y->numRows * y->numCols;226 tmp->nX = x->numCols; 227 tmp->nY = y->numRows; 231 228 tmp->x0 = x0; 232 229 tmp->y0 = y0; … … 252 249 } 253 250 } 251 252 p_psMemSetDeallocator(tmp,(psFreeFcn)fixedPatternFree); 253 254 254 return(tmp); 255 255 } … … 279 279 } 280 280 281 /* 282 * psFPA constructor 283 */ 281 psObservatory* psObservatoryAlloc(const char* name, 282 double latitude, 283 double longitude, 284 double height, 285 double tlr) 286 { 287 psObservatory* obs = psAlloc(sizeof(obs)); 288 289 if (obs->name == NULL) { 290 obs->name = NULL; 291 } else { 292 obs->name = psAlloc(strlen(name)+1); 293 strcpy((char*)obs->name, name); 294 } 295 296 *(double *)&obs->latitude = latitude; 297 *(double *)&obs->longitude = longitude; 298 *(double *)&obs->height = height; 299 *(double *)&obs->tlr = tlr; 300 301 p_psMemSetDeallocator(obs,(psFreeFcn)observatoryFree); 302 303 return obs; 304 } 305 284 306 psFPA* psFPAAlloc(int nChips, 285 307 const psExposure* exp)
Note:
See TracChangeset
for help on using the changeset viewer.
