IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33540


Ignore:
Timestamp:
Mar 15, 2012, 3:23:29 PM (14 years ago)
Author:
eugene
Message:

do not include bad (NAN) values in the PM fit or high-speed search

Location:
branches/eam_branches/ipp-20111122/Ohana/src/relastro/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/GetAstromError.c

    r33448 r33540  
    3030
    3131  code  = GetPhotcodebyCode (measure[0].photcode);
     32
     33  // do not raise an exception, just send back the result
     34  if (isnan(code[0].astromErrSys)) return NAN;
     35
    3236  AS    = code[0].astromErrScale;
    3337  MS    = code[0].astromErrMagScale;
     
    6872
    6973  code  = GetPhotcodebyCode (measure[0].photcode);
     74
     75  // do not raise an exception, just send back the result
     76  if (isnan(code[0].astromErrSys)) return NAN;
     77
    7078  AS    = code[0].astromErrScale;
    7179  MS    = code[0].astromErrMagScale;
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/UpdateObjects.c

    r33537 r33540  
    131131        dY[N] = GetAstromErrorTiny (&measure[k], ERROR_MODE_DEC);
    132132
    133         // XXX this is a bit hackish -- allow a given photcode or measurement to be
    134         // ignored by ignoring excessively bad errors
    135         if (dX[N] > 10.0) continue;
    136         if (dY[N] > 10.0) continue;
     133        // allow a given photcode or measurement to be
     134        // ignored if the error is NAN (for photcode, set astromErrSys to NaN)
     135        if (isnan(dX[N])) continue;
     136        if (isnan(dY[N])) continue;
    137137
    138138        // add systematic error in quadrature, if desired
  • branches/eam_branches/ipp-20111122/Ohana/src/relastro/src/high_speed_objects.c

    r33537 r33540  
    287287}
    288288
    289 // return TRUE if any measure->photcodes match the photcodeSet
     289// return TRUE if measure->photcode match any in the photcodeSet
     290// (but, return FALSE if the measurement is bad)
    290291int MeasMatchesPhotcode(Measure *measure, PhotCode **photcodeSet, int Nset) {
    291292
    292293  int found, k;
    293294
    294   assert (Nset > 0);
    295 
    296   if (!finite(measure[0].dR) || !finite(measure[0].dD)) return FALSE;
    297   if (!finite(measure[0].M)) return FALSE;
     295  if (!Nset) return TRUE;
     296  // XXX require a set or not?  assert (Nset > 0);
     297
     298  if (!finite(measure[0].dR)) return FALSE;
     299  if (!finite(measure[0].dD)) return FALSE;
     300  if (!finite(measure[0].M))  return FALSE;
    298301 
     302  float dX = GetAstromError (measure, ERROR_MODE_RA);
     303  if (isnan(dX)) return FALSE;
     304
     305  float dY = GetAstromError (measure, ERROR_MODE_DEC);
     306  if (isnan(dY)) return FALSE;
     307
    299308  /* select measurements by photcode, or equiv photcode, if specified */
    300   if (Nset > 0) {
    301     found = FALSE;
    302     for (k = 0; (k < Nset) && !found; k++) {
    303       if (photcodeSet[k][0].code == measure[0].photcode) found = TRUE;
    304       if (photcodeSet[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;
    305     }
    306     if (!found) return FALSE;
    307   }
    308  
    309   return TRUE;
     309  found = FALSE;
     310  for (k = 0; (k < Nset) && !found; k++) {
     311    if (photcodeSet[k][0].code == measure[0].photcode) found = TRUE;
     312    if (photcodeSet[k][0].code == GetPhotcodeEquivCodebyCode(measure[0].photcode)) found = TRUE;
     313  }
     314
     315  return found;
    310316}
Note: See TracChangeset for help on using the changeset viewer.