Changeset 20426
- Timestamp:
- Oct 27, 2008, 4:10:36 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r20098 r20426 14 14 #define SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \ 15 15 PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources 16 #define FAINT_SOURCE_FRAC 1.0e-4 // Set minimum flux to this fraction of faintest source flux 16 17 17 18 //#define TESTING // Enable debugging output … … 178 179 } 179 180 181 // Generate a fake image to match to 180 182 float minFlux = INFINITY; // Minimum flux for fake image 181 183 { … … 190 192 } 191 193 192 // Generate a fake image to match to 193 if (!isfinite(minFlux)) { 194 float maxMag = -INFINITY; // Maximum magnitude of sources 195 for (int i = 0; i < sources->n; i++) { 196 pmSource *source = sources->data[i]; // Source of interest 197 if (source->psfMag > maxMag && source->psfMag <= MAG_IGNORE && 198 !(source->mode & SOURCE_MASK)) { 199 maxMag = source->psfMag; 200 } 194 float maxMag = -INFINITY; // Maximum magnitude of sources 195 for (int i = 0; i < sources->n; i++) { 196 pmSource *source = sources->data[i]; // Source of interest 197 if (source->psfMag > maxMag && source->psfMag <= MAG_IGNORE && 198 !(source->mode & SOURCE_MASK)) { 199 maxMag = source->psfMag; 201 200 } 202 minFlux = 0.01 * powf(10.0, -0.4 * maxMag);203 }201 } 202 minFlux = PS_MIN(FAINT_SOURCE_FRAC * powf(10.0, -0.4 * maxMag), minFlux); 204 203 205 204 pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout with target PSF … … 266 265 readout->mask = psMemIncrRefCounter(output->mask); 267 266 readout->weight = psMemIncrRefCounter(output->weight); 268 269 readout->analysis = psMetadataCopy(readout->analysis, output->analysis);270 267 } else { 271 268 // Fake the convolution … … 304 301 #endif 305 302 303 readout->analysis = psMetadataCopy(readout->analysis, output->analysis); 304 306 305 // Extract the regions and solutions used in the image matching 307 306 // This stops them from being freed when we iterate back up the FPA … … 359 358 float vf = psMetadataLookupF32(NULL, readout->parent->concepts, "CELL.VARFACTOR"); // Variance factor 360 359 *chi2 /= vf * num; 360 psLogMsg("ppStack", PS_LOG_INFO, "Additional variance from chi^2: %f", *chi2); 361 361 } 362 362
Note:
See TracChangeset
for help on using the changeset viewer.
