Bug in magnetic declination from compass data

Philip Balister balister@vt.edu
Sat, 22 Mar 2003 12:46:11 -0500


I have been dorking around with the compass file reading code. I think the
problem is that survex wants to store angles in radians and when it read
the compass declination information, it didn't convert to radians. So
everything works if the declination is zero. If not, weird poop happens.

I made the following change and things seem better:

       /* DECLINATION: 1.00  FORMAT: DDDDLUDRADLN  CORRECTIONS: 2.00 3.00 4.00 */
         get_token();
         nextch(); /* : */
         skipblanks();
         pcs->z[Q_DECLINATION] = -read_numeric(fFalse, NULL) * pcs->units[Q_DECLINATION];
printf("Declination: %f  Units: %f\n", pcs->z[Q_DECLINATION], pcs->units[Q_DECLINATION]);

This was done without really figuring out what is really going on and
application of trial and error methodology. Can someone that really know
what is going confirm I am doing the "right thing" (TM).

Thanks,

Philip