Changeset 18364
- Timestamp:
- Jun 29, 2008, 2:53:45 PM (18 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 6 edited
-
camera/pmFPA.c (modified) (4 diffs)
-
camera/pmFPAfileFitsIO.h (modified) (1 diff)
-
camera/pmFPAfileIO.h (modified) (1 diff)
-
concepts/pmConcepts.c (modified) (2 diffs)
-
concepts/pmConcepts.h (modified) (2 diffs)
-
detrend/pmMaskBadPixels.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPA.c
r17986 r18364 303 303 304 304 tmpCell->concepts = psMetadataAlloc(); 305 tmpCell->conceptsRead = PM_CONCEPT_SOURCE_NONE;306 305 if (!psMetadataAddStr(tmpCell->concepts, PS_LIST_HEAD, "CELL.NAME", 0, NULL, name)) { 307 306 psErrorClear(); 308 307 psWarning("Could not add CELL.NAME to metadata."); 309 308 } 310 pmConceptsBlankCell(tmpCell); 309 tmpCell->conceptsRead = PM_CONCEPT_SOURCE_NONE; 310 // XXX does this work? moved to conceptsRead... pmConceptsBlankCell(tmpCell); 311 311 312 312 return tmpCell; … … 342 342 343 343 tmpChip->concepts = psMetadataAlloc(); 344 tmpChip->conceptsRead = PM_CONCEPT_SOURCE_NONE;345 344 if (!psMetadataAddStr(tmpChip->concepts, PS_LIST_HEAD, "CHIP.NAME", 0, NULL, name)) { 346 345 psErrorClear(); 347 346 psWarning("Could not add CHIP.NAME %s to concepts.", name); 348 347 } 349 pmConceptsBlankChip(tmpChip); 348 tmpChip->conceptsRead = PM_CONCEPT_SOURCE_NONE; 349 // XXX does this work? moved to conceptsRead... pmConceptsBlankChip(tmpChip); 350 350 return tmpChip; 351 351 } … … 372 372 373 373 tmpFPA->concepts = psMetadataAlloc(); 374 tmpFPA->conceptsRead = PM_CONCEPT_SOURCE_NONE;375 pmConceptsBlankFPA(tmpFPA);376 377 374 if (!psMetadataAddStr(tmpFPA->concepts, PS_LIST_TAIL, "FPA.CAMERA", PS_META_REPLACE, 378 375 "Camera name (according to configuration)", cameraName)) { … … 380 377 psWarning("Could not add FPA.CAMERA %s to concepts.", cameraName); 381 378 } 379 tmpFPA->conceptsRead = PM_CONCEPT_SOURCE_NONE; 380 // XXX does this work? moved to conceptsRead... pmConceptsBlankFPA(tmpFPA); 382 381 383 382 // this may be somewhat pedantic, but it makes these things consistent -
trunk/psModules/src/camera/pmFPAfileFitsIO.h
r18330 r18364 5 5 * @author PAP, IfA 6 6 * 7 * @version $Revision: 1.1 3$ $Name: not supported by cvs2svn $8 * @date $Date: 2008-06- 26 21:11:56$7 * @version $Revision: 1.14 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-06-30 00:53:45 $ 9 9 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 10 10 */ -
trunk/psModules/src/camera/pmFPAfileIO.h
r18330 r18364 5 5 * @author PAP, IfA 6 6 * 7 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $8 * @date $Date: 2008-06- 26 21:11:56$7 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-06-30 00:53:45 $ 9 9 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 10 10 */ -
trunk/psModules/src/concepts/pmConcepts.c
r18178 r18364 191 191 // Read all registered concepts for the specified level 192 192 static bool conceptsRead(psMetadata **specs, // One of the concepts specifications 193 constpmFPA *fpa, // The FPA194 constpmChip *chip, // The chip195 constpmCell *cell, // The cell193 pmFPA *fpa, // The FPA 194 pmChip *chip, // The chip 195 pmCell *cell, // The cell 196 196 unsigned int *read, // What's already been read 197 197 pmConceptSource source, // The source of the concepts to read … … 215 215 } 216 216 pmHDU *hduHigh = pmHDUGetHighest(fpa, chip, cell); // Highest HDU 217 218 if (cell && (cell->conceptsRead == PM_CONCEPT_SOURCE_NONE)) { 219 pmConceptsBlankCell(cell); 220 cell->conceptsRead = PM_CONCEPT_SOURCE_BLANK; 221 } 222 if (chip && (chip->conceptsRead == PM_CONCEPT_SOURCE_NONE)) { 223 pmConceptsBlankChip(chip); 224 chip->conceptsRead = PM_CONCEPT_SOURCE_BLANK; 225 } 226 if (fpa && (fpa->conceptsRead == PM_CONCEPT_SOURCE_NONE)) { 227 pmConceptsBlankFPA(fpa); 228 fpa->conceptsRead = PM_CONCEPT_SOURCE_BLANK; 229 } 217 230 218 231 bool success = true; // Success in reading concepts? -
trunk/psModules/src/concepts/pmConcepts.h
r18163 r18364 4 4 * @author Paul Price, IfA 5 5 * 6 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $7 * @date $Date: 2008-06- 17 22:16:38$6 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2008-06-30 00:53:45 $ 8 8 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 9 9 */ … … 24 24 typedef enum { 25 25 PM_CONCEPT_SOURCE_NONE = 0x00, ///< No concepts 26 PM_CONCEPT_SOURCE_CELLS = 0x01, ///< Concept comes from the camera information 27 PM_CONCEPT_SOURCE_DEFAULTS = 0x02, ///< Concept comes from defaults 28 PM_CONCEPT_SOURCE_PHU = 0x04, ///< Concept comes from PHU 29 PM_CONCEPT_SOURCE_HEADER = 0x08, ///< Concept comes from FITS header 30 PM_CONCEPT_SOURCE_DATABASE = 0x10, ///< Concept comes from database 31 PM_CONCEPT_SOURCE_ALL = 0xff ///< All concepts 26 PM_CONCEPT_SOURCE_BLANK = 0x01, ///< Blank concepts defined, but not read 27 PM_CONCEPT_SOURCE_CELLS = 0x02, ///< Concept comes from the camera information 28 PM_CONCEPT_SOURCE_DEFAULTS = 0x04, ///< Concept comes from defaults 29 PM_CONCEPT_SOURCE_PHU = 0x08, ///< Concept comes from PHU 30 PM_CONCEPT_SOURCE_HEADER = 0x10, ///< Concept comes from FITS header 31 PM_CONCEPT_SOURCE_DATABASE = 0x20, ///< Concept comes from database 32 PM_CONCEPT_SOURCE_ALL = 0xfe ///< All concepts (exclude BLANK) 32 33 } pmConceptSource; 33 34 -
trunk/psModules/src/detrend/pmMaskBadPixels.c
r17228 r18364 100 100 if (suspect) { 101 101 PS_ASSERT_IMAGE_NON_EMPTY(suspect, false); 102 PS_ASSERT_IMAGE_TYPE(suspect, PS_TYPE_ S32, false);102 PS_ASSERT_IMAGE_TYPE(suspect, PS_TYPE_F32, false); 103 103 PS_ASSERT_IMAGES_SIZE_EQUAL(readout->image, suspect, false); 104 104 psMemIncrRefCounter(suspect); 105 105 } else { 106 suspect = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_ S32);106 suspect = psImageAlloc(readout->image->numCols, readout->image->numRows, PS_TYPE_F32); 107 107 psImageInit(suspect, 0); 108 108 psMetadataAddImage(output->analysis, PS_LIST_TAIL, PM_MASK_ANALYSIS_SUSPECT, PS_META_REPLACE, … … 115 115 // If we get down here and the statistics are missing, then we should go and mask the entire image 116 116 psWarning("Missing statistics --- flagging entire image as suspect."); 117 return (psImage*)psBinaryOp(suspect, suspect, "+", psScalarAlloc(1.0, PS_TYPE_ S32));117 return (psImage*)psBinaryOp(suspect, suspect, "+", psScalarAlloc(1.0, PS_TYPE_F32)); 118 118 } 119 119 … … 126 126 for (int x = 0; x < image->numCols; x++) { 127 127 if (fabs((image->data.F32[y][x] - median) / stdev) >= rej && 128 (!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal))) {129 suspect->data. S32[y][x]++;128 (!mask || !(mask->data.PS_TYPE_MASK_DATA[y][x] & maskVal))) { 129 suspect->data.F32[y][x] += 1.0; 130 130 } 131 131 } … … 149 149 } 150 150 PS_ASSERT_IMAGE_NON_EMPTY(suspects, false); 151 PS_ASSERT_IMAGE_TYPE(suspects, PS_TYPE_ S32, false);151 PS_ASSERT_IMAGE_TYPE(suspects, PS_TYPE_F32, false); 152 152 if (output->mask) { 153 153 PS_ASSERT_IMAGE_NON_EMPTY(output->mask, false); … … 243 243 for (int y = 0; y < suspects->numRows; y++) { 244 244 for (int x = 0; x < suspects->numCols; x++) { 245 if (suspects->data. S32[y][x] >= limit) {245 if (suspects->data.F32[y][x] >= limit) { 246 246 badpix->data.PS_TYPE_MASK_DATA[y][x] = maskVal; 247 247 }
Note:
See TracChangeset
for help on using the changeset viewer.
