Changeset 2204 for trunk/psLib/src/astronomy
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- Location:
- trunk/psLib/src/astronomy
- Files:
-
- 11 edited
-
psAstrometry.c (modified) (18 diffs)
-
psAstrometry.h (modified) (8 diffs)
-
psCoord.c (modified) (3 diffs)
-
psCoord.h (modified) (3 diffs)
-
psMetadata.c (modified) (11 diffs)
-
psMetadata.h (modified) (10 diffs)
-
psMetadataIO.c (modified) (12 diffs)
-
psMetadataIO.h (modified) (3 diffs)
-
psPhotometry.h (modified) (2 diffs)
-
psTime.c (modified) (24 diffs)
-
psTime.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psAstrometry.c
r2137 r2204 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1.4 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-10- 14 23:45:53$10 * @version $Revision: 1.43 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-27 00:57:30 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 33 33 psImage. 34 34 *****************************************************************************/ 35 static intcheckValidImageCoords(double x,36 double y,37 psImage* tmpImage)35 static psS32 checkValidImageCoords(double x, 36 double y, 37 psImage* tmpImage) 38 38 { 39 39 if (tmpImage == NULL) { … … 56 56 cooefficients of order 2 are higher are non-zero, then it is not linear. 57 57 *****************************************************************************/ 58 static intisProjectionLinear(psPlaneTransform *transform)59 { 60 inti = 0;58 static psS32 isProjectionLinear(psPlaneTransform *transform) 59 { 60 psS32 i = 0; 61 61 PS_CHECK_NULL_PTR_RETURN_ZERO(transform); 62 62 … … 178 178 { 179 179 if (obs != NULL) { 180 psFree(( void*)obs->name);180 psFree((psPtr)obs->name); 181 181 } 182 182 } … … 185 185 { 186 186 if (exp != NULL) { 187 psFree(( void*)exp->time);188 psFree(( void*)exp->observatory);189 psFree(( void*)exp->cameraName);190 psFree(( void*)exp->telescopeName);187 psFree((psPtr)exp->time); 188 psFree((psPtr)exp->observatory); 189 psFree((psPtr)exp->cameraName); 190 psFree((psPtr)exp->telescopeName); 191 191 } 192 192 } … … 195 195 { 196 196 if (fp != NULL) { 197 for ( inti = 0; i < fp->p_ps_xRows; i++) {197 for (psS32 i = 0; i < fp->p_ps_xRows; i++) { 198 198 psFree(fp->x[i]); 199 199 } 200 200 201 for ( intj = 0; j < fp->p_ps_yRows; j++) {201 for (psS32 j = 0; j < fp->p_ps_yRows; j++) { 202 202 psFree(fp->y[j]); 203 203 } … … 226 226 { 227 227 psFixedPattern *tmp; 228 inti;229 intj;228 psS32 i; 229 psS32 j; 230 230 231 231 PS_CHECK_NULL_IMAGE_RETURN_NULL(x); … … 301 301 *(float *)&exp->wavelength = wavelength; 302 302 303 exp->time = psMemIncrRefCounter(( void*)time);304 exp->observatory = psMemIncrRefCounter(( void*)observatory);303 exp->time = psMemIncrRefCounter((psPtr)time); 304 exp->observatory = psMemIncrRefCounter((psPtr)observatory); 305 305 306 306 // XXX: how is these value derived? … … 343 343 } 344 344 345 psFPA* psFPAAlloc( intnChips,345 psFPA* psFPAAlloc(psS32 nChips, 346 346 const psExposure* exp) 347 347 { … … 350 350 // create array of NULL chips of the size nChips 351 351 newFPA->chips = psArrayAlloc(nChips); 352 void** chips = newFPA->chips->data;353 for ( inti=0;i<nChips;i++) {352 psPtr* chips = newFPA->chips->data; 353 for (psS32 i=0;i<nChips;i++) { 354 354 chips[i] = NULL; 355 355 } … … 384 384 * psChip constructor 385 385 */ 386 psChip* psChipAlloc( intnCells,386 psChip* psChipAlloc(psS32 nCells, 387 387 psFPA *parentFPA) 388 388 { … … 391 391 // create array of NULL psCells 392 392 chip->cells = psArrayAlloc(nCells); 393 void** cells = chip->cells->data;394 for ( inti=0;i<nCells;i++) {393 psPtr* cells = chip->cells->data; 394 for (psS32 i=0;i<nCells;i++) { 395 395 cells[i] = NULL; 396 396 } … … 412 412 * psCell constructor 413 413 */ 414 psCell* psCellAlloc( intnReadouts,414 psCell* psCellAlloc(psS32 nReadouts, 415 415 psChip* parentChip) 416 416 { … … 419 419 // create array of NULL psReadouts 420 420 cell->readouts = psArrayAlloc(nReadouts); 421 void** readouts = cell->readouts->data;422 for ( inti=0;i<nReadouts;i++) {421 psPtr* readouts = cell->readouts->data; 422 for (psS32 i=0;i<nReadouts;i++) { 423 423 readouts[i] = NULL; 424 424 } … … 440 440 } 441 441 442 psReadout* psReadoutAlloc( intcol0,443 introw0,442 psReadout* psReadoutAlloc(psS32 col0, 443 psS32 row0, 444 444 const psImage* image) 445 445 { 446 446 psReadout* readout = psAlloc(sizeof(psReadout)); 447 447 448 *( unsigned int*)&readout->colBins = 1;449 *( unsigned int*)&readout->rowBins = 1;450 *( int*)&readout->col0 = col0;451 *( int*)&readout->row0 = row0;448 *(psU32*)&readout->colBins = 1; 449 *(psU32*)&readout->rowBins = 1; 450 *(psS32*)&readout->col0 = col0; 451 *(psS32*)&readout->row0 = row0; 452 452 453 453 readout->image = (psImage*)image; … … 521 521 PS_CHECK_NULL_PTR_RETURN_NULL(FPA->chips); 522 522 psArray* chips = FPA->chips; 523 intnChips = chips->n;523 psS32 nChips = chips->n; 524 524 psPlane chipCoord; 525 525 psCell *tmpCell = NULL; … … 529 529 // cells in that chip contain those chip coordinates. 530 530 531 for ( inti = 0; i < nChips; i++) {531 for (psS32 i = 0; i < nChips; i++) { 532 532 psChip* tmpChip = chips->data[i]; 533 533 psPlaneTransformApply(&chipCoord, tmpChip->fromFPA, fpaCoord); … … 560 560 // If so, then we return that cell. 561 561 562 for ( inti = 0; i < cells->n; i++) {562 for (psS32 i = 0; i < cells->n; i++) { 563 563 psCell* tmpCell = (psCell* ) cells->data[i]; 564 564 psArray* readouts = tmpCell->readouts; 565 565 566 566 if (readouts != NULL) { 567 for ( intj = 0; j < readouts->n; j++) {567 for (psS32 j = 0; j < readouts->n; j++) { 568 568 psReadout* tmpReadout = readouts->data[j]; 569 569 -
trunk/psLib/src/astronomy/psAstrometry.h
r2058 r2204 8 8 * @author George Gusciora, MHPCC 9 9 * 10 * @version $Revision: 1. 29$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-10- 12 20:53:02$10 * @version $Revision: 1.30 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-10-27 00:57:30 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 72 72 typedef struct 73 73 { 74 intnX; ///< Number of elements in x direction75 intnY; ///< Number of elements in y direction74 psS32 nX; ///< Number of elements in x direction 75 psS32 nY; ///< Number of elements in y direction 76 76 double x0; ///< X Position of 0,0 corner on focal plane 77 77 double y0; ///< Y Position of 0,0 corner on focal plane … … 79 79 double yScale; ///< Scale of the grid in x direction 80 80 /// XXX: I added the following memvers to facilitate the psFreeing of the x,y data structures. 81 intp_ps_xRows; ///< Number of rows in the x member82 intp_ps_xCols; ///< Number of cols in the x member83 intp_ps_yRows; ///< Number of rows in the y member84 intp_ps_yCols; ///< Number of cols in the y member81 psS32 p_ps_xRows; ///< Number of rows in the x member 82 psS32 p_ps_xCols; ///< Number of cols in the x member 83 psS32 p_ps_yRows; ///< Number of rows in the y member 84 psS32 p_ps_yCols; ///< Number of cols in the y member 85 85 double **x; ///< The grid of offsets in x 86 86 double **y; ///< The grid of offsets in y … … 99 99 typedef struct 100 100 { 101 const unsigned intcolBins; ///< Amount of binning in x-dimension102 const unsigned introwBins; ///< Amount of binning in y-dimension103 const intcol0; ///< Offset from the left of chip.104 const introw0; ///< Offset from the bottom of chip.101 const psU32 colBins; ///< Amount of binning in x-dimension 102 const psU32 rowBins; ///< Amount of binning in y-dimension 103 const psS32 col0; ///< Offset from the left of chip. 104 const psS32 row0; ///< Offset from the bottom of chip. 105 105 106 106 psImage* image; ///< Imaging area of readout … … 304 304 */ 305 305 psFPA* psFPAAlloc( 306 intnChips, ///< number of chips in the FPA306 psS32 nChips, ///< number of chips in the FPA 307 307 const psExposure* exp ///< the exposure information 308 308 ); … … 317 317 */ 318 318 psChip* psChipAlloc( 319 intnCells, ///< number of cells in Chip319 psS32 nCells, ///< number of cells in Chip 320 320 psFPA* parentFPA ///< parent FPA 321 321 ); … … 330 330 */ 331 331 psCell* psCellAlloc( 332 intnReadouts, ///< number of readouts in cell332 psS32 nReadouts, ///< number of readouts in cell 333 333 psChip* parentChip ///< parent Chip 334 334 ); … … 342 342 */ 343 343 psReadout* psReadoutAlloc( 344 intcol0, ///< offset from the left of the cell345 introw0, ///< offset from the bottom of the cell344 psS32 col0, ///< offset from the left of the cell 345 psS32 row0, ///< offset from the bottom of the cell 346 346 const psImage* image ///< image of the readout 347 347 ); -
trunk/psLib/src/astronomy/psCoord.c
r2200 r2204 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.2 8$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-2 6 22:32:09$12 * @version $Revision: 1.29 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:30 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 67 67 } 68 68 69 psPlaneTransform* psPlaneTransformAlloc( int n1, intn2)69 psPlaneTransform* psPlaneTransformAlloc(psS32 n1, psS32 n2) 70 70 { 71 71 psPlaneTransform *pt = psAlloc(sizeof(psPlaneTransform)); … … 97 97 } 98 98 99 psPlaneDistort* psPlaneDistortAlloc( int n1, int n2, int n3, intn4)99 psPlaneDistort* psPlaneDistortAlloc(psS32 n1, psS32 n2, psS32 n3, psS32 n4) 100 100 { 101 101 psPlaneDistort *pt = psAlloc(sizeof(psPlaneDistort)); -
trunk/psLib/src/astronomy/psCoord.h
r2200 r2204 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1.1 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004-10-2 6 22:32:09$12 * @version $Revision: 1.18 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:30 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 173 173 174 174 psPlaneTransform* psPlaneTransformAlloc( 175 intn1, ///< The order of the x term in the transform.176 intn2 ///< The order of the y term in the transform.175 psS32 n1, ///< The order of the x term in the transform. 176 psS32 n2 ///< The order of the y term in the transform. 177 177 ); 178 178 … … 193 193 194 194 psPlaneDistort* psPlaneDistortAlloc( 195 intn1, ///< The order of the w term in the transform.196 intn2, ///< The order of the x term in the transform.197 intn3, ///< The order of the y term in the transform.198 intn4 ///< The order of the z term in the transform.195 psS32 n1, ///< The order of the w term in the transform. 196 psS32 n2, ///< The order of the x term in the transform. 197 psS32 n3, ///< The order of the y term in the transform. 198 psS32 n4 ///< The order of the z term in the transform. 199 199 ); 200 200 -
trunk/psLib/src/astronomy/psMetadata.c
r2040 r2204 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.3 4$ $Name: not supported by cvs2svn $15 * @date $Date: 2004-10- 09 03:05:53$14 * @version $Revision: 1.35 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2004-10-27 00:57:30 $ 16 16 * 17 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 59 59 /*****************************************************************************/ 60 60 61 static intmetadataId = 0;61 static psS32 metadataId = 0; 62 62 63 63 /*****************************************************************************/ … … 143 143 144 144 // Set metadata item unique id 145 *( int*)(&metadataItem->id) = ++metadataId;145 *(psS32 *)(&metadataItem->id) = ++metadataId; 146 146 147 147 // Set metadata item type … … 154 154 break; 155 155 case PS_META_BOOL: 156 metadataItem->data.B = ( bool)va_arg(argPtr, int);156 metadataItem->data.B = (psBool)va_arg(argPtr, psS32); 157 157 break; 158 158 case PS_META_S32: … … 215 215 } 216 216 217 bool psMetadataAddItem( psMetadata *restrict md, psMetadataItem *restrict metadataItem, intlocation )217 psBool psMetadataAddItem( psMetadata *restrict md, psMetadataItem *restrict metadataItem, psS32 location ) 218 218 { 219 219 char * key = NULL; … … 337 337 } 338 338 339 bool psMetadataAdd(psMetadata* restrict md, intwhere, const char *name, psMetadataType type,340 const char *comment, ...)339 psBool psMetadataAdd(psMetadata* restrict md, psS32 where, const char *name, psMetadataType type, 340 const char *comment, ...) 341 341 { 342 342 va_list argPtr; … … 359 359 } 360 360 361 bool psMetadataRemove(psMetadata* restrict md, intwhere, const char *restrict key)362 { 363 intnumChildren = 0;361 psBool psMetadataRemove(psMetadata* restrict md, psS32 where, const char *restrict key) 362 { 363 psS32 numChildren = 0; 364 364 psList* mdList = NULL; 365 365 psHash* mdTable = NULL; … … 471 471 } 472 472 473 psMetadataItem* psMetadataGet(psMetadata* restrict md, intwhere)473 psMetadataItem* psMetadataGet(psMetadata* restrict md, psS32 where) 474 474 { 475 475 psList* mdList = NULL; … … 497 497 } 498 498 499 bool psMetadataSetIterator(psMetadata* restrict md, intwhere)499 psBool psMetadataSetIterator(psMetadata* restrict md, psS32 where) 500 500 { 501 501 psList* mdList = NULL; … … 517 517 } 518 518 519 psMetadataItem* psMetadataGetNext(psMetadata* restrict md, const char *restrict match, intwhich)519 psMetadataItem* psMetadataGetNext(psMetadata* restrict md, const char *restrict match, psS32 which) 520 520 { 521 521 psList* mdList = NULL; … … 553 553 } 554 554 555 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, intwhich)555 psMetadataItem* psMetadataGetPrevious(psMetadata* restrict md, const char *restrict match, psS32 which) 556 556 { 557 557 psList* mdList = NULL; -
trunk/psLib/src/astronomy/psMetadata.h
r1970 r2204 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-10- 06 01:06:27$13 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-10-27 00:57:30 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 38 38 PS_META_F32, ///< Single-precision float data. 39 39 PS_META_F64, ///< Double-precision float data. 40 PS_META_STR, ///< String data (Stored in as void *).41 PS_META_VEC, ///< Vector data (Stored in as void *).42 PS_META_IMG, ///< Image data (Stored in as void *).43 PS_META_JPEG, ///< JPEG data (Stored in as void *).44 PS_META_PNG, ///< PNG data (Stored in as void *).45 PS_META_ASTROM, ///< Astrometric coefficients (Stored in as void *).46 PS_META_UNKNOWN, ///< Other data (Stored in as void *).40 PS_META_STR, ///< String data (Stored in as psPtr ). 41 PS_META_VEC, ///< Vector data (Stored in as psPtr ). 42 PS_META_IMG, ///< Image data (Stored in as psPtr ). 43 PS_META_JPEG, ///< JPEG data (Stored in as psPtr ). 44 PS_META_PNG, ///< PNG data (Stored in as psPtr ). 45 PS_META_ASTROM, ///< Astrometric coefficients (Stored in as psPtr ). 46 PS_META_UNKNOWN, ///< Other data (Stored in as psPtr ). 47 47 PS_META_NTYPE ///< Number of types. Must be last. 48 48 } psMetadataType; … … 55 55 typedef struct psMetadataItem 56 56 { 57 const intid; ///< Unique ID for metadata item.57 const psS32 id; ///< Unique ID for metadata item. 58 58 char *restrict name; ///< Name of metadata item. 59 59 psMetadataType type; ///< Type of metadata item. 60 60 union { 61 bool B; ///< boolean data61 psBool B; ///< boolean data 62 62 psS32 S32; ///< Signed 32-bit integer data. 63 63 psF32 F32; ///< Single-precision float data. 64 64 psF64 F64; ///< Double-precision float data. 65 psP TRV; ///< Pointer to other type of data.65 psPtr V; ///< Pointer to other type of data. 66 66 } data; ///< Union for data types. 67 67 char *comment; ///< Optional comment ("", not NULL). … … 144 144 * @return bool: True for success, false for failure. 145 145 */ 146 bool psMetadataAddItem(146 psBool psMetadataAddItem( 147 147 psMetadata* restrict md, ///< Metadata collection to insert metadat item. 148 148 psMetadataItem* restrict item, ///< Metadata item to be added. 149 intlocation ///< Location to be added.149 psS32 location ///< Location to be added. 150 150 ); 151 151 … … 156 156 * @return bool: True for success, false for failure. 157 157 */ 158 bool psMetadataAdd(159 psMetadata* restrict md, ///< Metadata collection to insert metadat item. 160 intwhere, ///< Location to be added.158 psBool psMetadataAdd( 159 psMetadata* restrict md, ///< Metadata collection to insert metadat item. 160 psS32 where, ///< Location to be added. 161 161 const char *name, ///< Name of metadata item. 162 162 psMetadataType type, ///< Type of metadata item. … … 175 175 * @return bool: True for success, false for failure. 176 176 */ 177 bool psMetadataRemove(178 psMetadata* restrict md, ///< Metadata collection to insert metadat item. 179 intwhere, ///< Location to be removed.177 psBool psMetadataRemove( 178 psMetadata* restrict md, ///< Metadata collection to insert metadat item. 179 psS32 where, ///< Location to be removed. 180 180 const char *restrict key ///< Name of metadata key. 181 181 ); … … 203 203 psMetadataItem* psMetadataGet( 204 204 psMetadata* restrict md, ///< Metadata collection to insert metadat item. 205 intwhere ///< Location to be retrieved.205 psS32 where ///< Location to be retrieved. 206 206 ); 207 207 … … 213 213 * @return void: void. 214 214 */ 215 bool psMetadataSetIterator(215 psBool psMetadataSetIterator( 216 216 psMetadata* restrict md, ///< Metadata collection to iterate. 217 intwhere ///< Location of iterator.217 psS32 where ///< Location of iterator. 218 218 ); 219 219 … … 227 227 psMetadata* restrict md, ///< Metadata collection to iterate. 228 228 const char *restrict match, ///< Beginning of key name. 229 intwhich ///< Iterator to be used.229 psS32 which ///< Iterator to be used. 230 230 ); 231 231 … … 239 239 psMetadata* restrict md, ///< Metadata collection to iterate. 240 240 const char *restrict match, ///< Beginning of key name. 241 intwhich ///< Iterator to be used.241 psS32 which ///< Iterator to be used. 242 242 ); 243 243 -
trunk/psLib/src/astronomy/psMetadataIO.c
r2014 r2204 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10- 08 00:43:12$11 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 00:57:30 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 104 104 /** Determines if a line is blank (whitespace only) or a commentline. It returns true if so. The input string 105 105 * must be null terminated. */ 106 bool ignoreLine(char *inString)106 psBool ignoreLine(char *inString) 107 107 { 108 108 while(*inString!='\0' && *inString!='#') { … … 119 119 /** Removes leading and trailing whitespace and # characters from a string. The cleaned string is a new null 120 120 * terminated copy of the original input string. */ 121 char *cleanString(char *inString, intsLen)121 char *cleanString(char *inString, psS32 sLen) 122 122 { 123 123 char *ptrB = NULL; … … 149 149 150 150 /** Count repeat occurances of a single character within a line. The input string must be null terminated. */ 151 intrepeatedChars(char *inString, char ch)152 { 153 intcount = 0;151 psS32 repeatedChars(char *inString, char ch) 152 { 153 psS32 count = 0; 154 154 155 155 … … 166 166 /** Returns cleaned token based on delimiter, but not including delimiter. Also changes the pointer location 167 167 * the beginning of the string. Tokens are newly allocated null terminated strings. */ 168 char* getToken(char **inString, char *delimiter, int*status)168 char* getToken(char **inString, char *delimiter, psS32 *status) 169 169 { 170 170 char *cleanToken = NULL; 171 intsLen = 0;171 psS32 sLen = 0; 172 172 173 173 … … 195 195 /** Returns single parsed value as a double precision number. The input string must be cleaned and null 196 196 * terminated. */ 197 double parseValue(char *inString, int*status)197 double parseValue(char *inString, psS32 *status) 198 198 { 199 199 char *end = NULL; … … 212 212 213 213 /** Returns true or false. 'T', 't', '1', 'F', 'f', and '0' are acceptable, parsable variations. */ 214 bool parseBool(char *inString, int*status)215 { 216 bool value = false;214 psBool parseBool(char *inString, psS32 *status) 215 { 216 psBool value = false; 217 217 218 218 … … 229 229 230 230 /** Returns parsed vector filled with with data. The input string must be null terminated. */ 231 psVector* parseVector(char *inString, psElemType elemType, int*status)231 psVector* parseVector(char *inString, psElemType elemType, psS32 *status) 232 232 { 233 233 char *end = NULL; 234 234 char *saveValue = NULL; 235 inti = 0;236 intnumValues = 0;235 psS32 i = 0; 236 psS32 numValues = 0; 237 237 double value = 0.0; 238 238 psVector *vec = NULL; … … 341 341 342 342 343 psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, intextNum, char *fileName)344 { 345 bool tempBool;346 bool success;343 psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, psS32 extNum, char *fileName) 344 { 345 psBool tempBool; 346 psBool success; 347 347 char keyType; 348 348 char keyName[FITS_LINE_SIZE]; … … 350 350 char keyComment[FITS_LINE_SIZE]; 351 351 char fitsErr[MAX_STRING_LENGTH]; 352 inti;353 inthduType = 0;354 intstatus = 0;355 intnumKeys = 0;356 intkeyNum = 0;352 psS32 i; 353 psS32 hduType = 0; 354 psS32 status = 0; 355 psS32 numKeys = 0; 356 psS32 keyNum = 0; 357 357 psMetadataType metadataItemType; 358 358 fitsfile *fd = NULL; … … 449 449 450 450 451 int psMetadataParseConfig(psMetadata** md, char *fileName, bool overwrite)452 { 453 bool tempBool;451 psS32 psMetadataParseConfig(psMetadata** md, char *fileName, psBool overwrite) 452 { 453 psBool tempBool; 454 454 char *line = NULL; 455 455 char *strName = NULL; … … 458 458 char *strComment = NULL; 459 459 char *linePtr = NULL; 460 intstatus = 0;461 intlineCount = 0;462 intfailedLines = 0;460 psS32 status = 0; 461 psS32 lineCount = 0; 462 psS32 failedLines = 0; 463 463 psF64 tempDbl = 0.0; 464 464 psS32 tempInt = 0.0; -
trunk/psLib/src/astronomy/psMetadataIO.h
r1973 r2204 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1. 1$ $Name: not supported by cvs2svn $12 * @date $Date: 2004-10- 06 01:17:39$11 * @version $Revision: 1.2 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2004-10-27 00:57:30 $ 13 13 * 14 14 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 50 50 psMetadata* output, ///< Resulting metadata from read. 51 51 char *extName, ///< File name extension string. 52 intextNum, ///< File name extension number. Starts at 1.52 psS32 extNum, ///< File name extension number. Starts at 1. 53 53 char *fileName ///< Name of file to read. 54 54 ); … … 58 58 * Loads pre-defined settings by parsing a configuration file into a psMetadata structure. 59 59 * 60 * @return int: Number of lines that failed to be read.60 * @return psS32 : Number of lines that failed to be read. 61 61 */ 62 intpsMetadataParseConfig(62 psS32 psMetadataParseConfig( 63 63 psMetadata** md, ///< Resulting metadata from read. 64 64 char *fileName, ///< Name of file to read. 65 bool overwrite ///< Allow overwrite of duplicate specifications.65 psBool overwrite ///< Allow overwrite of duplicate specifications. 66 66 ); 67 67 -
trunk/psLib/src/astronomy/psPhotometry.h
r1441 r2204 10 10 * @author George Gusciora, MHPCC 11 11 * 12 * @version $Revision: 1. 7$ $Name: not supported by cvs2svn $13 * @date $Date: 2004- 08-09 23:40:54$12 * @version $Revision: 1.8 $ $Name: not supported by cvs2svn $ 13 * @date $Date: 2004-10-27 00:57:30 $ 14 14 * 15 15 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 43 43 typedef struct 44 44 { 45 const intID; ///< ID number for this photometric system45 const psS32 ID; ///< ID number for this photometric system 46 46 const char *name; ///< Name of photometric system 47 47 const char *camera; ///< Camera for photometric system -
trunk/psLib/src/astronomy/psTime.c
r2196 r2204 11 11 * @author Ross Harman, MHPCC 12 12 * 13 * @version $Revision: 1.3 7$ $Name: not supported by cvs2svn $14 * @date $Date: 2004-10-2 6 00:37:44$13 * @version $Revision: 1.38 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-10-27 00:57:30 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 144 144 static double lookupSer7Table( 145 145 const psTime *time, ///< time to lookup. 146 intcol ///< Column to lookup.146 psS32 col ///< Column to lookup. 147 147 ); 148 148 … … 150 150 { 151 151 char line[LINESIZE]; 152 intj = 0;153 intmaxLines = 100;152 psS32 j = 0; 153 psS32 maxLines = 100; 154 154 psF64 *ptr = NULL; 155 155 psImage *table = NULL; … … 180 180 } 181 181 182 *( unsigned int*)&table->numRows = j;182 *(psU32 *)&table->numRows = j; 183 183 184 184 p_psMemSetPersistent(table,true); … … 191 191 static psImage* readSer7File(const char *fileName) 192 192 { 193 bool beginRecord = false;193 psBool beginRecord = false; 194 194 char line[LINESIZE]; 195 intj = 0;196 intmaxLines = 400;195 psS32 j = 0; 196 psS32 maxLines = 400; 197 197 psImage *table = NULL; 198 198 FILE *fd = NULL; … … 231 231 } 232 232 } 233 *( unsigned int*)&table->numRows = j;233 *(psU32 *)&table->numRows = j; 234 234 235 235 p_psMemSetPersistent(table,true); … … 244 244 { 245 245 char line[LINESIZE]; 246 inti = 0;247 intj = 0;248 intmaxLines = 2500;246 psS32 i = 0; 247 psS32 j = 0; 248 psS32 maxLines = 2500; 249 249 psImage *table = NULL; 250 250 FILE *fd = NULL; … … 276 276 } 277 277 278 *( unsigned int*)&table->numRows = j;278 *(psU32 *)&table->numRows = j; 279 279 280 280 return table; … … 284 284 { 285 285 char line[LINESIZE]; 286 intj = 0;287 intmaxLines = 15000;286 psS32 j = 0; 287 psS32 maxLines = 15000; 288 288 psImage *table = NULL; 289 289 FILE *fd = NULL; … … 346 346 } 347 347 348 *( unsigned int*)&table->numRows = j;348 *(psU32 *)&table->numRows = j; 349 349 350 350 return table; … … 354 354 static double lookupTaiUtcTable(const psTime *time) 355 355 { 356 inthiIdx = 0;357 intloIdx = 0;358 intnumRows = 0;356 psS32 hiIdx = 0; 357 psS32 loIdx = 0; 358 psS32 numRows = 0; 359 359 double jd = 0.0; 360 360 double mjd = 0.0; … … 422 422 } 423 423 424 static double lookupSer7Table(const psTime *time, intcol)425 { 426 inthiIdx = 0;427 intloIdx = 0;428 intnumRows = 0;424 static double lookupSer7Table(const psTime *time, psS32 col) 425 { 426 psS32 hiIdx = 0; 427 psS32 loIdx = 0; 428 psS32 numRows = 0; 429 429 double out = 0.0; 430 430 double denom = 0.0; … … 752 752 } 753 753 754 longpsTimeLeapseconds(const psTime *time1, const psTime *time2)755 { 756 longdiff = 0;754 psS64 psTimeLeapseconds(const psTime *time1, const psTime *time2) 755 { 756 psS64 diff = 0; 757 757 758 758 … … 827 827 char* psTimeToISOTime(const psTime *time) 828 828 { 829 intms = 0;829 psS32 ms = 0; 830 830 char *timeString = NULL; 831 831 char *tempString = NULL; … … 889 889 struct tm* psTimeToTM(const psTime *time) 890 890 { 891 longcent = 0;892 longyear = 0;893 longmonth = 0;894 longday = 0;895 longhour = 0;896 longminute = 0;897 longseconds = 0;898 longtemp = 0;891 psS64 cent = 0; 892 psS64 year = 0; 893 psS64 month = 0; 894 psS64 day = 0; 895 psS64 hour = 0; 896 psS64 minute = 0; 897 psS64 seconds = 0; 898 psS64 temp = 0; 899 899 struct tm* tmTime = NULL; 900 900 … … 975 975 seconds = days * SEC_PER_DAY; 976 976 if(seconds < 0.0) { 977 outTime->usec = (seconds - ( long)seconds) * -1000000.0; // psTime earlier than epoch977 outTime->usec = (seconds - (psS64)seconds) * -1000000.0; // psTime earlier than epoch 978 978 } else { 979 outTime->usec = (seconds - ( long)seconds) * 1000000.0; // psTime greater than epoch979 outTime->usec = (seconds - (psS64)seconds) * 1000000.0; // psTime greater than epoch 980 980 } 981 981 outTime->sec = seconds; … … 1003 1003 seconds = days * SEC_PER_DAY; 1004 1004 if(seconds < 0.0) { 1005 outTime->usec = (seconds - ( long)seconds) * -1000000.0; // psTime earlier than epoch1005 outTime->usec = (seconds - (psS64)seconds) * -1000000.0; // psTime earlier than epoch 1006 1006 } else { 1007 outTime->usec = (seconds - ( long)seconds) * 1000000.0; // psTime greater than epoch1007 outTime->usec = (seconds - (psS64)seconds) * 1000000.0; // psTime greater than epoch 1008 1008 } 1009 1009 outTime->sec = seconds; … … 1020 1020 { 1021 1021 char tempString[MAX_TIME_STRING_LENGTH]; 1022 intmonth;1023 intday;1024 intyear;1025 inthour;1026 intminute;1027 intsecond;1028 intmillisecond;1022 psS32 month; 1023 psS32 day; 1024 psS32 year; 1025 psS32 hour; 1026 psS32 minute; 1027 psS32 second; 1028 psS32 millisecond; 1029 1029 struct tm tmTime; 1030 1030 psTime *outTime = NULL; … … 1127 1127 psTime* psTimeFromTM(const struct tm* time) 1128 1128 { 1129 longyear;1130 longmonth;1131 longday;1132 longhour;1133 longminute;1134 longseconds;1135 longtemp;1129 psS64 year; 1130 psS64 month; 1131 psS64 day; 1132 psS64 hour; 1133 psS64 minute; 1134 psS64 seconds; 1135 psS64 temp; 1136 1136 psTime *outTime = NULL; 1137 1137 … … 1194 1194 { 1195 1195 psF64 deltaSec = 0; 1196 longdeltaUsec = 0;1196 psS64 deltaUsec = 0; 1197 1197 psTime *outTime = NULL; 1198 1198 … … 1243 1243 { 1244 1244 psS64 deltaSec = 0; 1245 longdeltaUsec = 0;1245 psS64 deltaUsec = 0; 1246 1246 psTime *outTime = NULL; 1247 1247 … … 1267 1267 outTime = psTimeAlloc(tai1->type); 1268 1268 deltaSec = tai1->sec - tai2->sec; 1269 deltaUsec = ( long)tai1->usec - (long)tai2->usec;1269 deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec; 1270 1270 1271 1271 // Adjust time in case of microsecond underflow after subtraction … … 1289 1289 { 1290 1290 psS64 deltaSec = 0; 1291 longdeltaUsec = 0;1291 psS64 deltaUsec = 0; 1292 1292 psTime *outTime = NULL; 1293 1293 … … 1313 1313 outTime = psTimeAlloc(tai1->type); 1314 1314 deltaSec = tai1->sec - tai2->sec; 1315 deltaUsec = ( long)tai1->usec - (long)tai2->usec;1315 deltaUsec = (psS64)tai1->usec - (psS64)tai2->usec; 1316 1316 1317 1317 // Adjust time in case of microsecond underflow after subtraction -
trunk/psLib/src/astronomy/psTime.h
r2179 r2204 54 54 * @author Ross Harman, MHPCC 55 55 * 56 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $57 * @date $Date: 2004-10-2 0 20:05:58$56 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 57 * @date $Date: 2004-10-27 00:57:30 $ 58 58 * 59 59 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 181 181 * @return long: leapseconds added between given times 182 182 */ 183 longpsTimeLeapseconds(183 psS64 psTimeLeapseconds( 184 184 const psTime* time1, ///< First input time. 185 185 const psTime* time2 ///< Second input time.
Note:
See TracChangeset
for help on using the changeset viewer.
