Changeset 36824
- Timestamp:
- Jun 6, 2014, 8:27:35 PM (12 years ago)
- Location:
- branches/eam_branches/ipp-20140423/Ohana/src
- Files:
-
- 2 edited
-
libdvo/include/dvo.h (modified) (1 diff)
-
relastro/src/UpdateObjects.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20140423/Ohana/src/libdvo/include/dvo.h
r36803 r36824 171 171 ID_STAR_USE_PAR = 0x00200000, // parallax used (not AVE or PM) 172 172 ID_STAR_NO_ASTROM = 0x00400000, // mean astrometry could not be measured 173 ID_STAR_BAD_PM = 0x00800000, // mean astrometry could not be measured 173 174 ID_OBJ_EXT = 0x01000000, // extended in our data (eg, PS) 174 175 ID_OBJ_EXT_ALT = 0x02000000, // extended in external data (eg, 2MASS) -
branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/UpdateObjects.c
r36813 r36824 119 119 fitPAR.chisq = NAN; 120 120 121 // if we fail to fit the astrometry for some reason, we need to set/reset these 122 catalog[i].average[j].flags |= ID_STAR_NO_ASTROM; 123 catalog[i].average[j].ChiSqAve = NAN; 124 catalog[i].average[j].ChiSqPM = NAN; 125 catalog[i].average[j].ChiSqPar = NAN; 126 catalog[i].average[j].Npos = 0; 127 121 128 if (catalog[i].average[j].Nmeasure == 0) { 122 continue;129 continue; 123 130 } 124 131 … … 146 153 } 147 154 155 // reset the bit to note that a detection was used (or not) 156 measure[k].dbFlags &= ~ID_MEAS_USED_OBJ; 157 if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; } 158 148 159 // does the measurement pass the supplied filtering constraints? 149 160 // MeasFilterTestTiny does not test psfQF … … 151 162 int keepMeasure = measureBig ? MeasFilterTest(&measureBig[k], FALSE) : MeasFilterTestTiny(&measure[k], FALSE); 152 163 if (!keepMeasure) { 153 measure[k].dbFlags &= ~ID_MEAS_USED_OBJ;154 if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; }155 164 continue; 156 165 } … … 166 175 double radius = hypot(Xi, Yi); 167 176 if (radius > ExcludeBogusRadius) { 168 measure[k].dbFlags &= ~ID_MEAS_USED_OBJ;169 if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; }170 177 measure[k].dbFlags |= ID_MEAS_POOR_ASTROM; 171 178 if (measureBig) { measureBig[k].dbFlags |= ID_MEAS_POOR_ASTROM; } … … 178 185 // outlier rejection 179 186 if (FALSE && FlagOutlier && (measure[k].dbFlags & ID_MEAS_POOR_ASTROM)) { 180 measure[k].dbFlags &= ~ID_MEAS_USED_OBJ;181 if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; }182 187 continue; 183 188 } 184 185 measure[k].dbFlags |= ID_MEAS_USED_OBJ;186 if (measureBig) { measureBig[k].dbFlags |= ID_MEAS_USED_OBJ; }187 189 188 190 R[N] = getMeanR (&measure[k], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]); … … 199 201 // allow a given photcode or measurement to be 200 202 // ignored if the error is NAN (for photcode, set astromErrSys to NaN) 201 if (isnan(dX[N])) { 202 measure[k].dbFlags &= ~ID_MEAS_USED_OBJ; 203 if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; } 204 continue; 205 } 206 if (isnan(dY[N])) { 207 measure[k].dbFlags &= ~ID_MEAS_USED_OBJ; 208 if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; } 209 continue; 210 } 203 if (isnan(dX[N])) continue; 204 if (isnan(dY[N])) continue; 211 205 212 206 // add systematic error in quadrature, if desired … … 238 232 } 239 233 234 measure[k].dbFlags |= ID_MEAS_USED_OBJ; 235 if (measureBig) { measureBig[k].dbFlags |= ID_MEAS_USED_OBJ; } 236 240 237 N++; 241 } 238 } // loop over measurements : catalog[i].average[j].Nmeasure 242 239 243 240 // if we have too few good detections for the desired fit, or too limited a 244 241 // baseline, use a fit with fewer parameters. XXX if we have too few measurements 245 242 // for even the average position, consider including the lower-quality detections? 246 247 catalog[i].average[j].flags &= ~ID_STAR_NO_ASTROM;248 243 249 244 // find Tmin & Tmax from the list of accepted measurements … … 268 263 // too few measurements for average position (require 2 values) 269 264 if (N < SRC_MEAS_TOOFEW) { 270 // XXX need to define PHOTOM and ASTROM object flags271 // XXX reset the average value fields?272 catalog[i].average[j].flags |= ID_STAR_NO_ASTROM;273 catalog[i].average[j].ChiSqAve = NAN;274 catalog[i].average[j].ChiSqPM = NAN;275 catalog[i].average[j].ChiSqPar = NAN;276 265 if (N < 2) continue; 277 266 } … … 305 294 catalog[i].average[j].flags |= ID_STAR_FIT_PM; 306 295 Npm ++; 296 297 // XXX a hard-wired hack... 298 if ((fabs(fitPM.uR) > 2.0) || (fabs(fitPM.uD) > 2.0)) { 299 mode = FIT_AVERAGE; 300 catalog[i].average[j].flags |= ID_STAR_BAD_PM; 301 } 307 302 } 308 303 … … 331 326 catalog[i].average[j].flags |= ID_STAR_FIT_PAR; 332 327 Npar ++; 328 329 // XXX a hard-wired hack... 330 if ((fabs(fitPAR.uR) > 2.0) || (fabs(fitPAR.uD) > 2.0)) { 331 mode = FIT_AVERAGE; 332 catalog[i].average[j].flags |= ID_STAR_BAD_PM; 333 } 333 334 } else { 334 335 // need to set mode = FIT_PM_ONLY if we do not fit for parallax … … 452 453 catalog[i].average[j].Trange = (Trange * 86400 * 365.25); 453 454 catalog[i].average[j].Npos = fit.Nfit; 455 456 // unset the NO_ASTROM bit (not(NO_ASTROM) == HAVE_ASTROM) 457 catalog[i].average[j].flags &= ~ID_STAR_NO_ASTROM; 458 454 459 if (XVERB) fprintf (stderr, "%f %f -> %f %f (%f,%f) pm=(%f %f) chisq=(%f, %f, %f)\n", 455 460 catalog[i].average[j].R,
Note:
See TracChangeset
for help on using the changeset viewer.
