IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36824


Ignore:
Timestamp:
Jun 6, 2014, 8:27:35 PM (12 years ago)
Author:
eugene
Message:

add object flag for bad proper motion fits (and skip them); better flagging for ID_MEAS_USED_OBJ

Location:
branches/eam_branches/ipp-20140423/Ohana/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20140423/Ohana/src/libdvo/include/dvo.h

    r36803 r36824  
    171171  ID_STAR_USE_PAR   = 0x00200000, // parallax used (not AVE or PM)
    172172  ID_STAR_NO_ASTROM = 0x00400000, // mean astrometry could not be measured
     173  ID_STAR_BAD_PM    = 0x00800000, // mean astrometry could not be measured
    173174  ID_OBJ_EXT        = 0x01000000, // extended in our data (eg, PS)
    174175  ID_OBJ_EXT_ALT    = 0x02000000, // extended in external data (eg, 2MASS)
  • branches/eam_branches/ipp-20140423/Ohana/src/relastro/src/UpdateObjects.c

    r36813 r36824  
    119119      fitPAR.chisq = NAN;
    120120
     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
    121128      if (catalog[i].average[j].Nmeasure == 0) {
    122           continue;
     129        continue;
    123130      }
    124131
     
    146153        }
    147154
     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
    148159        // does the measurement pass the supplied filtering constraints?
    149160        // MeasFilterTestTiny does not test psfQF
     
    151162        int keepMeasure = measureBig ? MeasFilterTest(&measureBig[k], FALSE) : MeasFilterTestTiny(&measure[k], FALSE);
    152163        if (!keepMeasure) {
    153           measure[k].dbFlags &= ~ID_MEAS_USED_OBJ;
    154           if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; }
    155164          continue;
    156165        }
     
    166175          double radius = hypot(Xi, Yi);
    167176          if (radius > ExcludeBogusRadius) {
    168               measure[k].dbFlags &= ~ID_MEAS_USED_OBJ;
    169               if (measureBig) { measureBig[k].dbFlags &= ~ID_MEAS_USED_OBJ; }
    170177              measure[k].dbFlags |= ID_MEAS_POOR_ASTROM;
    171178              if (measureBig) { measureBig[k].dbFlags |= ID_MEAS_POOR_ASTROM; }
     
    178185        // outlier rejection
    179186        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; }
    182187          continue;
    183188        }
    184 
    185         measure[k].dbFlags |= ID_MEAS_USED_OBJ;
    186         if (measureBig) { measureBig[k].dbFlags |= ID_MEAS_USED_OBJ; }
    187189
    188190        R[N] = getMeanR (&measure[k], &catalog[i].average[j], &catalog[i].secfilt[j*Nsecfilt]);
     
    199201        // allow a given photcode or measurement to be
    200202        // 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;
    211205
    212206        // add systematic error in quadrature, if desired
     
    238232        }
    239233
     234        measure[k].dbFlags |= ID_MEAS_USED_OBJ;
     235        if (measureBig) { measureBig[k].dbFlags |= ID_MEAS_USED_OBJ; }
     236
    240237        N++;
    241       }
     238      } // loop over measurements : catalog[i].average[j].Nmeasure
    242239
    243240      // if we have too few good detections for the desired fit, or too limited a
    244241      // baseline, use a fit with fewer parameters.  XXX if we have too few measurements
    245242      // for even the average position, consider including the lower-quality detections?
    246 
    247       catalog[i].average[j].flags &= ~ID_STAR_NO_ASTROM;
    248243
    249244      // find Tmin & Tmax from the list of accepted measurements
     
    268263      // too few measurements for average position (require 2 values)
    269264      if (N < SRC_MEAS_TOOFEW) {
    270         // XXX need to define PHOTOM and ASTROM object flags
    271         // 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;
    276265        if (N < 2) continue;
    277266      }
     
    305294        catalog[i].average[j].flags |= ID_STAR_FIT_PM;
    306295        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        }
    307302      }
    308303
     
    331326          catalog[i].average[j].flags |= ID_STAR_FIT_PAR;
    332327          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          }
    333334        } else {
    334335          // need to set mode = FIT_PM_ONLY if we do not fit for parallax
     
    452453      catalog[i].average[j].Trange = (Trange * 86400 * 365.25);
    453454      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
    454459      if (XVERB) fprintf (stderr, "%f %f -> %f %f (%f,%f) pm=(%f %f) chisq=(%f, %f, %f)\n",
    455460                          catalog[i].average[j].R,
Note: See TracChangeset for help on using the changeset viewer.