Changeset 38466 for trunk/Ohana/src/relphot/src/setMrelFinal.c
- Timestamp:
- Jun 12, 2015, 10:28:36 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/relphot/src/setMrelFinal.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/relphot/src/setMrelFinal.c
r37037 r38466 12 12 int Nsecfilt = GetPhotcodeNsecfilt (); 13 13 14 /* if we reset the catalog, reset all the current measurements*/14 /*** RESET photometry flags and Mcal values ***/ 15 15 if (RESET) { 16 16 // flags used by the photometry analysis (excluding UBERCAL) … … 46 46 for (i = 0; i < catalog[0].Naverage; i++) { 47 47 off_t N = Nsecfilt*i+Nsec; 48 dvo_secfilt_init (&catalog[0].secfilt[N] );48 dvo_secfilt_init (&catalog[0].secfilt[N], SECFILT_RESET_ALL); 49 49 50 50 off_t m = catalog[0].average[i].measureOffset; … … 100 100 // XXX make this optional? (do not clean for -averages?) 101 101 if (!simpleAverage) clean_measures (catalog, 1, TRUE, flatcorr); /* mark outliers ID_MEAS_POOR_PHOTOM */ 102 for (i = 0; i < 5; i++) { 103 skip_measurements (catalog, i, flatcorr); /* set ID_MEAS_SKIP for measures to be skipped */104 setMrelOutput (catalog, 1, i, flatcorr); /* set Mrel using remaining measures */105 }102 103 ALLOCATE (catalog[0].measureRank, char, catalog[0].Nmeasure); 104 setMeasureRank (catalog); 105 setMrelOutput (catalog, 1, flatcorr); 106 106 if (!simpleAverage) setMcalOutput (catalog, 1, flatcorr); 107 107 … … 267 267 } 268 268 269 /* dophot types: 270 271 1 - star 272 2 - galaxy 273 3 - star 274 4 - weak 275 5 - edge 276 7 - weak 277 9 - weak 278 10 - sat 279 */ 280 269 void setMeasureRank (Catalog *catalog) { 270 271 int i; 272 273 // make these global 274 int IMAGE_BAD = ID_IMAGE_PHOTOM_NOCAL; 275 int IMAGE_POOR = ID_IMAGE_PHOTOM_POOR | ID_IMAGE_PHOTOM_FEW | ID_IMAGE_PHOTOM_SKIP; 276 int MEAS_BAD = ID_MEAS_NOCAL | ID_MEAS_SKIP_PHOTOM; 277 int MEAS_POOR = ID_MEAS_POOR_PHOTOM | ID_MEAS_AREA; 278 279 Measure *measure = catalog[0].measure; 280 MeasureTiny *measureT = catalog[0].measureT; 281 char *measureRank = catalog[0].measureRank; 282 283 /* set measureRank[] based on various quality measurements */ 284 for (i = 0; i < catalog[0].Nmeasure; i++) { 285 measureRank[i] = 11; // start at a low rank 286 287 // clear SKIP for all measures at first 288 measureT[i].dbFlags &= ~ID_MEAS_SKIP_PHOTOM; 289 measure [i].dbFlags &= ~ID_MEAS_SKIP_PHOTOM; 290 291 // skip measurements without a valid photcode 292 PhotCode *code = GetPhotcodebyCode (measure[i].photcode); 293 if (!code) continue; 294 295 // measurements outside time range have poor rank 296 if (TimeSelect) { 297 if (measure[i].t < TSTART) { measureRank[i] = 10; continue; } 298 if (measure[i].t > TSTOP) { measureRank[i] = 10; continue; } 299 } 300 301 // measurements from BAD images and mosaics (not REF mags) 302 off_t Nim = getImageEntry (i, 0); 303 int imageFlags = getImageFlags (i, 0); 304 int mosaicFlags = getMosaicFlags (i, 0); 305 306 if (Nim > -1) { 307 if (imageFlags & IMAGE_BAD) { measureRank[i] = 9; continue; } 308 309 if (mosaicFlags & IMAGE_BAD) { measureRank[i] = 9; continue; } 310 311 // measurements ranked by inst mag limit (not REF mags) 312 if (ImagSelect) { 313 float mag = PhotInst (&measure[i], MAG_CLASS_PSF); 314 if (mag < ImagMin) { measureRank[i] = 8; continue; } 315 if (mag > ImagMax) { measureRank[i] = 8; continue; } 316 } 317 } 318 319 // RANK 1 : BAD photFlags 320 if (measure[i].dbFlags & MEAS_BAD) { measureRank[i] = 7; continue; } 321 322 // RANK 3 : BAD photFlags (eg, SAT, CR), internal outliers 323 if (measure[i].photFlags & code->photomBadMask) { measureRank[i] = 6; continue; } 324 325 if (Nim > -1) { 326 if (imageFlags & IMAGE_POOR) { measureRank[i] = 5; continue; } 327 if (mosaicFlags & IMAGE_POOR) { measureRank[i] = 5; continue; } 328 } 329 330 // RANK 2 : psfQF value 331 if (!isfinite(measure[i].psfQF) || measure[i].psfQF < 0.85) { measureRank[i] = 4; continue; } 332 333 // RANK 1 : POOR photFlags 334 if (measure[i].dbFlags & MEAS_POOR) { measureRank[i] = 3; continue; } 335 336 // RANK 1 : POOR photFlags 337 if (measure[i].photFlags & code->photomPoorMask) { measureRank[i] = 2; continue; } 338 339 // RANK 1 : psfQFperfect value 340 if (!isfinite(measure[i].psfQFperf) || measure[i].psfQFperf < 0.85) { measureRank[i] = 1; continue; } 341 342 // RANK 0 : perfect measurement: 343 measureRank[i] = 0; 344 } 345 }
Note:
See TracChangeset
for help on using the changeset viewer.
