Changeset 1981
- Timestamp:
- Oct 6, 2004, 11:30:14 AM (22 years ago)
- Location:
- trunk/psLib/src/astronomy
- Files:
-
- 2 edited
-
psAstrometry.c (modified) (6 diffs)
-
psAstrometry.h (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) -
trunk/psLib/src/astronomy/psAstrometry.h
r1816 r1981 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1.2 5$ $Name: not supported by cvs2svn $11 * @date $Date: 2004- 09-15 22:57:12$10 * @version $Revision: 1.26 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-06 21:30:14 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 83 83 psFixedPattern; 84 84 85 psFixedPattern *psFixedPatternAlloc(double x0, ///< X Position of 0,0 corner on focal plane86 double y0, ///< Y Position of 0,0 corner on focal plane87 double xScale, ///< Scale of the grid in x direction88 double yScale, ///< Scale of the grid in x direction89 const psImage *x, ///< The grid of offsets in x90 const psImage *y ///< The grid of offsets in y91 );92 93 85 /** Readout data structure. 94 86 * … … 123 115 * 124 116 */ 125 typedef struct psCell117 typedef struct 126 118 { 127 119 psArray* readouts; ///< readouts from the cell … … 225 217 psExposure; 226 218 219 /** Observatory Information 220 * 221 * A container for the observatory data that doesn't change per exposure. 222 * 223 */ 224 typedef struct 225 { 226 const char* name; ///< Name of observatory 227 const double latitude; ///< Latitude of observatory, east positive 228 const double longitude; ///< Longitude of observatory 229 const double height; ///< Height of observatory 230 const double tlr; ///< Tropospheric Lapse Rate 231 } 232 psObservatory; 233 234 235 /** Allocator for psFixedPattern struct 236 * 237 * Allocates a new psFixedPattern struct with the attributes coorsponding 238 * to the parameters set to the said input values. 239 * 240 * @return psFixedPattern* New psFixedPattern struct. 241 */ 242 psFixedPattern* psFixedPatternAlloc( 243 double x0, ///< X Position of 0,0 corner on focal plane 244 double y0, ///< Y Position of 0,0 corner on focal plane 245 double xScale, ///< Scale of the grid in x direction 246 double yScale, ///< Scale of the grid in x direction 247 const psImage *x, ///< The grid of offsets in x 248 const psImage *y ///< The grid of offsets in y 249 ); 250 251 227 252 /** Allocator for psExposure 228 253 * … … 231 256 * quantities can be derived and stored for later use. 232 257 * 233 * @return psExposure* new psExposure struct258 * @return psExposure* New psExposure struct 234 259 */ 235 260 psExposure* psExposureAlloc( … … 248 273 ); 249 274 275 /** Allocator for psObservatory 276 * 277 * This function shall construct a new psObservatory with attributes 278 * cooresponding to the function parameters. 279 * 280 * @return psObservatory* new psObservatory struct 281 */ 282 psObservatory* psObservatoryAlloc( 283 const char* name, ///< Name of observatory 284 double latitude, ///< Latitude of observatory, east positive 285 double longitude, ///< Longitude of observatory 286 double height, ///< Height of observatory 287 double tlr ///< Tropospheric Lapse Rate 288 ); 289 250 290 /** Allocator for psFPA 251 291 *
Note:
See TracChangeset
for help on using the changeset viewer.
