Changeset 9594
- Timestamp:
- Oct 16, 2006, 4:21:03 PM (20 years ago)
- Location:
- trunk/psModules/src
- Files:
-
- 6 edited
-
camera/pmFPAMaskWeight.c (modified) (7 diffs)
-
camera/pmFPAMaskWeight.h (modified) (2 diffs)
-
camera/pmFPAfileIO.c (modified) (2 diffs)
-
objects/pmPSFtry.c (modified) (3 diffs)
-
objects/pmSourcePhotometry.c (modified) (2 diffs)
-
objects/pmSourceSky.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAMaskWeight.c
r8815 r9594 94 94 ////////////////////////////////////////////////////////////////////////////////////////////////////////////// 95 95 96 bool pmReadoutSetMask(pmReadout *readout// Readout for which to set mask 97 ) 96 bool pmReadoutSetMask(pmReadout *readout) 98 97 { 99 98 PS_ASSERT_PTR_NON_NULL(readout, false); … … 143 142 } 144 143 145 bool pmReadoutGenerateMask(pmReadout *readout // Readout for which to generate mask 146 ) 144 bool pmReadoutGenerateMask(pmReadout *readout) 147 145 { 148 146 PS_ASSERT_PTR_NON_NULL(readout, false); … … 190 188 } 191 189 192 bool pmReadoutSetWeight(pmReadout *readout // Readout for which to set weight 193 ) 190 bool pmReadoutSetWeight(pmReadout *readout) 194 191 { 195 192 PS_ASSERT_PTR_NON_NULL(readout, false); … … 219 216 } 220 217 221 bool pmReadoutGenerateWeight(pmReadout *readout // Readout for which to generate weight 222 ) 218 bool pmReadoutGenerateWeight(pmReadout *readout) 223 219 { 224 220 PS_ASSERT_PTR_NON_NULL(readout, false); … … 266 262 } 267 263 268 bool pmCellGenerateMaskWeight(pmCell *cell // Cell for which to set weights 269 ) 264 bool pmReadoutGenerateMaskWeight(pmReadout *readout) 265 { 266 PS_ASSERT_PTR_NON_NULL(readout, false); 267 268 bool success = true; // Was everything successful? 269 270 success |= pmReadoutGenerateMask(readout); 271 success |= pmReadoutGenerateWeight(readout); 272 273 return success; 274 } 275 276 bool pmCellGenerateMaskWeight(pmCell *cell) 270 277 { 271 278 PS_ASSERT_PTR_NON_NULL(cell, false); … … 275 282 for (int i = 0; i < readouts->n; i++) { 276 283 pmReadout *readout = readouts->data[i]; // The readout 277 success |= pmReadoutGenerateMask(readout); 278 success |= pmReadoutGenerateWeight(readout); 284 pmReadoutGenerateMaskWeight(readout); 279 285 } 280 286 … … 282 288 } 283 289 284 bool pmReadoutGenerateMaskWeight(pmReadout *readout // Readout for which to set mask and weights285 )286 {287 PS_ASSERT_PTR_NON_NULL(readout, false);288 289 bool success = true; // Was everything successful?290 291 success |= pmReadoutGenerateMask(readout);292 success |= pmReadoutGenerateWeight(readout);293 294 return success;295 } -
trunk/psModules/src/camera/pmFPAMaskWeight.h
r7715 r9594 1 #ifndef PM_READOUT_MASK_WEIGHT_H 2 #define PM_READOUT_MASK_WEIGHT_H 1 /// @file pmFPAHeader.h 2 /// 3 /// @brief Functions read FITS headers for FPA components 4 /// 5 /// @ingroup Camera 6 /// 7 /// @author Paul Price, IfA 8 /// @author Eugene Magnier, IfA 9 /// 10 /// @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 11 /// @date $Date: 2006-10-17 02:21:03 $ 12 /// 13 /// Copyright 2005-2006 Institute for Astronomy, University of Hawaii 14 /// 15 #ifndef PM_FPA_MASK_WEIGHT_H 16 #define PM_FPA_MASK_WEIGHT_H 3 17 4 18 #include "pmFPA.h" 5 19 6 // these defines are necessary to yield 8-bit results (use instead of ~) 7 #define NOT_U8(A)(UCHAR_MAX-(A)) 8 #define NOT_U16(A)(USHORT_MAX-(A)) 9 10 /** Mask values */ 20 /// Pixel mask values 11 21 typedef enum { 12 22 PM_MASK_CLEAR = 0x00, ///< The pixel is not masked … … 21 31 } pmMaskValue; 22 32 23 // These functions set an extant mask/weight (or create a throwaway one). 24 // The throwaway case is intended for when the user is iterating using pmReadoutReadNext, in which case 25 // the HDU can't be generated 26 bool pmReadoutSetMask(pmReadout *readout // Readout for which to set mask 33 34 /// Set a temporary readout mask using CELL.SATURATION and CELL.BAD 35 /// 36 /// Identifies pixels that are saturated (>= CELL.SATURATION) or bad (<= CELL.BAD). The mask that is produced 37 /// within the readout is temporary --- it is not added to the HDU. This is intended for when the user is 38 /// iterating using pmReadoutReadNext, in which case the HDU can't be generated. 39 bool pmReadoutSetMask(pmReadout *readout ///< Readout for which to set mask 27 40 ); 28 bool pmReadoutSetWeight(pmReadout *readout // Readout for which to set weight 41 42 43 /// Set a temporary readout weight map using CELL.GAIN and CELL.READNOISE 44 /// 45 /// Calculates weights (actually variances) for each pixel using photon statistics and the cell gain 46 /// (CELL.GAIN) and read noise (CELL.READNOISE). The weight map that is produced within the readout is 47 /// temporary --- it is not added to the HDU. This is intended for when the user is iterating using 48 /// pmReadoutReadNext, in which case the HDU can't be generated. 49 bool pmReadoutSetWeight(pmReadout *readout ///< Readout for which to set weight 29 50 ); 30 51 31 // These functions generate a mask/weight suitable for output (complete with HDU entry) and then set them. 32 bool pmReadoutGenerateMask(pmReadout *readout // Readout for which to generate mask 52 /// Generate a readout mask (suitable for output) using CELL.SATURATION and CELL.BAD 53 /// 54 /// Identifies pixels that are saturated (>= CELL.SATURATION) or bad (<= CELL.BAD). The mask that is produced 55 /// is suitable for output (complete with HDU entry). This is intended for most operations. 56 bool pmReadoutGenerateMask(pmReadout *readout ///< Readout for which to generate mask 33 57 ); 34 bool pmReadoutGenerateWeight(pmReadout *readout // Readout for which to generate weight 58 59 /// Generate a weight map (suitable for output) using CELL.GAIN and CELL.READNOISE 60 /// 61 /// Calculates weights (actually variances) for each pixel using photon statistics and the cell gain 62 /// (CELL.GAIN) and read noise (CELL.READNOISE). The weight map that is produced within the readout is 63 /// suitable for output (complete with HDU entry). This is intended for most operations. 64 bool pmReadoutGenerateWeight(pmReadout *readout ///< Readout for which to generate weight 35 65 ); 36 66 37 // These functions are conveniences for pmReadoutGenerateMask and pmReadoutGenerateWeight. 38 bool pmCellGenerateMaskWeight(pmCell *cell // Cell for which to generate mask and weights 67 /// Generate mask and weight map for a readout 68 /// 69 /// Calls pmReadoutGenerateMask and pmReadoutGenerateWeight for the readout 70 bool pmReadoutGenerateMaskWeight(pmReadout *readout ///< Readout for which to generate mask and weights 71 ); 72 73 /// Generate mask and weight maps for all readouts within a cell 74 /// 75 /// Calls pmReadoutGenerateMaskWeight for each readout within the cell. 76 bool pmCellGenerateMaskWeight(pmCell *cell ///< Cell for which to generate mask and weights 39 77 ); 40 bool pmReadoutGenerateMaskWeight(pmReadout *readout // Readout for which to generate mask and weights 41 ); 78 42 79 43 80 -
trunk/psModules/src/camera/pmFPAfileIO.c
r9585 r9594 605 605 pmFPAfile *file = item->data.V; 606 606 if (state) { 607 file->state &= NOT_U8(PM_FPA_STATE_INACTIVE);607 file->state &= PS_NOT_U8(PM_FPA_STATE_INACTIVE); 608 608 } else { 609 609 file->state |= PM_FPA_STATE_INACTIVE; … … 625 625 } 626 626 if (state) { 627 file->state &= NOT_U8(PM_FPA_STATE_INACTIVE);627 file->state &= PS_NOT_U8(PM_FPA_STATE_INACTIVE); 628 628 } else { 629 629 file->state |= PM_FPA_STATE_INACTIVE; -
trunk/psModules/src/objects/pmPSFtry.c
r9564 r9594 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 19$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-10-1 4 00:56:37$7 * @version $Revision: 1.20 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-10-17 02:21:03 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 121 121 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PM_MASK_MARK); 122 122 status = pmSourceFitModel (source, model, PM_SOURCE_FIT_EXT); 123 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", NOT_U8(PM_MASK_MARK));123 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", PS_NOT_U8(PM_MASK_MARK)); 124 124 125 125 // exclude the poor fits … … 183 183 184 184 next_source: 185 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", NOT_U8(PM_MASK_MARK));185 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", PS_NOT_U8(PM_MASK_MARK)); 186 186 187 187 } -
trunk/psModules/src/objects/pmSourcePhotometry.c
r9528 r9594 3 3 * @author EAM, IfA; GLG, MHPCC 4 4 * 5 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-10-1 3 02:29:14$5 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-10-17 02:21:03 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 144 144 145 145 // unmask aperture 146 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "AND", NOT_U8(PM_MASK_MARK));146 psImageKeepCircle (source->mask, x, y, model->radiusTMP, "AND", PS_NOT_U8(PM_MASK_MARK)); 147 147 148 148 // subtract object, leave local sky -
trunk/psModules/src/objects/pmSourceSky.c
r8815 r9594 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1. 8$ $Name: not supported by cvs2svn $9 * @date $Date: 2006- 09-15 09:49:01$8 * @version $Revision: 1.9 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-10-17 02:21:03 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 70 70 psStats *myStats = psStatsAlloc(statsOptions); 71 71 myStats = psImageStats(myStats, image, mask, 0xff); 72 psImageMaskRegion(mask, srcRegion, "AND", NOT_U8(PM_MASK_MARK));72 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK)); 73 73 double value = psStatsGetValue(myStats, statistic); 74 74 psFree(myStats); … … 117 117 psStats *myStats = psStatsAlloc(statsOptions); 118 118 myStats = psImageStats(myStats, image, mask, 0xff); 119 psImageMaskRegion(mask, srcRegion, "AND", NOT_U8(PM_MASK_MARK));119 psImageMaskRegion(mask, srcRegion, "AND", PS_NOT_U8(PM_MASK_MARK)); 120 120 double value = psStatsGetValue(myStats, statistic); 121 121 psFree(myStats);
Note:
See TracChangeset
for help on using the changeset viewer.
