[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GJD to HJD
Perl and FORTRAN may do the calculations diferently even
if the source code is exactly transliterated. For one thing,
in Perl all numbers are "doubles" and FORTRAN can use real
integeres. So, for example a test like (I .eq. 3) may work
in FORTRAN but ($i == 3) may fail in Perl if $i is really
3.0000000000001. There are a lot of little things like this
that could make the Perl and FORTRAN results differ.
A translation into "C" would be a good thing to try too. I'd
expect the C and FORTRAN results to match exactly. You could
then call the C function from Perl and gain some speed at the
--- Michael Koppelman <firstname.lastname@example.org> wrote:
> I don't know if this is interesting to y'all or not...
> After more discussions with Patrick Wallace of SLA, I now have a
> that computes the heliocentric correction to an accuracy of less than
> of a second. Note that I'm using his routines verbatim, the hard part
> me was getting the JD into a format usable in his routines, which is
> day of year and fractional day. Thus, what I've learned would still
> useful if we use C-wrappers around the FORTRAN SLA library.
> The numbers from Taichi Kato and Lew Cook (for the example I'm
> working on)
> were also under 1/2 sec of accuracy. This is compared to numbers
> gave me.
> Patrick suggested that I port his algorithms to perl. If I am true to
> routines, I think we can have a win-win: the algorithms have been
> extensively tested, but we have a simple perl script that can run
> dependencies. I'm going to give this a shot, but don't hold your
> Michael Koppelman
Home: 310-376-1029 email@example.com
Office: 310-336-5189 Christopher.J.Albertson@aero.org
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup