IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 16787


Ignore:
Timestamp:
Mar 2, 2008, 2:26:47 PM (18 years ago)
Author:
eugene
Message:

more generic error model, use external function to calculate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20080223/Ohana/src/relastro/src/UpdateObjects.c

    r16633 r16787  
    3838
    3939
     40enum {ERROR_MODE_RA, ERROR_MODE_DEC};
     41
     42float GetAstromError (Measure *measure, int mode) {
     43
     44  PhotCode *code;
     45  float dPobs, dPsys, dPtotal, dM, AS, MS;
     46
     47  switch (mode) {
     48    case ERROR_MODE_RA:
     49      dPobs = measure[0].dXccd;  // need to redefine this as RAerr
     50      break;
     51    case ERROR_MODE_DEC:
     52      dPobs = measure[0].dYccd;  // need to redefine this as RAerr
     53      break;
     54    default:
     55      abort();
     56  }
     57
     58  /* the astrometric errors are not being carried yet (but should be!) */
     59  /* we use the photometric mag error as a weighting term */
     60
     61  code  = GetPhotcodebyCode (measure[0].photcode);
     62  AS    = code[0].astromErrScale;
     63  MS    = code[0].astromErrMagScale;
     64  dPsys = code[0].astromErrSys;
     65  dM    = measure[0].dM;
     66 
     67  dPtotal = sqrt(SQ(dPsys) + AS*SQ(dPobs) + MS*SQ(dM));
     68  dPtotal = MAX (dPtotal, MIN_ERROR);
     69
     70  return (dPtotal);
     71}
     72
    4073int UpdateObjects (Catalog *catalog, int Ncatalog) {
    4174
     
    4881  double Tmin, Tmax;
    4982  float errorScale;
    50   PhotCode *code;
    5183
    5284  initObjectData (catalog, Ncatalog);
     
    96128        Tmax = MAX(Tmax, T[N]);
    97129
    98         /* the astrometric errors are not being carried yet (but should be!) */
    99         /* we use the photometric mag error as a weighting term */
    100 
    101         code = GetPhotcodebyCode (catalog[0].measure[m].photcode);
    102         errorScale = code[0].astromScale;
    103         dR[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR) * errorScale;
    104         dD[N] = MAX (catalog[i].measure[m].dM, MIN_ERROR) * errorScale;
     130        dR[N] = GetAstromError (&catalog[i].measure[m], ERROR_MODE_RA);
     131        dD[N] = GetAstromError (&catalog[i].measure[m], ERROR_MODE_DEC);
    105132        dT[N] = catalog[i].measure[m].dt;
    106133
Note: See TracChangeset for help on using the changeset viewer.