- Timestamp:
- Feb 19, 2011, 10:29:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/ppStack/src/ppStackPrepare.c
r30620 r30702 1 #include "ppStack.h" 2 3 #define PHOT_SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_SATSTAR | PM_SOURCE_MODE_BLEND | \ 4 PM_SOURCE_MODE_BADPSF | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \ 5 PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_EXT_LIMIT) // Mask to apply to sources 1 # include "ppStack.h" 2 3 # define RE_PHOTOMETER 0 4 5 # define PHOT_SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_SATSTAR | PM_SOURCE_MODE_BLEND | \ 6 PM_SOURCE_MODE_BADPSF | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \ 7 PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_EXT_LIMIT) // Mask to apply to sources 6 8 7 9 bool ppStackInputPhotometer(const pmReadout *ro, const psArray *sources, const pmConfig *config) … … 13 15 psAssert(recipe, "We've thrown an error on this before."); 14 16 17 # if (RE_PHOTOMETER) 15 18 bool mdok; // Status of MD lookup 16 19 … … 38 41 psImageMaskType maskVal = pmConfigMaskGet(maskValStr, config); // Bits to mask 39 42 43 // Measure background 40 44 psImage *image = ro->image, *mask = ro->mask; // Image and mask from readout 41 42 // Measure background43 45 psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator 44 46 psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics … … 52 54 psFree(stats); 53 55 psFree(rng); 54 55 // Photometer sources 56 int numCols = image->numCols, numRows = image->numRows; // Size of image56 # endif 57 58 // Examine the sources (photometer if RE_PHOTOMETER is set) 57 59 int numSources = sources->n; // Number of sources 58 60 int numGood = 0; // Number of good sources … … 64 66 continue; 65 67 } 66 float x = source->peak->xf, y = source->peak->yf; // Coordinates of source 68 69 // This code re-measures the magnitude in the assumption that the warp analysis failed It would 70 // be better to catch and correct such cases. In any case, we should check on the validity of 71 // this assumption (eg, compare the mean psf-ap offset) and raise an error on that? 72 73 # if (RE_PHOTOMETER) 74 75 int numCols = image->numCols, numRows = image->numRows; // Size of image 76 float x = source->peak->xf, y = source->peak->yf; // Coordinates of source 67 77 int xCentral = x + 0.5, yCentral = y + 0.5; // Central pixel 68 78 // Range of integration … … 96 106 } 97 107 } 108 # else 109 numGood++; 110 maxMag = PS_MAX(maxMag, source->psfMag); 111 # endif 98 112 } 99 113 psLogMsg("ppStack", PS_LOG_INFO, "Photometered %d good sources in image; max mag %f", numGood, maxMag);
Note:
See TracChangeset
for help on using the changeset viewer.
