Changeset 2855 for trunk/psLib/src/astronomy
- Timestamp:
- Dec 30, 2004, 10:18:37 AM (22 years ago)
- Location:
- trunk/psLib/src/astronomy
- Files:
-
- 2 edited
-
psAstrometry.c (modified) (5 diffs)
-
psAstrometry.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/astronomy/psAstrometry.c
r2600 r2855 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-12- 02 21:12:51$10 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-12-30 20:18:36 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 399 399 400 400 // create array of NULL psCells 401 chip->cells = psArrayAlloc(nCells); 401 int n = (nCells > 0) ? nCells : 1; 402 chip->cells = psArrayAlloc(n); 402 403 psPtr* cells = chip->cells->data; 403 for (psS32 i=0;i<n Cells;i++) {404 for (psS32 i=0;i<n;i++) { 404 405 cells[i] = NULL; 405 406 } 407 chip->cells->n = 0; // per requirement 408 409 *(int*)&chip->row0 = 0; 410 *(int*)&chip->col0 = 0; 406 411 407 412 chip->metadata = NULL; … … 429 434 430 435 // create array of NULL psReadouts 431 cell->readouts = psArrayAlloc(nReadouts); 436 int n = (nReadouts > 0) ? nReadouts : 1; 437 cell->readouts = psArrayAlloc(n); 432 438 psPtr* readouts = cell->readouts->data; 433 for (psS32 i=0;i<n Readouts;i++) {439 for (psS32 i=0;i<n;i++) { 434 440 readouts[i] = NULL; 435 441 } 442 cell->readouts->n = 0; // per requirement 443 444 *(int*)&cell->row0 = 0; 445 *(int*)&cell->col0 = 0; 436 446 437 447 cell->metadata = NULL; … … 452 462 } 453 463 454 psReadout* psReadoutAlloc(psS32 col0, 455 psS32 row0, 456 const psImage* image) 457 { 458 PS_INT_CHECK_NON_NEGATIVE(col0, NULL); 459 PS_INT_CHECK_NON_NEGATIVE(row0, NULL); 460 464 psReadout* psReadoutAlloc() 465 { 461 466 psReadout* readout = psAlloc(sizeof(psReadout)); 462 467 463 *(psU32*)&readout->colBins = 1; 464 *(psU32*)&readout->rowBins = 1; 465 *(psS32*)&readout->col0 = col0; 466 *(psS32*)&readout->row0 = row0; 467 468 readout->image = (psImage*)image; 468 *(psU32*)&readout->colBins = 0; 469 *(psU32*)&readout->rowBins = 0; 470 *(psU32*)&readout->rowParity = 0; 471 *(psU32*)&readout->colParity = 0; 472 *(psS32*)&readout->col0 = 0; 473 *(psS32*)&readout->row0 = 0; 474 475 readout->image = NULL; 469 476 readout->mask = NULL; 470 477 readout->objects = NULL; … … 718 725 PS_PTR_CHECK_NULL(cellCoord, NULL); 719 726 PS_PTR_CHECK_NULL(cell, NULL); 720 PS_PTR_CHECK_NULL(cell->to TP, NULL);727 PS_PTR_CHECK_NULL(cell->toSky, NULL); 721 728 PS_PTR_CHECK_NULL(cell->parent, NULL); 722 729 PS_PTR_CHECK_NULL(cell->parent->parent, NULL); -
trunk/psLib/src/astronomy/psAstrometry.h
r2600 r2855 8 8 * @author GLG, MHPCC 9 9 * 10 * @version $Revision: 1.3 2$ $Name: not supported by cvs2svn $11 * @date $Date: 2004-12- 02 21:12:51$10 * @version $Revision: 1.33 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2004-12-30 20:18:36 $ 12 12 * 13 13 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 99 99 typedef struct 100 100 { 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. 101 const psS32 col0; ///< Offset from the left of chip. 102 const psS32 row0; ///< Offset from the bottom of chip. 103 104 const int colParity; ///< Column Readout Direction 105 const int rowParity; ///< Row Readout Direction 106 107 const psU32 colBins; ///< Amount of binning in x-dimension 108 const psU32 rowBins; ///< Amount of binning in y-dimension 105 109 106 110 psImage* image; ///< Imaging area of readout … … 122 126 typedef struct 123 127 { 128 const psS32 col0; ///< Offset from the left of chip 129 const psS32 row0; ///< Offset from the bottom of chip 130 124 131 psArray* readouts; ///< readouts from the cell 132 125 133 psMetadata* metadata; ///< cell-level metadata 126 134 127 135 psPlaneTransform* toChip; ///< transformations from cell to chip coordinates 128 psPlaneTransform* fromChip; ///< transformations from c hip to cellcoordinates136 psPlaneTransform* fromChip; ///< transformations from cell to chip coordinates 129 137 psPlaneTransform* toFPA; ///< transformations from cell to FPA coordinates 130 psPlaneTransform* toTP; ///< transformations from cell to tangent planecoordinates131 psPlaneTransform* toSky; ///< transformations from cell to tangent plane coordinates138 psPlaneTransform* toTP; ///< transformations from cell to FPA coordinates 139 psPlaneTransform* toSky; ///< transformations from cell to tangent plane coordinates 132 140 133 141 struct psChip* parent; ///< chip in which contains this cell … … 145 153 typedef struct psChip 146 154 { 155 const psS32 col0; ///< Offset from the left of FPA 156 const psS32 row0; ///< Offset from the bottom of FPA 157 147 158 psArray* cells; ///< cells in the chip 159 148 160 psMetadata* metadata; ///< chip-level metadata 149 161 … … 282 294 /** Allocator for psObservatory 283 295 * 284 * This function shall construct a new psObservatory with attributes 296 * This function shall construct a new psObservatory with attributes 285 297 * cooresponding to the function parameters. 286 298 * … … 340 352 * to NULL. 341 353 * 342 * @return psReadout* newly allocated psReadout 343 */ 344 psReadout* psReadoutAlloc( 345 psS32 col0, ///< offset from the left of the cell 346 psS32 row0, ///< offset from the bottom of the cell 347 const psImage* image ///< image of the readout 348 ); 354 * @return psReadout* newly allocated psReadout with all internal pointers set to NULL 355 */ 356 psReadout* psReadoutAlloc(); 349 357 350 358 /** Allocates a Wallace's Grommit structure.
Note:
See TracChangeset
for help on using the changeset viewer.
