[Therion] Wrong average calculation from compass/backcompass data

Evaristo Quiroga eqr at ecgracia.com
Wed May 16 16:45:54 CEST 2018


I think Therion subtract the magnetic declination before to transfer 
data Survex. Now to compare better I have put magnetic declination to 0.

> declination 0.00 degrees



Data transferred to Survex by the "data.svx" file
> *data    normal    from    to    tape  compass    clino
>     1    2    0.000000    269.423853    0.000000
>     1    3    2.330000    236.223853    -11.400000
>     3    4    4.510000    162.623853    -32.200000
>     4    5    12.410000    0.923853    -77.700000
>     5    6    1.950000    212.073853    -17.150000
>

>
> You can see Therion do a wrong fore/back sight compass average 
> calculation. The good data average are:
>
> 1     3    236.8     -11.4
>
> 3    4    163.2    -32
>
> 4    5    1.5        -77.7
>
> 5    6    212.65    -17.15

I think the problem is the average calculation formula in "thdb1d.cxx"

> // check backwards compass reading
>             if ((lei->data_type == TT_DATATYPE_NORMAL) ||
>                 (lei->data_type == TT_DATATYPE_DIVING) ||
>                 (lei->data_type == TT_DATATYPE_CYLPOLAR)) {
>                 if (!thisnan(lei->backbearing)) {
>                 if (thisnan(lei->bearing)) {
>                   lei->backbearing -= 180.0;
>                   if (lei->backbearing < 0)
>                     lei->backbearing += 360.0;
>                   lei->bearing = lei->backbearing;
>                 }
>                 else {
>                   lei->backbearing -= 180.0;
>                   if (lei->backbearing < 0)
>                     lei->backbearing += 360.0;
>                                     // calculate average of two angles
>                   //lei->bearing += lei->backbearing;
>                   //lei->bearing = lei->bearing / 2.0;
>                                     double sumx, sumy;
>                                     sumx = cos((90.0 - 
> lei->bearing)/180.0*THPI) + cos((90.0 - lei->backbearing)/180.0*THPI);
>                                     sumy = sin((90.0 - 
> lei->bearing)/180.0*THPI) + sin((90.0 - lei->backbearing)/180.0*THPI);
>                                     lei->bearing = 90.0 - (atan2(sumy, 
> sumx) / THPI * 180.0);
>                   if (lei->bearing < 0.0)
>                     lei->bearing += 360.0;
>                 }
>               }
>             }

I think the formula is too complicated. I purpose a simpler formula, like:
             If bearing <=180
                       AverageBearing =  (bearing + (backbearing -180))/2
                 else
                       AverageBearing = (bearing + (backbearing +180))/2

Regards,

Evaristo.



More information about the Therion mailing list