Changeset 12654
- Timestamp:
- Mar 28, 2007, 1:45:31 PM (19 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 4 edited
-
camera/pmFPAMosaic.c (modified) (4 diffs)
-
concepts/pmConceptsAverage.c (modified) (4 diffs)
-
concepts/pmConceptsAverage.h (modified) (2 diffs)
-
imcombine/pmReadoutCombine.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMosaic.c
r12629 r12654 510 510 int yTargetBase = (y0->data.S32[i] - yMin) / yBinTarget; // The base y position in the target frame 511 511 512 // in the first case, we are just copy a section pixel-by-pixel513 if ((xBinSource->data.S32[i] == xBinTarget) && 514 (yBinSource->data.S32[i] == yBinTarget) && 515 (xFlip->data.U8[i] == 0) && 516 (yFlip->data.U8[i] == 0)) {512 // in the first case, we are just copy a section pixel-by-pixel 513 if ((xBinSource->data.S32[i] == xBinTarget) && 514 (yBinSource->data.S32[i] == yBinTarget) && 515 (xFlip->data.U8[i] == 0) && 516 (yFlip->data.U8[i] == 0)) { 517 517 // Let someone else do the hard work 518 518 psImageOverlaySection(mosaic, image, xTargetBase, yTargetBase, "+"); 519 continue;520 } 521 522 // in the second case, there's a difference with the parities, but we don't have to523 // worry about binning524 if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget) {519 continue; 520 } 521 522 // in the second case, there's a difference with the parities, but we don't have to 523 // worry about binning 524 if (xBinSource->data.S32[i] == xBinTarget && yBinSource->data.S32[i] == yBinTarget) { 525 525 switch (type) { 526 526 COPY_WITH_PARITY_DIFFERENCE(F32); 527 527 COPY_WITH_PARITY_DIFFERENCE(U8); 528 default:528 default: 529 529 psAbort("Should never get here.\n"); 530 530 } 531 continue;532 } 533 534 // In the third case, the images are flipped and have different binnnig.535 // We have to do all of the hard work ourselves536 switch (type) {537 FILL_IN(F32);538 FILL_IN(U8);539 default:540 psAbort("Should never get here.\n");541 }531 continue; 532 } 533 534 // In the third case, the images are flipped and have different binnnig. 535 // We have to do all of the hard work ourselves 536 switch (type) { 537 FILL_IN(F32); 538 FILL_IN(U8); 539 default: 540 psAbort("Should never get here.\n"); 541 } 542 542 } // Iterating over images 543 543 … … 1048 1048 } 1049 1049 chipRegion = psRegionAlloc(0, 0, 0, 0); // We've cut and paste, so there's no valid trimsec 1050 *chipRegion = psRegionForImage (mosaicImage, *chipRegion);1050 *chipRegion = psRegionForImage (mosaicImage, *chipRegion); 1051 1051 } 1052 1052 psTrace("psModules.camera", 1, "xBin,yBin: %d,%d\n", xBin, yBin); … … 1054 1054 // Set the concepts for the target cell 1055 1055 psList *sourceCells = psArrayToList(source->cells); // List of cells 1056 pmConceptsAverageCells(targetCell, sourceCells, chipRegion, NULL );1056 pmConceptsAverageCells(targetCell, sourceCells, chipRegion, NULL, false); 1057 1057 { 1058 1058 psMetadataItem *item = psMetadataLookup(targetCell->concepts, "CELL.X0"); … … 1182 1182 } 1183 1183 } 1184 pmConceptsAverageCells(targetCell, sourceCells, fpaRegion, NULL );1184 pmConceptsAverageCells(targetCell, sourceCells, fpaRegion, NULL, false); 1185 1185 { 1186 1186 psMetadataItem *item = psMetadataLookup(targetCell->concepts, "CELL.X0"); -
trunk/psModules/src/concepts/pmConceptsAverage.c
r12653 r12654 22 22 // Set a variety of concepts in a cell by averaging over several 23 23 // XXX does not properly set XSIZE, YSIZE 24 bool pmConceptsAverageCells(pmCell *target, psList *sources, psRegion *trimsec, psRegion *biassec )24 bool pmConceptsAverageCells(pmCell *target, psList *sources, psRegion *trimsec, psRegion *biassec, bool same) 25 25 { 26 26 PS_ASSERT_PTR_NON_NULL(target, false); … … 61 61 xBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.XBIN"); 62 62 yBin = psMetadataLookupS32(NULL, cell->concepts, "CELL.YBIN"); 63 x0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0"); 64 y0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0"); 63 64 if (same) { 65 // Only makes sense to update these if they are the same cell 66 x0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.X0"); 67 y0 = psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0"); 68 } 65 69 } else { 66 70 if (timeSys != psMetadataLookupS32(NULL, cell->concepts, "CELL.TIMESYS")) { … … 84 88 success = false; 85 89 } 86 if (x0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")) { 87 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.X0 in use: %d vs %d\n", 88 x0, psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")); 89 success = false; 90 } 91 if (y0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")) { 92 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.Y0 in use: %d vs %d\n", 93 y0, psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")); 94 success = false; 90 if (same) { 91 if (x0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")) { 92 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.X0 in use: %d vs %d\n", 93 x0, psMetadataLookupS32(NULL, cell->concepts, "CELL.X0")); 94 success = false; 95 } 96 if (y0 != psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")) { 97 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Differing CELL.Y0 in use: %d vs %d\n", 98 y0, psMetadataLookupS32(NULL, cell->concepts, "CELL.Y0")); 99 success = false; 100 } 95 101 } 96 102 } … … 123 129 MD_UPDATE(target->concepts, "CELL.XBIN", S32, xBin); 124 130 MD_UPDATE(target->concepts, "CELL.YBIN", S32, yBin); 125 MD_UPDATE(target->concepts, "CELL.X0", S32, x0); 126 MD_UPDATE(target->concepts, "CELL.Y0", S32, y0); 131 if (same) { 132 MD_UPDATE(target->concepts, "CELL.X0", S32, x0); 133 MD_UPDATE(target->concepts, "CELL.Y0", S32, y0); 134 } 127 135 128 136 // CELL.TIME needs special care -
trunk/psModules/src/concepts/pmConceptsAverage.h
r11253 r12654 4 4 * @author Paul Price, IfA 5 5 * 6 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-0 1-24 02:54:14$6 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-03-28 23:45:31 $ 8 8 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 31 31 /// - CELL.READDIR 32 32 /// - CELL.TIMESYS 33 /// - CELL.X0, CELL.Y0 33 34 /// And for others, it takes the "worst" possible value: 34 35 /// - CELL.SATURATION 35 36 /// - CELL.BAD 37 /// These concepts are only handled if the cells are all the same cell (mosaicking vs stacking): 38 /// - CELL.X0, CELL.Y0 36 39 bool pmConceptsAverageCells(pmCell *target,///< Target cell 37 40 psList *sources, ///< List of source cells 38 41 psRegion *trimsec, ///< The new trim section 39 psRegion *biassec ///< The new bias section 42 psRegion *biassec, ///< The new bias section 43 bool same ///< Are the cells the same cell from different chips? 40 44 ); 41 45 -
trunk/psModules/src/imcombine/pmReadoutCombine.c
r12651 r12654 398 398 psListAdd(inputCells, PS_LIST_TAIL, readout->parent); 399 399 } 400 bool success = pmConceptsAverageCells(output->parent, inputCells, NULL, NULL );400 bool success = pmConceptsAverageCells(output->parent, inputCells, NULL, NULL, true); 401 401 psFree(inputCells); 402 402
Note:
See TracChangeset
for help on using the changeset viewer.
