<div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div dir="ltr"><br></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 6, 2020 at 4:10 AM Wookey <<a href="mailto:wookey@wookware.org">wookey@wookware.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2020-10-05 23:54 +0200, Matthias Keller wrote:<br>>    Unfortunately, even the current Therion 5.5.1 doesn't have a more<br>
>    meaningful (and correct) message than "unable to determine magnetic<br>
>    declination for undated surveys"<br></blockquote><div><br></div><div> This has already been fixed in the latest commit.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>    I would propose:<br>
> <br>
>     1. If a survey is dated but is newer than available correction data,<br>
>        build should fail with a message like:<br>
>        "Error determining magnetic declination for survey <name> with date<br>
>        <date>. Please specify the declination explicitly using for example<br>
>        'declination 3 deg'"<br>
>        instead of the (completely wrong)<br>
>        "unable to determine magnetic declination for undated surveys"<br></blockquote><div><br></div><div>We have discussed it with Stacho and the following seems to be the best approach:</div><div><br></div><div>IGRF models are designed to predict over the 5 year period (IGRF 13 released at the end of 2019 is intended to be used to predict the declination up to the end of 2024, when a new version, IGRF 14 will be released). In Therion, we will allow to use the model for additional 5 years (using linear extrapolation) and produce a warning (so IGRF 13 could be used until the end of 2029). After 2029, more firm warnings will be produced if Therion still uses IGRF 13, but we don't expect anybody to use such an outdated Therion.</div><div><br></div><div>On the other hand: is there any need to use the data older than 1900? If yes, we could implement the GUFM1 model covering the period 1590–1890.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>     2. If at least one of the imported (and thus joined) surveys has magnetic<br>
>        data but at least one does not (or cannot be determined), an error<br>
>        shall be thrown as well, because mixing corrected and uncorrected<br>
>        surveys is just plain wrong and causes a lot of confusion (as it has<br>
>        happened to me). The same error message shall be displayed and the<br>
>        build fails.<br></blockquote><div> </div><div>You can't always avoid mixing dated and undated surveys (sometimes the older survey data might be undated), so using the min(survey_dates) as a proxy for undated surveys (and producing a warning as well) should be a reasonable approach.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">>    btw, is there any way to update the data in an existing therion<br>
>    installation? Or is the only way the update to a (hopefully existing) new<br>
>    version?<br>
<br>
There could be - the files are available online so therion could use<br>
the currently-installed version of the file. But currently the igrf<br>
coefficients file is compiled-in as thgeomagdata.h This means therion<br>
can always find the data, but it's not updateable without<br>
recompiling. I could fix this for linux relatively easily, but it's<br>
harder on Windows. (and it was making things work on windows that<br>
caused therion to compile-in all the stuff it needed from subsystems,<br>
many years ago). Ideally it would compile one in but have the ability<br>
to read a newer file if provided. But then someone has to write a<br>
parser.</blockquote><div><br></div><div>Not sure if writing the parser is worth the effort, as AFAIK all the real issues with the declination come from the incorrect handling of undated/out-of-range data, not from an outdated model. </div><div>Even a model outdated 10 or 15 years should provide very reasonable results. E.g. for our cave area:</div><div><br></div><div><div>The declination for 2015-01-01 calculated as a</div><div><div>* 10-year prediction from IGRF 10 = 4.6206</div><div>* 5-year prediction from IGRF 11 = 4.6593</div><div>* model result from IGRF 12 = 4.6836</div><div>* definitive model result from IGRF 13 = 4.6834</div><br><div></div></div><div>The difference is absolutely negligible even between the models 3 generations apart.</div><div></div></div><div><br></div><div>The declination for 2020-01-01 calculated as a</div><div>* 15-year prediction from IGRF 10 = 5.1626</div><div>* 10-year prediction from IGRF 11 = 5.2685</div><div>* 5-year prediction from IGRF 12 = 5.3231</div><div>* model result from IGRF 13 = 5.4036</div><div><br></div><div>The difference is still less than a typical compass reading error.</div><div><br></div><div>The example is not really representative and there might be areas (definitely near the magnetic poles) where the differences are larger, but it should illustrate the point. Also consider that the model is approximate anyway (even in its intended time range) and no local/regional deviations in the geomagnetic field are taken into account at all.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> We could also try a little harder not to get 10 years behind<br>
again. (5.4.4 was released in May 2019 with a model that expired in<br>
mid 2020, when the 2025 model had been available since 2015 (and was<br>
included with the next therion release in May 2020). Not sure why the<br>
update was not to 2030 as that was available from Dec 2019.)<br></blockquote><div><br></div><div>There was actually no 2025 model available since 2015. The models are always for 5-year predictions and there is zero overlap between them. Just to illustrate, here is an overview of the history of publication of IGRF models and their inclusion into Therion (see <a href="https://github.com/therion/therion/commits/master/thgeomagdata.h">https://github.com/therion/therion/commits/master/thgeomagdata.h</a>):</div><div>* IGRF 11 released in December 2009, included into Therion on February 17, 2010, released as 5.3 on the same day<br>* IGRF 12 released in December 2014, included into Therion on December 28, 2014, released as 5.3.16 on the same day<br>* IGRF 13 released in December 2019, included into Therion on January 19, 2020, released as 5.5.0 on May 1, 2020<br></div><div><br></div><div>Cheers</div><div>Martin</div><div><br></div></div></div></div></div>