[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
same time.

--- Michael Koppelman <lolife@bitstream.net> 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
> program 
> that computes the heliocentric correction to an accuracy of less than
> 1/2 
> of a second. Note that I'm using his routines verbatim, the hard part
> for 
> me was getting the JD into a format usable in his routines, which is
> year,
>   day of year and fractional day. Thus, what I've learned would still
> be 
> 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
> Patrick 
> gave me.
> 
> Patrick suggested that I port his algorithms to perl. If I am true to
> the 
> 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
> without 
> dependencies. I'm going to give this a shot, but don't hold your
> breath!
> 
> Cheers,
> Michael Koppelman
> 
> 


=====
Chris Albertson 
  Home:   310-376-1029  chrisalbertson90278@yahoo.com
  Cell:   310-990-7550
  Office: 310-336-5189  Christopher.J.Albertson@aero.org

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com