Changeset 6552 for branches/rel10_ifa/psModules/src/astrom/pmFPA.c
- Timestamp:
- Mar 8, 2006, 5:08:08 PM (20 years ago)
- File:
-
- 1 edited
-
branches/rel10_ifa/psModules/src/astrom/pmFPA.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/astrom/pmFPA.c
r6448 r6552 12 12 * XXX: Should we implement non-linear cell->chip transforms? 13 13 * 14 * @version $Revision: 1.1.4. 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2006-0 2-17 17:13:41$14 * @version $Revision: 1.1.4.2 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2006-03-09 03:08:08 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 26 26 #include "pslib.h" 27 27 28 #include "pmHDU.h" 28 29 #include "pmFPA.h" 29 30 #include "pmConcepts.h" … … 97 98 #endif 98 99 99 psFree(cell->toChip);100 psFree(cell->toFPA);101 psFree(cell->toSky);102 100 psFree(cell->concepts); 103 101 psFree(cell->analysis); 104 psFree(cell->c amera);102 psFree(cell->config); 105 103 psFree(cell->hdu); 106 104 } … … 135 133 #endif 136 134 135 #if 0 136 137 137 psFree(chip->toFPA); 138 138 psFree(chip->fromFPA); 139 #endif 140 139 141 psFree(chip->concepts); 140 142 psFree(chip->analysis); … … 148 150 if (fpa != NULL) { 149 151 psTrace(__func__, 9, "Freeing fpa %lx\n", (size_t)fpa); 152 #if 0 153 150 154 psFree(fpa->fromTangentPlane); 151 155 psFree(fpa->toTangentPlane); 152 156 psFree(fpa->projection); 157 #endif 158 153 159 psFree(fpa->concepts); 154 160 psFree(fpa->analysis); … … 172 178 psFree(fpa->chips); 173 179 psFree(fpa->hdu); 174 psFree(fpa->phu);175 180 } 176 181 } … … 230 235 231 236 232 233 void p_pmHDUFree(p_pmHDU *hdu)234 {235 if (hdu) {236 psFree(hdu->extname);237 psFree(hdu->header);238 psFree(hdu->images);239 psFree(hdu->masks);240 psFree(hdu->weights);241 }242 }243 244 // XXX: Verify these default values for row0, col0, rowBins, colBins245 // PAP: These values may disappear in the future in favour of values in parent->concepts?246 237 pmReadout *pmReadoutAlloc(pmCell *cell) 247 238 { 248 239 pmReadout *tmpReadout = (pmReadout *) psAlloc(sizeof(pmReadout)); 249 240 250 tmpReadout->col0 = 0;251 tmpReadout->row0 = 0;252 tmpReadout->colBins = 0;253 tmpReadout->rowBins = 0;254 241 tmpReadout->image = NULL; 255 242 tmpReadout->mask = NULL; … … 276 263 pmCell *pmCellAlloc( 277 264 pmChip *chip, 278 psMetadata *cameraData,279 265 const char *name) 280 266 { 281 267 pmCell *tmpCell = (pmCell *) psAlloc(sizeof(pmCell)); 282 268 283 tmpCell->col0 = 0;284 tmpCell->row0 = 0;285 tmpCell->toChip = NULL;286 tmpCell->toFPA = NULL;287 tmpCell->toSky = NULL;288 269 tmpCell->concepts = psMetadataAlloc(); 289 270 psBool rc = psMetadataAddStr(tmpCell->concepts, PS_LIST_HEAD, "CELL.NAME", 0, NULL, name); … … 291 272 psLogMsg(__func__, PS_LOG_WARN, "WARNING: Could not add CELL.NAME to metadata.\n"); 292 273 } 293 tmpCell->c amera = psMemIncrRefCounter(cameraData);274 tmpCell->config = NULL; 294 275 tmpCell->analysis = psMetadataAlloc(); 295 276 tmpCell->readouts = psArrayAlloc(0); … … 323 304 pmChip *tmpChip = (pmChip *) psAlloc(sizeof(pmChip)); 324 305 306 #if 0 307 325 308 tmpChip->col0 = 0; 326 309 tmpChip->row0 = 0; 327 310 tmpChip->toFPA = NULL; 328 311 tmpChip->fromFPA = NULL; 312 #endif 313 329 314 tmpChip->concepts = psMetadataAlloc(); 330 315 psBool rc = psMetadataAddStr(tmpChip->concepts, PS_LIST_HEAD, "CHIP.NAME", 0, NULL, name); … … 359 344 pmFPA *tmpFPA = (pmFPA *) psAlloc(sizeof(pmFPA)); 360 345 346 #if 0 347 361 348 tmpFPA->fromTangentPlane = NULL; 362 349 tmpFPA->toTangentPlane = NULL; 363 350 tmpFPA->projection = NULL; 351 #endif 352 364 353 tmpFPA->concepts = psMetadataAlloc(); 365 354 tmpFPA->analysis = NULL; … … 367 356 tmpFPA->chips = psArrayAlloc(0); 368 357 tmpFPA->hdu = NULL; 369 tmpFPA->phu = NULL;370 358 371 359 pmConceptsBlankFPA(tmpFPA); … … 375 363 } 376 364 377 p_pmHDU *p_pmHDUAlloc(const char *extname) 378 { 379 p_pmHDU *hdu = psAlloc(sizeof(p_pmHDU)); 380 psMemSetDeallocator(hdu, (psFreeFunc)p_pmHDUFree); 381 382 hdu->extname = psStringCopy(extname); 383 hdu->header = NULL; 384 hdu->images = NULL; 385 hdu->masks = NULL; 386 hdu->weights = NULL; 365 pmHDU *pmHDUFromFPA(pmFPA *fpa // FPA for which to find HDU 366 ) 367 { 368 return fpa->hdu; 369 } 370 371 pmHDU *pmHDUFromChip(pmChip *chip // Chip for which to find HDU 372 ) 373 { 374 pmHDU *hdu = chip->hdu; // The HDU information 375 if (!hdu) { 376 hdu = pmHDUFromFPA(chip->parent); // Grab HDU info from the FPA 377 } 378 379 return hdu; 380 } 381 382 pmHDU *pmHDUFromCell(pmCell *cell // Cell for which to find HDU 383 ) 384 { 385 pmHDU *hdu = cell->hdu; // The HDU information 386 if (!hdu) { 387 hdu = pmHDUFromChip(cell->parent); // Grab HDU info from the chip 388 } 387 389 388 390 return hdu; … … 599 601 } 600 602 601 603 #if 0 602 604 bool pmCellSetWeights(pmCell *cell // Cell for which to set weights 603 605 ) … … 609 611 float bad = psMetadataLookupF32(NULL, cell->concepts, "CELL.BAD"); // Bad level 610 612 611 p _pmHDU *hdu = cell->hdu;// The data unit, containing the weight and mask originals613 pmHDU *hdu = cell->hdu; // The data unit, containing the weight and mask originals 612 614 if (!hdu) { 613 615 pmChip *chip = cell->parent; // The parent chip … … 682 684 } 683 685 684 686 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
