Changeset 33373
- Timestamp:
- Feb 26, 2012, 12:32:46 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/relphot/src
- Files:
-
- 2 edited
-
StarOps.c (modified) (9 diffs)
-
setMrelFinal.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c
r33372 r33373 68 68 int Nsec = GetPhotcodeNsec(thisCode); 69 69 70 /* calculate the average value for a single star */70 /* calculate the average mag in this SEC photcode for a single star */ 71 71 72 72 // skip bad stars 73 73 if (catalog[i].secfilt[Nsecfilt*j+Nsec].flags & STAR_BAD) continue; 74 75 N = 0; 74 76 m = catalog[i].averageT[j].measureOffset; 75 76 N = 0;77 77 for (k = 0; k < catalog[i].averageT[j].Nmeasure; k++, m++) { 78 78 … … 82 82 if (code->equiv != thisCode) { continue; } 83 83 84 // int ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode); 85 // if (ecode != thisCode) { continue; } 86 87 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) { 88 Nbad ++; 89 continue; 90 } 91 92 // XXX allow REF stars (no Image Entry) to be included in the calculation this 93 // should be optionally set, and should allow for REF stars to be downweighted by 94 // more than their reported errors. how such info is carried is unclear... 84 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) { Nbad ++; continue; } 85 95 86 if (getImageEntry (m, i) < 0) { 96 87 Mcal = Mmos = Mgrid = 0; 97 88 } else { 98 89 Mcal = getMcal (m, i, flatcorr, catalog); 99 if (isnan(Mcal)) { 100 Ncal ++; 101 continue; 102 } 90 if (isnan(Mcal)) { Ncal ++; continue; } 103 91 Mmos = getMmos (m, i); 104 if (isnan(Mmos)) { 105 Nmos ++; 106 continue; 107 } 92 if (isnan(Mmos)) { Nmos ++; continue; } 108 93 Mgrid = getMgrid (m, i); 109 if (isnan(Mgrid)) { 110 Ngrid++; 111 continue; 112 } 94 if (isnan(Mgrid)) { Ngrid++; continue; } 113 95 } 114 96 … … 184 166 double *list, *dlist; 185 167 StatType stats; 186 int Nsec , ecode;168 int Nsec; 187 169 188 170 int Nsecfilt = GetPhotcodeNsecfilt (); … … 201 183 for (j = 0; j < catalog[i].Naverage; j++) { 202 184 203 /* skip stars already calibrated */204 if (catalog[i].found[j]) continue;205 206 185 int Ns; 207 186 for (Ns = 0; Ns < Nphotcodes; Ns++) { … … 209 188 int thisCode = photcodes[Ns][0].code; 210 189 Nsec = GetPhotcodeNsec(thisCode); 190 191 /* star/photcodes already calibrated */ 192 if (catalog[i].found[Nsecfilt*j+Nsec]) continue; 211 193 212 194 N = 0; … … 218 200 if (!code) continue; 219 201 if (code->equiv != thisCode) { continue; } 220 221 // ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode);222 // if (ecode != thisCode) { continue; }223 202 224 203 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; … … 249 228 dlist[N] = MAX (hypot(catalog[i].measureT[m].dM, code->photomErrSys), MIN_ERROR); 250 229 251 // up-weight the ubercal values (or convergence can take a long time...) 230 // up-weight the ubercal values (or convergence can take a long time...) (XXX make this optional?) 252 231 if (catalog[i].measureT[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 253 232 dlist[N] = MAX (0.1*catalog[i].measureT[m].dM, MIN_ERROR); … … 269 248 270 249 liststats (list, dlist, N, &stats); 271 if (mark) catalog[i].found[ j] = TRUE;250 if (mark) catalog[i].found[Nsecfilt*j+Nsec] = TRUE; 272 251 273 252 /* use sigma or error in dM for output? */ … … 578 557 if (ecode != thisCode) { continue; } 579 558 559 // why am I skipping this?? 580 560 /* if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; */ 581 561 Mcal = getMcal (m, i, flatcorr, catalog); -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/setMrelFinal.c
r33364 r33373 10 10 int ecode; 11 11 12 int Nsecfilt = GetPhotcodeNsecfilt (); 13 12 14 /* if we reset the catalog, reset all the current measurements */ 13 15 if (RESET) { 14 15 int Nsecfilt = GetPhotcodeNsecfilt (); 16 16 // flags used by the photometry analysis (excluding UBERCAL) 17 unsigned int PHOTOM_FLAGS = 18 ID_MEAS_NOCAL | // detection ignored for this analysis (photcode, time range) 19 ID_MEAS_POOR_PHOTOM | // detection is photometry outlier 20 ID_MEAS_SKIP_PHOTOM | // detection was ignored for photometry measurement 21 ID_MEAS_AREA; // detetion was outside acceptable area of device 22 17 23 int Ns; 18 24 for (Ns = 0; Ns < Nphotcodes; Ns++) { … … 39 45 } 40 46 41 catalog[0].measure[m].Mcal = 0; 42 catalog[0].measure[m].dbFlags &= 0xff00; 43 catalog[0].measure[m].dbFlags &= ~ID_MEAS_POOR_PHOTOM; 44 catalog[0].measure[m].dbFlags &= ~ID_MEAS_SKIP_PHOTOM; 45 catalog[0].measure[m].dbFlags &= ~ID_MEAS_AREA; 46 catalog[0].measure[m].dbFlags &= ~ID_MEAS_NOCAL; 47 if (!KEEP_UBERCAL) { 48 catalog[0].measure[m].Mcal = 0; 49 catalog[0].measure[m].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 50 } 51 catalog[0].measure[m].dbFlags &= ~PHOTOM_FLAGS; 47 52 } 48 53 } … … 54 59 55 60 /* set catalog[0].found[i] = FALSE */ 56 ALLOCATE (catalog[0].found, off_t, MAX (1, catalog[0].Naverage));57 for (i = 0; i < catalog[0].Naverage; i++) {61 ALLOCATE (catalog[0].found, off_t, MAX (1, Nsecfilt*catalog[0].Naverage)); 62 for (i = 0; i < Nsecfilt*catalog[0].Naverage; i++) { 58 63 catalog[0].found[i] = FALSE; 59 64 } … … 86 91 87 92 /* ID_MEAS_SKIP marks measurements which were not used to calculate Mrel */ 93 // For each star & photcode, we are selecting the measurements to use in the average 94 // photometry value. This function is called several times, lowering the bar to 95 // acceptance on each pass. The rejections at the different passes are: 96 97 // 0 : only use measurements thought to be not extended and dM < SIGMA_LIM (REMOVED) 98 // 1 : use extended and low-sig detections (REMOVED) 99 // 3 : accept the measurements marked as outliers; accept images marked as outliers 100 // 4 : accept the measurements outside of the instrumental magnitude limits (eg, SAT) 101 102 // XXX if I'm reading this correctly, passes 0, 1, 2 are identical & accept all 103 // non-outliers with Imag range 104 88 105 void skip_measurements (Catalog *catalog, int pass, FlatCorrectionTable *flatcorr) { 89 106 … … 104 121 for (i = 0; i < catalog[0].Naverage; i++) { 105 122 Ntot += catalog[0].average[i].Nmeasure; 123 124 // this function does not check secfilt entries separately, but there is no harm in 125 // twiddling the so skip a star here only we can only 126 // have we gotten 127 106 128 if (catalog[0].found[i]) continue; 129 XXX : this should be done by secfilt. think about this... 107 130 108 131 m = catalog[0].average[i].measureOffset;
Note:
See TracChangeset
for help on using the changeset viewer.
