Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Moon phase on historical events

by bliako (Monsignor)
on Oct 09, 2021 at 10:11 UTC ( [id://11137386]=note: print w/replies, xml ) Need Help??


in reply to Re: Moon phase on historical events
in thread Moon phase on historical events

Thanks Aldebaran for doing that very insightful test of different place, "same" time. The unix-epoch seconds of the output show: 1633762800-1633730400=324000, a 9 hour difference. So, yes plausible results as you said.

bw from atop the Scylla

Replies are listed 'Best First'.
Re^3: Moon phase on historical events
by Aldebaran (Curate) on Oct 11, 2021 at 03:00 UTC
    bw from atop the Scylla

    Likewise and always good to hear from you. I extended your script to attempt to determine what this moon might look like from the points we have defined and their antipodes. Any observation also needs a height which I have set at the height of Boise. I threw in the planets Venus, Saturn, and Jupiter too, as they seem to be part of the big celestial show for the next few days.

    I also use Log::Log4perl, because these data would overwhelm STDOUT. The .conf files are from the examples.

    My first question is how the azimuth is defined. Astro::Coord is suuuper complicated. Looks like there's even fortran in there. Physicists and mathematicians do things differently in a lot of settings. I can't tell if my results are wrong or untransformed.

    The same time is used for 4 different places. (Not that they're gleichzeitig.) I'll put the log and then the source between readmore tags:

    One thing I noticed is that these data are very sensitive to altitude of the defined observer. A person at 817 meters above the Scylla would have a much better view of rising and setting planets. Is there any way to figure out what a reasonable guesstimate is of altitude given latitude and longitude?

    How long does the moon's transit from Venus to Jupiter take?

    How can I determine that a priori? I know that I can bound the value in DateTime with output from the original post. Can one loop over this interval with the methods of DateTime adding the duration of a second and then checking values. A month isn't a lot of seconds for a computer.

      Great additions Aldebaran!

      DateTime can do date arithmetic as simply as:

      my $dt = DateTime->new( year => 2021, month => 4, day => 5, hour => 2, time_zone => 'Africa/Nairobi', ); # or, create a DateTime object from an ISO timestring my $isostr = '2021-10-11T11:13:57'; my $dt = DateTime::Format::ISO8601->parse_datetime($isostr); # add a second to what $dt currently holds $dt->add(seconds => 1);

      Regarding your other questions, I have no clue about celestial mechanics. Nonetheless I have whipped up a Perl sub to get you the elevation given coordinates. It uses a site which I am not sure if they would like people using their services in this way. So with that in mind:

      # usage: # my $elevation = get_elevation_from_coordinates(15.6325, 38.245833, 0 +); sub get_elevation_from_coordinates { my ($lat, $lon, $debug) = @_; $debug //= 0; my $ua = LWP::UserAgent->new( agent => 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100 +101 Firefox/78.0', ); my $response; my $payload = 'latitude='.$lat .'&longitude='.$lon .'&application_max_assets_mtime=1559625591' ; my $payloadlen = length($payload); # this request was translated from Curl command-line # by [Corion]'s https://corion.net/curl2lwp.psgi my $req = HTTP::Request->new( 'POST' => 'https://www.mapcoordinates.net/admin/component/edit +/Vpc_MapCoordinates_Advanced_GoogleMapCoords_Component/Component/json +-get-elevation', [ 'Connection' => 'keep-alive', 'Accept' => '*/*', 'Accept-Encoding' => 'gzip, x-gzip, deflate, x-bzip2, bzip2', 'Accept-Language' => 'en-US,en;q=0.5', # 'Host' => 'www.mapcoordinates.net:443', 'Referer' => 'https://www.mapcoordinates.net/en', 'User-Agent' => 'Mozilla/5.0 (X11; Linux x86_64; rv:78.0) +Gecko/20100101 Firefox/78.0', 'Content-Length' => $payloadlen, 'Content-Type' => 'application/x-www-form-urlencoded; charse +t=UTF-8', 'DNT' => '1', 'Origin' => 'https://www.mapcoordinates.net', 'X-Requested-With' => 'XMLHttpRequest' ], $payload ); die "call to HTTP::Request has failed" unless $req; if( $debug > 0 ){ print "$0 : $payload\n$0 : sending above payload +, of $payloadlen bytes...\n" } $response = $ua->request($req); die "Error fetching: ".$response->status_line unless $response->is_success; my $content = $response->decoded_content; my $data = Data::Roundtrip::json2perl($content); die "failed to parse received data:\n$content\n" unless exists $data->{'elevation'}; return $data->{'elevation'}; }

      bw, bliako

      Is there any way to figure out what a reasonable guesstimate is of altitude given latitude and longitude?

      Geo::WebService::Elevation::USGS - Elevation queries against USGS web services.

        Thanks for this. It works for trump's (real) tower but scylla is shown to be somewhere near Hades (for a country with planetal ambitions, their map services are curiously modest to confine within the national boundaries and that "feet" default indicates possible time-warp to past eras):

        use Geo::WebService::Elevation::USGS; use Data::Dumper; my $eq = Geo::WebService::Elevation::USGS->new( timeout => 60, ); # white house my $x = $eq->elevation(38.91205168958467, -77.03355236501928); print Dumper($x); # scilla sicily $x = $eq->elevation(38.17378844699463, 15.83642789839883); print Dumper($x);
        $VAR1 = { 'Units' => 'Feet', 'Data_Source' => '3DEP 1/3 arc-second', 'y' => '38.9120516895847', 'Elevation' => '96.95', 'x' => '-77.0335523650193' }; $VAR1 = { 'y' => '38.1737884469946', 'x' => '15.8364278983988', 'Elevation' => '-1000000', 'Units' => 'Feet', 'Data_Source' => '3DEP 1/3 arc-second' };

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-20 11:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found