Changeset 30477
- Timestamp:
- Feb 3, 2011, 9:33:50 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/Ohana/src/relastro/src/GetAstromError.c
r29938 r30477 1 1 # include "relastro.h" 2 # define WEIGHTED_ERRORS 0 2 3 3 4 float GetAstromError (Measure *measure, int mode) { 4 //BIG HACKXXXXXXXX 5 return 0.1; 5 6 6 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 8 15 switch (mode) { 9 16 case ERROR_MODE_RA: 10 dPobs = measure[0].dXccd / 100.0; // need to redefine this as RAerr17 dPobs = FromShortPixels(measure[0].dXccd); // dXccd is a value in pixels 11 18 break; 12 19 case ERROR_MODE_DEC: 13 dPobs = measure[0].dYccd / 100.0; // need to redefine this as RAerr20 dPobs = FromShortPixels(measure[0].dYccd); // dYccd is a value in pixels 14 21 break; 15 22 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); 17 26 break; 18 27 default: 19 28 abort(); 20 29 } 21 /* the astrometric errors are not being carried yet (but should be!) */22 /* we use the photometric mag error as a weighting term */23 30 24 31 code = GetPhotcodebyCode (measure[0].photcode); … … 27 34 dPsys = code[0].astromErrSys; 28 35 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)); 33 37 34 38 dPtotal = MAX (dPtotal, MIN_ERROR); … … 36 40 } 37 41 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.
