Changeset 33372
- Timestamp:
- Feb 25, 2012, 8:50:53 PM (14 years ago)
- Location:
- branches/eam_branches/ipp-20111122/Ohana/src/relphot/src
- Files:
-
- 2 edited
-
StarOps.c (modified) (7 diffs)
-
bcatalog.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/StarOps.c
r33364 r33372 76 76 N = 0; 77 77 for (k = 0; k < catalog[i].averageT[j].Nmeasure; k++, m++) { 78 78 79 // skip measurements that do not match the current photcode 79 int ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode); 80 if (ecode != thisCode) { continue; } 80 PhotCode *code = GetPhotcodebyCode (catalog[i].measureT[m].photcode); 81 if (!code) continue; 82 if (code->equiv != thisCode) { continue; } 83 84 // int ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode); 85 // if (ecode != thisCode) { continue; } 81 86 82 87 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) { … … 114 119 } 115 120 list[N] = Msys - Mcal - Mmos - Mgrid; 116 dlist[N] = MAX (catalog[i].measureT[m].dM, MIN_ERROR); 121 122 // dlist gives the error, which is used as the weight in WT_MEAN. 123 // we can modify the resulting weight in a few ways: 124 // 1) MIN_ERROR guarantees a floor 125 // 2) photomErrSys is added in quadrature as a sytematic error, set per photcode 126 // 3) UBERCAL measurements can have their weight increased by a big factor to help tie down the averages 127 // 4) some reference photcode of some kind can be specified as fixed and have a high weight 128 dlist[N] = MAX (hypot(catalog[i].measureT[m].dM, code->photomErrSys), MIN_ERROR); 117 129 118 130 // up-weight the ubercal values (or convergence can take a long time...) … … 122 134 123 135 // tie down reference photometry if the -refcode (code) option is selected 124 // XXX re-think this... 136 // eg, -refcode g_SDSS 137 // this probably makes no sense in the context of multifilter analysis 125 138 if (refPhotcode) { 126 if (GetPhotcodeEquivCodebyCode(catalog[i].measureT[m].photcode) == refPhotcode[0].equiv) { 127 // increase the weight by a factor of 100: 128 dlist[N] = 0.01*catalog[i].measureT[m].dM; 139 if (code->code == refPhotcode->code) { 140 // tiny error -> large weight 141 // dlist[N] = MAX (0.01*catalog[i].measureT[m].dM, MIN_ERROR); 142 dlist[N] = 0.0001; 129 143 } 130 144 } … … 157 171 // * setMrelOutput skips stars for which there are too few good measurements 158 172 // * setMrelOutput is meant to be called repeatedly, relaxing the criteria for 'good' on each pass 173 174 // setMave is also similar to the above. but: 175 // * setMave is called by relphot -update-objects 176 // * setMave includes PSF_QF tests 177 // * setMave updates 2MASS average flags 178 // * setMave updates average EXT flags (PS1 and 2MASS) 159 179 int setMrelOutput (Catalog *catalog, int Ncatalog, int mark, FlatCorrectionTable *flatcorr) { 160 180 … … 164 184 double *list, *dlist; 165 185 StatType stats; 166 int Nsec, Nsecfilt,ecode;167 168 Nsecfilt = GetPhotcodeNsecfilt ();186 int Nsec, ecode; 187 188 int Nsecfilt = GetPhotcodeNsecfilt (); 169 189 170 190 /* Nmeasure is now different, need to reallocate */ … … 193 213 m = catalog[i].averageT[j].measureOffset; 194 214 for (k = 0; k < catalog[i].averageT[j].Nmeasure; k++, m++) { 215 195 216 // skip measurements that do not match the current photcode 196 ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode); 197 if (ecode != thisCode) { continue; } 217 PhotCode *code = GetPhotcodebyCode (catalog[i].measureT[m].photcode); 218 if (!code) continue; 219 if (code->equiv != thisCode) { continue; } 220 221 // ecode = GetPhotcodeEquivCodebyCode (catalog[i].measureT[m].photcode); 222 // if (ecode != thisCode) { continue; } 198 223 199 224 if (catalog[i].measureT[m].dbFlags & MEAS_BAD) continue; … … 215 240 Msys = PhotSysTiny (&catalog[i].measureT[m], &catalog[i].averageT[j], &catalog[i].secfilt[j*Nsecfilt]); 216 241 list[N] = Msys - Mcal - Mmos - Mgrid; 217 dlist[N] = MAX (catalog[i].measureT[m].dM, MIN_ERROR); 242 243 // dlist gives the error, which is used as the weight in WT_MEAN. 244 // we can modify the resulting weight in a few ways: 245 // 1) MIN_ERROR guarantees a floor 246 // 2) photomErrSys is added in quadrature as a sytematic error, set per photcode 247 // 3) UBERCAL measurements can have their weight increased by a big factor to help tie down the averages 248 // 4) some reference photcode of some kind can be specified as fixed and have a high weight 249 dlist[N] = MAX (hypot(catalog[i].measureT[m].dM, code->photomErrSys), MIN_ERROR); 250 251 // up-weight the ubercal values (or convergence can take a long time...) 252 if (catalog[i].measureT[m].dbFlags & ID_MEAS_PHOTOM_UBERCAL) { 253 dlist[N] = MAX (0.1*catalog[i].measureT[m].dM, MIN_ERROR); 254 } 255 256 // tie down reference photometry if the -refcode (code) option is selected 257 // eg, -refcode g_SDSS 258 // this probably makes no sense in the context of multifilter analysis 259 if (refPhotcode) { 260 if (code->code == refPhotcode->code) { 261 // tiny error -> large weight 262 // dlist[N] = MAX (0.01*catalog[i].measureT[m].dM, MIN_ERROR); 263 dlist[N] = 0.0001; 264 } 265 } 218 266 N++; 219 267 } -
branches/eam_branches/ipp-20111122/Ohana/src/relphot/src/bcatalog.c
r33364 r33372 62 62 subcatalog[0].filename = catalog[0].filename; 63 63 64 // flags used by the photometry analysis (excluding UBERCAL) 65 unsigned int PHOTOM_FLAGS = 66 ID_MEAS_NOCAL | // detection ignored for this analysis (photcode, time range) 67 ID_MEAS_POOR_PHOTOM | // detection is photometry outlier 68 ID_MEAS_SKIP_PHOTOM | // detection was ignored for photometry measurement 69 ID_MEAS_AREA; // detetion was outside acceptable area of device 70 64 71 /* exclude stars not in range or with too few measurements */ 65 72 for (i = 0; i < catalog[0].Naverage; i++) { … … 74 81 } 75 82 83 // reset the calculated average magnitudes (does not affect ubercal-tied measurements or images) 76 84 if (RESET) { 77 85 int Ns; … … 147 155 subcatalog[0].measureT[Nmeasure].averef = Naverage; 148 156 if (RESET) { 149 subcatalog[0].measureT[Nmeasure].Mcal = 0;150 subcatalog[0].measureT[Nmeasure].dbFlags &= 0xff00;151 subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_POOR_PHOTOM;152 subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_AREA;153 subcatalog[0].measureT[Nmeasure].dbFlags &= ~ ID_MEAS_NOCAL;157 if (!KEEP_UBERCAL) { 158 subcatalog[0].measureT[Nmeasure].Mcal = 0; 159 subcatalog[0].measureT[Nmeasure].dbFlags &= ~ID_MEAS_PHOTOM_UBERCAL; 160 } 161 subcatalog[0].measureT[Nmeasure].dbFlags &= ~PHOTOM_FLAGS; 154 162 } 155 163 Nmeasure ++;
Note:
See TracChangeset
for help on using the changeset viewer.
