IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30477


Ignore:
Timestamp:
Feb 3, 2011, 9:33:50 AM (15 years ago)
Author:
eugene
Message:

use real astrometry error model based on fields in photcode table

File:
1 edited

Legend:

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

    r29938 r30477  
    11# include "relastro.h"
     2# define WEIGHTED_ERRORS 0
    23
    34float GetAstromError (Measure *measure, int mode) {
    4   //BIG HACKXXXXXXXX
    5   return 0.1;
     5
    66  PhotCode *code;
    7   float dPobs, dPsys, dPtotal, dM, AS, MS;
     7  float dPobs, dPsys, dPtotal, dM, AS, MS, dX, dY;
     8
     9  if (!WEIGHTED_ERRORS) {
     10    // if we don't understand the errors at all, this at least lets us get things roughly
     11    // right:
     12    return 0.1;
     13  }
     14
    815  switch (mode) {
    916    case ERROR_MODE_RA:
    10       dPobs = measure[0].dXccd / 100.0;  // need to redefine this as RAerr
     17      dPobs = FromShortPixels(measure[0].dXccd);  // dXccd is a value in pixels
    1118      break;
    1219    case ERROR_MODE_DEC:
    13       dPobs = measure[0].dYccd / 100.0;  // need to redefine this as RAerr
     20      dPobs = FromShortPixels(measure[0].dYccd);  // dYccd is a value in pixels
    1421      break;
    1522    case ERROR_MODE_POS:
    16       dPobs = hypot (measure[0].dXccd, measure[0].dYccd) / 100.0;  // need to redefine this as RAerr
     23      dX = FromShortPixels(measure[0].dXccd);  // dXccd is a value in pixels
     24      dY = FromShortPixels(measure[0].dYccd);  // dYccd is a value in pixels
     25      dPobs = hypot (dX, dY);
    1726      break;
    1827    default:
    1928      abort();
    2029  }
    21   /* the astrometric errors are not being carried yet (but should be!) */
    22   /* we use the photometric mag error as a weighting term */
    2330
    2431  code  = GetPhotcodebyCode (measure[0].photcode);
     
    2734  dPsys = code[0].astromErrSys;
    2835  dM    = measure[0].dM;
    29   dPtotal = sqrt(SQ(dPsys) + AS*SQ(dPobs) + MS*SQ(dM));
    30 
    31   //XXX dXccd, dYccd are now working correctly
    32   //dPtotal = AS * dPobs;
     36  dPtotal = sqrt(SQ(dPsys) + SQ(AS*dPobs) + SQ(MS*dM));
    3337
    3438  dPtotal = MAX (dPtotal, MIN_ERROR);
     
    3640}
    3741
     42/* for a long time, psphot was either not reported position errors, or was reporting
     43 * completely wrong astrometry errors.  This function lets us handle, in the
     44 * configuration, different strategies to generating a position error
     45 *
     46 * astrometry systematic error : this is the minimum expected per-position error.  You
     47 * should probably measure this from you data.  watch out for the chicken and egg problem!
     48 *
     49 * astrometry error scale : this field lets you accept position errors in (say) pixels and
     50 * convert them with this term to arcsec.  AS : pixel scale in arcsec
     51 *
     52 * astrometry mag scale : this field lets you define position errors based on the
     53 * photometry error.  the scale factor should be something like a typical seeing number
     54 * (in arcsec) for the given instrument
     55 *
     56 */
Note: See TracChangeset for help on using the changeset viewer.