Changeset 6351
- Timestamp:
- Feb 7, 2006, 2:52:13 PM (20 years ago)
- Location:
- branches/eam_rel9_p0/psModules/src
- Files:
-
- 3 edited
-
astrom/pmChipMosaic.c (modified) (3 diffs)
-
astrom/pmConcepts.c (modified) (2 diffs)
-
imsubtract/pmSubtractBias.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_p0/psModules/src/astrom/pmChipMosaic.c
r6342 r6351 157 157 } 158 158 159 psMetadataPrint(cell->concepts, 10);160 161 159 nCells++; 162 160 gain += psMetadataLookupF32(NULL, cell->concepts, "CELL.GAIN"); … … 303 301 psArrayElementsFree(hdu->weights); 304 302 psArrayElementsFree(hdu->masks); 305 hdu->images = psArray Alloc(1);306 hdu->weights = psArray Alloc(1);307 hdu->masks = psArray Alloc(1);303 hdu->images = psArrayRealloc(hdu->images,1); 304 hdu->weights = psArrayRealloc(hdu->weights, 1); 305 hdu->masks = psArrayRealloc(hdu->masks, 1); 308 306 hdu->images->data[0] = image; 309 307 hdu->weights->data[0] = weight; … … 314 312 315 313 // Chop off all the component cells, and put in a new one 316 #if !MEM_LEAKS 314 pmCell *newCell = pmCellAlloc(NULL, NULL, __func__); // New cell 315 cellConcepts(newCell, cells, xBinChip, yBinChip); 317 316 pmChipFreeCells(chip); 318 #else 319 320 chip->cells = psArrayAlloc(0); 321 #endif 322 323 pmCell *cell = pmCellAlloc(chip, NULL, __func__); // New cell 324 cellConcepts(cell, cells, xBinChip, yBinChip); 325 326 #if 0 327 // XXX For the sake of getting something working, I am not going to bother with sorting out where 328 // the double free is coming from. I'm going to drop the pointers on the array and create a memory 329 // leak. We can clean this up later, when we're not under as much pressure. 330 psArrayElementsFree(chip->cells); 331 chip->cells->n = 0; 332 #endif 333 334 cell->exists = true; 335 cell->process = true; 336 pmReadout *readout = pmReadoutAlloc(cell); // New readout 337 psRegion entire = {0.0, 0.0, 0.0, 0.0}; 317 // Have to put in the new cell manually, since we didn't want to put it in before blowing the cells away. 318 newCell->parent = chip; 319 psArrayAdd(chip->cells, 1, newCell); 320 newCell->exists = true; 321 newCell->process = true; 322 323 // Now make a new readout to go in the new cell 324 pmReadout *newReadout = pmReadoutAlloc(newCell); // New readout 338 325 // Want the readouts to contain a subimage, but that subimage is the whole image. 339 326 // This preserves the relationship there was before, where freeing the parent frees the child. 340 readout->image = psImageSubset(image, entire); 341 readout->weight = psImageSubset(weight, entire); 342 readout->mask = psImageSubset(mask, entire); 343 psFree(readout); 327 psRegion entire = {0.0, 0.0, 0.0, 0.0}; 328 newReadout->image = psImageSubset(image, entire); 329 newReadout->weight = psImageSubset(weight, entire); 330 newReadout->mask = psImageSubset(mask, entire); 331 // Drop references 332 psFree(newReadout); 333 psFree(newCell); 344 334 345 335 // Well, we've stuffed around with the camera configuration, so it's no longer valid... -
branches/eam_rel9_p0/psModules/src/astrom/pmConcepts.c
r6342 r6351 85 85 { 86 86 switch (blank->type) { 87 case PS_DATA_STRING: 88 return psMetadataItemAllocStr(blank->name, blank->comment, 89 pmConceptReadString(fpa, chip, cell, db, blank->name)); 87 case PS_DATA_STRING: { 88 psString string = pmConceptReadString(fpa, chip, cell, db, blank->name); 89 psMetadataItem *item = psMetadataItemAllocStr(blank->name, blank->comment, string); 90 psFree(string); 91 return item; 92 } 90 93 case PS_DATA_S32: 91 94 return psMetadataItemAllocS32(blank->name, blank->comment, … … 152 155 } 153 156 psMetadataAddItem(target, conceptItem, PS_LIST_TAIL, PS_META_REPLACE); 157 psFree(conceptItem); // Drop reference 154 158 } 155 159 psFree(specsIter); -
branches/eam_rel9_p0/psModules/src/imsubtract/pmSubtractBias.c
r6080 r6351 11 11 * @author GLG, MHPCC 12 12 * 13 * @version $Revision: 1.6.8.1.2. 4$ $Name: not supported by cvs2svn $14 * @date $Date: 2006-0 1-20 09:47:06$13 * @version $Revision: 1.6.8.1.2.5 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2006-02-08 00:52:13 $ 15 15 * 16 16 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 376 376 break; 377 377 case PM_FIT_POLY_ORD: 378 overscanOpts->poly = psPolynomial1DAlloc(overscanOpts->order, PS_POLYNOMIAL_ORD); 379 overscanOpts->poly = psVectorFitPolynomial1D(overscanOpts->poly, mask, 1, reduced, NULL, 380 ordinate); 378 if (overscanOpts->poly && (overscanOpts->poly->nX != overscanOpts->order || 379 overscanOpts->poly->type != PS_POLYNOMIAL_ORD)) { 380 psFree(overscanOpts->poly); 381 overscanOpts->poly = psPolynomial1DAlloc(overscanOpts->order, PS_POLYNOMIAL_ORD); 382 } 383 psVectorFitPolynomial1D(overscanOpts->poly, mask, 1, reduced, NULL, ordinate); 381 384 psFree(reduced); 382 385 reduced = psPolynomial1DEvalVector(overscanOpts->poly, ordinate); 383 386 break; 384 387 case PM_FIT_POLY_CHEBY: 385 overscanOpts->poly = psPolynomial1DAlloc(overscanOpts->order, PS_POLYNOMIAL_CHEB); 386 overscanOpts->poly = psVectorFitPolynomial1D(overscanOpts->poly, mask, 1, reduced, NULL, 387 ordinate); 388 if (overscanOpts->poly && (overscanOpts->poly->nX != overscanOpts->order || 389 overscanOpts->poly->type != PS_POLYNOMIAL_CHEB)) { 390 psFree(overscanOpts->poly); 391 overscanOpts->poly = psPolynomial1DAlloc(overscanOpts->order, PS_POLYNOMIAL_CHEB); 392 } 393 psVectorFitPolynomial1D(overscanOpts->poly, mask, 1, reduced, NULL, ordinate); 388 394 psFree(reduced); 389 395 reduced = psPolynomial1DEvalVector(overscanOpts->poly, ordinate); … … 501 507 // Reduce the overscans 502 508 psVector *reduced = overscanVector(overscanOpts, pixels, myStats); 509 psFree(pixels); 503 510 if (! reduced) { 504 511 return in; … … 544 551 // Reduce the overscans 545 552 psVector *reduced = overscanVector(overscanOpts, pixels, myStats); 553 psFree(pixels); 546 554 if (! reduced) { 547 555 return in;
Note:
See TracChangeset
for help on using the changeset viewer.
