Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Deciding when the moon passed between aldebaran and mars

by Aldebaran (Curate)
on Mar 21, 2021 at 07:14 UTC ( [id://11130027]=note: print w/replies, xml ) Need Help??


in reply to Deciding when the moon passed between aldebaran and mars

One thing I lack now is a representation for where Aldebaran is.

I tried writing a script that used the example in Star.pm. In it, it required me to turn right ascension into radians, and after the script pooped out, I realized that all I needed to start making comparisons was its fixed value in radians.

$ ./7.astro.pl ./7.astro.pl Name Right Ascension Declination Mars 1.18463017264379 0.407948808088123 Moon 1.51448031651065 0.422740932680421 Aldeb 1.20392811802569 0.288139315093836 Time is Sun Mar 21 00:39:59 2021 Julian day is 2459294.7777662 $ pt 7.astro.pl $ cat 7.astro.pl <-I do this to be correct and use STDOUT to list reli +ably
#!/usr/bin/perl use Time::Piece; use Astro::Coord::ECI::Utils 'deg2rad'; use Astro::Coords; use Log::Log4perl; my $file = '/home/hogan/Documents/hogan/logs/3.log4perl.txt'; # unlink $file or warn "Could not unlink $file: $!"; my $log_conf4 = "/home/hogan/Documents/hogan/logs/conf_files/3.conf"; Log::Log4perl::init($log_conf4); #info my $logger = Log::Log4perl->get_logger(); $logger->info("$0"); $logger->info("Name\tRight Ascension\t\tDeclination"); for my $name (qw/Mars Moon/) { my $planet2 = Astro::Coords->new( planet => $name ); $planet2->datetime( Time::Piece->new ); my $ra = $planet2->ra( format => q/rad/ ); my $dec = $planet2->dec( format => q/rad/ ); $logger->info("$name\t$ra\t$dec"); } my $aldeb_ra_degrees = 68.98; my $aldeb_ra_radians = deg2rad($aldeb_ra_degrees); my $aldeb_declination_degrees = 16.509166666667; my $aldeb_dec_radians = deg2rad($aldeb_declination_degrees); $logger->info("Aldeb\t$aldeb_ra_radians\t$aldeb_dec_radians "); my $t = localtime; my $jd = $t->julian_day; $logger->info("Time is $t"); $logger->info("Julian day is $jd"); __END__

So, the data is bunching together well, but I'm not completely sure how I'd go about figuring out when something crosses between. For me, it's a tantalizing triangle.

I would think that we should think of these creatures as two-vectors of radians. Then my question now is this: if these are 3 traveling 2-vectors (one is stationary for this script), how do I write a function to calculate betweenness? It seems clear to me that I would need to invoke a telescope method.

I also wonder if everyone in the world could have had a chance to see this (less light pollution)?

Replies are listed 'Best First'.
Re understanding values at vernal equinox
by Aldebaran (Curate) on Mar 21, 2021 at 23:45 UTC

    I just happen to be making astronomical calculations in perl and noticing that the sun is really near 0 right ascension and declination. Hmm. That would be the vernal equinox, right? I always like to calculate things like this exactly if I happen to have the time and a nearby laptop. I'm getting output I don't understand, so I think I'm in a better place to ask a cohesive question. What's more, I think I can get to it without needing to resort to readmore tags.

    I found an old thread where haukex had helped me figure out some of this: Re: calculate length of day as function of space at onset of fall, and started folding in the old code into the new. I write some really primitive-looking code looking back, but it's my learning on display. Out of this I made a githubpull request, simply to try to understand how github works, and I really don't get it still, which defines me clearly as an intermediate perl user that I am struggling with it. This is what I had some code at github that calculates equinoxes, sunsets, meridians.

    Anyways, so I start chopping that up and am left 3 lines, and then I hardcode the year:

    use Astro::Utils; my $spring = calculate_equinox( 'mar', 'utc', '2021' ); $logger->info("spring begins $spring");

    I'll list output, source and then have a couple questions.

    $ ./3.vernal.pl ./3.vernal.pl Name Right Ascension Declination Mars 1.19220473652282 0.409015700183571 Moon 1.6536783961676 0.442537954264476 Sun 0.0202246733370893 0.00876435085335973 Aldeb 1.20392811802569 0.288139315093836 Time is Sun Mar 21 17:03:18 2021 Julian day is 2459295.460625 Sun set is Mon Mar 22 01:58:54 2021 Astro::Coord::ECI=HASH(0x560eda31aa70) spring begins 2021-03-20 09:37:05 $ cat 3.vernal.pl
    #!/usr/bin/perl use Time::Piece; use Astro::Coord::ECI::Utils 'deg2rad'; use Astro::Coords; use Log::Log4perl; use 5.030; my $file = '/home/hogan/Documents/hogan/logs/3.log4perl.txt'; unlink $file or warn "Could not unlink $file: $!"; my $log_conf4 = "/home/hogan/Documents/hogan/logs/conf_files/3.conf"; Log::Log4perl::init($log_conf4); #info my $logger = Log::Log4perl->get_logger(); $logger->info("$0"); $logger->info("Name\tRight Ascension\t\tDeclination"); for my $name (qw/Mars Moon Sun/) { my $planet2 = Astro::Coords->new( planet => $name ); $planet2->datetime( Time::Piece->new ); my $ra = $planet2->ra( format => q/rad/ ); my $dec = $planet2->dec( format => q/rad/ ); $logger->info("$name\t$ra\t$dec"); } ## declare values and tailor to what these routines expect... my $aldeb_ra_degrees = 68.98; my $aldeb_ra_radians = deg2rad($aldeb_ra_degrees); my $aldeb_declination_degrees = 16.509166666667; my $aldeb_dec_radians = deg2rad($aldeb_declination_degrees); my $local_lat = deg2rad(43.6135); # +Radians my $local_long = deg2rad(-116.20345); # +Radians my $local_alt = 8321 / 1000; # +Kilometers $logger->info("Aldeb\t$aldeb_ra_radians\t$aldeb_dec_radians "); my $t = localtime; my $jd = $t->julian_day; $logger->info("Time is $t"); $logger->info("Julian day is $jd"); use Astro::Coord::ECI::Sun; my $sun = Astro::Coord::ECI::Sun->new(); my $sta = Astro::Coord::ECI->universal( time() ) ->geodetic( $local_lat, $local_long, $local_alt ); my ( $time, $rise ) = $sta->next_elevation($sun); my $string = "Sun @{[$rise ? 'rise' : 'set']} is " . scalar gmtime $time . " UT\n +"; $logger->info("$string"); $logger->debug("$sta"); # calculate begin of spring use Astro::Utils; my $spring = calculate_equinox( 'mar', 'utc', '2021' ); $logger->info("spring begins $spring"); __END__ $

    As I look at the data, does it not say that spring has already sprung? Here's question 1: Is the value for $spring correct?

    If $spring is correct, then has spring sprung? If so, why are the values for the sun's declination and right ascension still so unzeroish?

    Thanks for your comments,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11130027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-26 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found