FYI, I got around to porting this today (with permission from Ed Williams).
I think I found a bug.
DP appears to be initialized backwards, and is accessed into the
uninitialized zone later (via a DP[n-2][m] term). On the Solaris box
I ported it to, this gave me an NaN in all n=8 terms, but apparently
sensible results elsewhere. This is probably random data, and I'd
expect something different on another system. Only half the array
is initialized; the bug is fixed either by initializing the whole
array to zero (and I'd suggest using bzero() or memset() if that tiny
bit of optimizable performance really is important), or by reversing
the indices of DP (and presumably P) on initialization.
The relevant line numbers (in coremag.cxx) are:
232, 233, 275
This was taken off the CVS web interface at flightgear.org this morning
(1 March 2010).
I've got this working at the unit test level, in my sandbox at NASA,
spot-checked against the NGDC online calculator for several places.
The form has changed in several ways in order to fit into our development
without pissing off IT by making yet another dependency (SG is needed
only for this), so submitting a diff is probably not helpful.
Just trying to help.
Michael A. K. Gross
Product Lead, Flight Management Infrastructure
Stratospheric Observatory for Infrared Astronomy
Michael A. K. Gross wrote:
> Norman Vine wrote:
>> On Feb 20, 2010, at 4:46 AM, Tim Moore wrote:
>>> On Sat, Feb 20, 2010 at 1:28 AM, Michael A. K. Gross
>>> <mgross@... <mailto:mgross@...>> wrote:
>>> Hi folks,
>>> I'm working on a US-government-funded flight planner for a NASA
>>> astronomy mission (SOFIA). Airborne astronomy has worked in true
>>> for over 30 years due to ever-antiquated NASA INS systems, but the
>>> spec has
>>> recently changed to magnetic. So, I get to code up a magnetic
>>> SimGear has one, and it's simpler than anything else out there.
>>> Unfortunately, it claims GPLv2. That would force NASA's hand at
>>> Actually, that code is LGPLv2, which wouldn't force NASA to release
>>> the code, unless you extract the coremag code and insert it into the
>>> planner application. Simgear is supposed to be LGPL, though the GPL
>>> has crept into a couple of files; mostly by mistake, I believe.
>>> the planner code publicly, not something I can do as a contractor
>>> would it be useful to anyone -- AFAIK, SOFIA is the only airworthy
>>> in existence that does not fly the wind triangle). So, I seek
>>> permission to
>>> use the pair of files coremag.hxx and coremag.cxx without
>>> releasing the "entire
>>> I would like to modify it to read coefficients from a file, so
>>> we can
>>> update it to stay consistent with our FMS, to localize the
>>> namespace, and
>>> to excise it from SimGear (no SG #includes). I will ask if I can
>>> this to the SimGear project, but it's not very likely.
>>> What a deal for us! :)
>>> You should probably ask the copyright holder Edward A Williams
>>> <Ed_Williams@... <mailto:Ed_Williams@...>>
>> Actually it is the wrapper magvar.XXX that is GPL'd coremag.XXX is LGPLd
>> IIRC magvar.XXX use to live in FlightGear hence its license and was
>> brought into SimGear later. Magvar is a simple wrapper program that
>> could easily be rewritten
>> and or its licensed changed. Curt if IIRC this is one of those that
>> I submitted
>> with your copyright on as I used to do to keep licensing issues simple
>> In any case no need to contact Ed as his code is LPGL already.
> I do need to modify coremag to accomplish our goals, so I don't think LGPL
> will cover it. The file itself claims GPLv2, and it's not good enough
> anyway for NASA bean counters for other authors to claim that's an error
> without correcting it.
> There are other options (like the gawdawful DoD standard that comes with
> WMM2010); it just takes quite a lot more time.
> Compuserve.com still exists? I thought that was defunct years ago.
> I'll try that.
> Mike Gross
Michael A. K. Gross Fat manuals are a reliable
Scientific Software Systems Specialist (S4) symptom of failure.
Stratospheric Observatory for Infrared Astronomy -- Niklaus Wirth, 10/20/04
NASA/Ames Research Center, MS 211-3
Moffett Field, CA 94035 Tel: +1 (650) 604-4975
mgross@... Fax: +1 (650) 604-0985