Skip Menu |
 

This queue is for tickets about the Astro-satpass CPAN distribution.

Report information
The Basics
Id: 40113
Status: resolved
Priority: 0/
Queue: Astro-satpass

People
Owner: Nobody in particular
Requestors: michael_t [...] gazeta.pl
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 0.019



Download (untitled) / with headers
text/plain 939b
Hello, I try to get moonrise and moonset times, but it gives me false details and about week in the future. Here is my script: #!/usr/bin/perl -w use Astro::Coord::ECI; use Astro::Coord::ECI::Moon; my $lat=54.58; my $long=18.39; my $alt=0; my $moon = Astro::Coord::ECI::Moon->new (); my $sta = Astro::Coord::ECI->universal(time() )->geodetic ($lat, $long, $alt); my ($time, $rise) = $sta->next_elevation ($moon); print scalar localtime (time),"\n"; print "Moon @{[$rise ? 'rise' : 'set']} is ",scalar localtime $time,"\n"; and here is result: Fri Oct 17 01:56:01 2008 Moon rise is Wed Oct 29 15:32:24 2008 according to: http://aa.usno.navy.mil/data/docs/RS_OneYear.php its not even proper time for 29th of Oct. Is there an error in my script? I did like it was in excample at http://search.cpan.org/~wyant/Astro-satpass-0.018/lib/Astro/Coord/ECI/ Moon.pm ... or is it a bug in Astro::Coord::ECI::Moon. All the best, Michael Tocha
I think that, strictly speaking, there is a bug in your script, though the fact that my example is not complete certainly helped you write the bug. Given that I bootstrap myself into new software by working through examples all the time, it amazes me how many bugs I find in my examples. The missing thing from the example is that the latitude and longitude are to be given in radians, not degrees. This was a conscious design decision made because I was not smart enough to decide which routines would be used internally in the future, and I was too lazy to provide "degree" routines and "radian" routines. Saying that it was a conscious decision is not defending it as right, but it is saying that it is probably far too late to change. What I recommend doing to your script is to use Astro::Coord::ECI::Utils qw{deg2rad}; and then call that to convert the latitude and longitude to radians. I have attached a modified version of your script that does this. So at the very least the example needs changing. Maybe I could also limit-check the arguments, since a latitude of 54.58 radians is clearly bogus.
Download sample
application/octet-stream 556b

Message body not shown because it is not plain text.

From: michael_t [...] gazeta.pl
Thankyou for quick response, of course everything works like it should :)
Download (untitled) / with headers
text/plain 676b
Astro-satpass-0.019 has been uploaded, and should appear on the various mirrors in the next few hours/days. Except for Active State's PPM repository, which appears to be running rather behind. Most of the code examples in the SYNOPSIS section have been modified to be actual working scripts rather than code fragments. A couple of them (Astro::Coord::ECI::Star comes to mind) were not even close to being right. I made a real effort to make sure all the example code ran as-is. I'll probably leave the ticket open another week or so (or until I remember it again) for feedback. And until the rt system learns about version 0.019 so I can mark the bug fixed in that release.
Download (untitled) / with headers
text/plain 373b
On Mon Oct 27 23:01:45 2008, WYANT wrote: Show quoted text
> > I'll probably leave the ticket open another week or so (or until I > remember it again) for feedback. And until the rt system learns about > version 0.019 so I can mark the bug fixed in that release.
It's been two weeks without anything on _this_ ticket (though see 40899 for a related problem), so I'm marking this resolved.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.