Aldebaran has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks and happy new year...
...to prove how boring it would be without the reality of digital computing and space exploration, Ultima Thule was just observed. It is fresh off the press as a 'W' for people who look at Cassiopeia. I'd like to look at it with perl.
I know that the game is that I post the source I have. It's been a while since I've made such calculations. They were for the solar eclipse that started in Neskowin, Oregon:
$ cat 4.triton.pl use warnings; use strict; use 5.010; use WWW::Mechanize::GZip; use HTML::TableExtract; use Prompt::Timeout; use open ':std', OUT => ':utf8'; use constant TIMEOUT => 3; use constant MAXTRIES => 30; use utils1; ## redesign for solar eclipse of aug 21, 2017 # declarations, initializations to precede main control my ( $moon_seconds, $sun_seconds, $equal_sec, $equal ); # set time boundaries my ( $before_bound, $after_bound ) = ( 2458070.47111, 2458071.47111); # hard code 2 objects to look at (rows) my $e1 = 4; #venus my $e2 = 7; #jupiter # hard code column my $column = 1; #right ascension my $filename = '2.jv.txt'; #output file my $now_string = localtime; open( my $jh, '>>', $filename ) or die "Could not open file '$filename +' $!"; say $jh "Script executed at $now_string"; my $attempts = 1; my ( $lower, $upper ) = ( $before_bound, $after_bound ); my $site = 'http://www.fourmilab.ch/yoursky/cities.html'; my $mech = 'WWW::Mechanize::GZip'->new; $mech->get($site); $mech->follow_link( text => 'Portland OR' ); $mech->set_fields(qw'date 2'); #julian date specified my $ref_final; #reference to outlive what follows # determine equality by contracting stochastically while ( ( ( $attempts == 1 ) || ( $sun_seconds != $moon_seconds ) ) ) +{ my $default = ( ( $attempts >= MAXTRIES ) ) ? 'N' : 'Y'; my $answer = prompt( "Make query number $attempts?", $default, TIM +EOUT ); exit if $answer =~ /^N/i; my $guess = closetohalf( $upper, $lower ); $mech->set_fields( jd => $guess ); $mech->click_button( value => "Update" ); my $te = 'HTML::TableExtract'->new; $te->parse( $mech->content ); my $table = ( $te->tables )[3]; #ephemeris table # looking to get the whole row my $aoa_ref = $table->rows(); #print_aoa( $aoa_ref ); #my $inverted = invert_aoa( $aoa_ref ); #print_aoa( $inverted ); $ref_final = $aoa_ref; # my $row_ref1 = $table->row($e1); my @row1 = @$row_ref1; my $row_ref2 = $table->row($e2); my @row2 = @$row_ref2; my $moon = $row1[$column]; my $sun = $row2[$column]; $moon_seconds = string_to_second($moon); $sun_seconds = string_to_second($sun); if ( $sun_seconds < $moon_seconds ) { $upper = $guess; } elsif ( $moon_seconds < $sun_seconds ) { $lower = $guess; } else { $equal = $guess; say $jh "equal, while condition fails at julian second $equal" +; $equal_sec = $moon_seconds; } say $jh "$attempts @row1"; say $jh "$attempts @row2"; $attempts++; } say $jh "equal seconds is $equal"; print_aoa( $ref_final ); sub string_to_second { my $string = shift; my $return; if ( my $success = $string =~ /^(\d*)h\s+(\d*)m\s+(\d*)s$/ ) { $return = 3600 * $1 + 60 * $2 + $3; } else { } return $return; } sub closetohalf { my ( $up, $low ) = @_; $low + ( $up - $low ) * ( 0.4 + rand 0.2 ); } $
Venus and Jupiter aren't moving fast enough. Instead, I ask that we focus on the question, when will the moon next conjoin with ultima thule? More specifically, when will they have the same right ascension from the point of view of Portland, Oregon? What other resources exist to determine this?
Thanks for your comment,
Aldebaran
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: locating ultima thule
by atcroft (Abbot) on Jan 04, 2019 at 07:10 UTC | |
by Aldebaran (Curate) on Jan 05, 2019 at 06:32 UTC | |
by haukex (Archbishop) on Jan 05, 2019 at 12:01 UTC | |
by Aldebaran (Curate) on Jan 06, 2019 at 09:16 UTC | |
by haukex (Archbishop) on Jan 06, 2019 at 09:43 UTC | |
| |
|
Re: locating ultima thule
by bliako (Abbot) on Jan 03, 2019 at 14:48 UTC | |
by Aldebaran (Curate) on Jan 04, 2019 at 10:42 UTC | |
by bliako (Abbot) on Jan 04, 2019 at 11:35 UTC | |
|
Re: locating ultima thule
by Aldebaran (Curate) on Jan 03, 2019 at 18:33 UTC | |
by Anonymous Monk on Jan 04, 2019 at 15:01 UTC | |
by afoken (Chancellor) on Jan 04, 2019 at 19:12 UTC |