[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Heliocentric julian date adjustment





Hey Michael K.

The differences between the C and Perl versions are likely attributable to
the fact the Perl does everything in doubles (internally), where the C code
has a mixture of floats and doubles.

I return the julian date as the date may be given to the correction routine
in the format directly from FITS files "YYY-MM-DDTHH:MM:SS".

I'll take your suggestion, and if the return value requested is a SCALAR,
just return the correction.  If an ARRAY is requested, return the currently
returned values.

Thanks,
Rob

> -----Original Message-----
> From: Michael Koppelman [mailto:lolife@bitstream.net]
> 
> damn close. I couldn't say which is closer:
> 
> Yours:
> digital [12:01pm] % ./test.pl 2452431.77366 179.463657 6.451305
> Correction is 0.00116879682269064
> 
> Mine:
> digital [12:04pm] % ./jd2hjd 2452431.77366 179.463657 6.451305
> 0.00116879706317932100
> 
> My only suggestion is to make the POD a bit more intuitive i.e:
> 
> my ($correction, $orig_jd, $corr_jd) = correction( $jd, $ra, $dec );
> 
> ...so you don't have to read the description to know how to 
> use it. I'm 
> not sure why you are returning the original JD since we 
> already have that.
>   I would probably just make it return the scalar correction 
> so you could 
> call it like:
> 
> $jd += correction( $jd, $ra, $dec );
> 
> It is by design that if you call it from scalar context 
> rather than array 
> context you get the corrected JD? That seems reasonable, I 
> guess, although 
> I think I prefer the correction so I can know what is going on.
> 
> Very nice.
> 
> Michael Koppelman
>