Aldebaran has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
I love this time of year, when I finally get to stow my tools and pay attention to the world of computer scripting. I have a upload project for perl that I started and want to give a proper treatment to, but this is not that. This I might call "fun."
I just went outside and saw Mars, Aldebaran and Betelgeuse in what seemed from my venue to be a right triangle. I would like to see if I can come up with what those angles are right now. The spot of observation isn't material to the matter, so we're not gonna fire up a virtual telescope, except maybe at the end to check results.
I've got a start, so let's trot out some output then source:
2022/12/15 23:38:42 INFO Name Right Ascension Declination 2022/12/15 23:38:42 INFO Mars 1.23928088293942 0.433953921126419 + 2022/12/15 23:38:42 INFO Moon 3.05180035788273 0.114033717122039 + 2022/12/15 23:38:42 INFO Aldeb 1.20392811802569 0.28813931509383 +6 2022/12/15 23:38:42 INFO Time is Thu Dec 15 23:38:42 2022 2022/12/15 23:38:42 INFO Julian day is 2459929.776875 2022/12/16 20:45:44 INFO ./1.betelgeuse.pl 2022/12/16 20:45:44 INFO Name Right Ascension Declination 2022/12/16 20:45:44 INFO Mars 1.23352830004944 0.43369447662583 2022/12/16 20:45:44 INFO Moon 3.23649903846235 0.025070511750444 +2 2022/12/16 20:45:44 INFO Aldeb 1.20392811802569 0.28813931509383 +6 2022/12/16 20:45:44 INFO Time is Fri Dec 16 20:45:44 2022 2022/12/16 20:45:44 INFO Julian day is 2459930.65675926
No frills, behaving nicely. Numbers look about right. Source:
#!/usr/bin/perl use Time::Piece; use Astro::Coord::ECI::Utils 'deg2rad'; use Astro::Coords; use Log::Log4perl; my $file = '/home/fritz/Documents/perlmonks/1.aldeb.txt'; # unlink $file or warn "Could not unlink $file: $!"; my $log_conf4 = '/home/fritz/Documents/perlmonks/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__
I'm super-duper rusty, so even this much was hard. For something like this, Log::Log4perl is essential to line up the data. I can't do anything with such data unless they are meticulously organized, so I already have a file dependency. What I would like to do is be able to host it on gitlab. I've tried once to create several commands that I would use at the terminal did not succeed. So, Objective 1 is to establish an appropriate web host. Given that I'm not there yet, I'll provide the source for the .conf file, so that I don't miss a base for SSCCE posting considerations:
###################################################################### +######### # Log::Log4perl Conf + # ###################################################################### +######### log4perl.rootLogger = DEBUG, LOG1, SCREEN log4perl.appender.SCREEN = Log::Log4perl::Appender::Screen log4perl.appender.SCREEN.stderr = 0 log4perl.appender.SCREEN.layout = Log::Log4perl::Layout::PatternLayou +t log4perl.appender.SCREEN.layout.ConversionPattern = %m %n log4perl.appender.LOG1 = Log::Log4perl::Appender::File log4perl.appender.LOG1.filename = /home/fritz/Documents/perlmonks/1.a +ldeb.txt log4perl.appender.LOG1.mode = append log4perl.appender.LOG1.layout = Log::Log4perl::Layout::PatternLayou +t log4perl.appender.LOG1.layout.ConversionPattern = %d %p %m %n
Ok, so what now? I'd like to find a way to represent the position of Betelgeuse by querying a computer that thinks it knows where it is. Is anyone aware of an API that gets me there?
Another thing I want to do is host this project on gitlab. I haven't been able to make a proper transfer yet. Regarding gitlab, I seem to be stuck at ssh setup page for gitlab. Which ssh key am I giving them? Do I generate a new key pair for this instance or one that I have already created?
I consider the Golden Days of usenet when we worked up physical problems in discussions in comp.lang.fortran, and then we had to go to comp.lang.perl.misc to be able to go out and get the data so that we could interoperate with it. (I especially prefered the discussions of C that occured in c.l.f. to c.l.c. looking at it as the lingua franca for interop as opposed to the one and only thing.) Lots of NASA and Cal Tech peeps who just have a reach into space like few others do.
Beyond position, I'd like to get measurable sources of as many of the values I can manage of the following.
Edit:
I've had some direct comments about the pre tags I used to display this, specifically, that I should have used c tags. I don't want to be bucking the norms, so I will reprise the same data with C-tags. My claim is that there's a bunch of weird symbols in this data set that are problematic one way or the other, and seeing the data with both renderings might help.Pronunciation /ˈbɛtəldʒuːz, ˈbiːtəl-, -dʒuːs/[1][2] Right ascension 05h 55m 10.30536s[3] Declination +07° 24′ 25.4304″[3] Apparent magnitude (V) +0.50[4] (0.0–1.6[5]) Characteristics Evolutionary stage Red supergiant Spectral type M1–M2 Ia–ab[6] Apparent magnitude (J) −3.00[7] Apparent magnitude (K) −4.05[7] U−B color index +2.06[4] B−V color index +1.85[4] Variable type SRc[8] Absolute magnitude (MV) −5.85[12]
Same data with c-tags:
Pronunciation /ˈbɛtəldʒuːz, ˈbiː +;təl-, -dʒuːs/[1][2] Right ascension 05h 55m 10.30536s[3] Declination +07° 24′ 25.4304″[3] Apparent magnitude (V) +0.50[4] (0.0–1.6[5]) Characteristics Evolutionary stage Red supergiant Spectral type M1–M2 Ia–ab[6] Apparent magnitude (J) −3.00[7] Apparent magnitude (K) −4.05[7] U−B color index +2.06[4] B−V color index +1.85[4] Variable type SRc[8] Absolute magnitude (MV) −5.85[12]
For now let's say I've cobbled together three points of (right ascension, declination) in radians, so then we're in the world of geometry. I completely forget what perl modules might address distance, angles and betweenness on the celestial sphere.
There's other things I want to do with this, but I think I'll just post this to get on the proverbial scoreboard. I have to wonder about the pronounciation. Westerners might think we made something up, but we're almost always the last ones to the rodeo, thinking we're first.
fritz@laptop:~/Documents$ trans :ru betelgeuse -p betelgeuse бетельгейзе (betel'geyze) Translations of betelgeuse [ English -> Русский ] betelgeuse бетельгейзе, Бетельгейзе fritz@laptop:~/Documents$
Same data with c-tags:
fritz@laptop:~/Documents$ trans :ru betelgeuse -p betelgeuse бетельгейз +е (betel'geyze) Translations of betelgeuse [ English -> Русский ] betelgeuse бетельгей +079;е, Бетельге +йзе fritz@laptop:~/Documents$
Does anyone know this star by a different name?
Cheers,
Also, for my german friends, what the hell was your QSource Insurrection about?.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl in the stars
by hv (Prior) on Dec 17, 2022 at 14:19 UTC | |
by Aldebaran (Curate) on Dec 19, 2022 at 05:24 UTC | |
by bliako (Monsignor) on Dec 19, 2022 at 15:40 UTC | |
by hippo (Bishop) on Dec 19, 2022 at 16:53 UTC | |
by Aldebaran (Curate) on Dec 19, 2022 at 20:15 UTC | |
| |
by soonix (Canon) on Dec 19, 2022 at 07:35 UTC | |
Re: perl in the stars
by kcott (Archbishop) on Dec 17, 2022 at 08:34 UTC | |
Re: perl in the stars
by Anonymous Monk on Dec 18, 2022 at 01:32 UTC | |
by Aldebaran (Curate) on Dec 19, 2022 at 06:21 UTC | |
by Anonymous Monk on Dec 19, 2022 at 14:06 UTC | |
by Anonymous Monk on Dec 19, 2022 at 15:36 UTC | |
by Anonymous Monk on Jan 02, 2023 at 19:27 UTC | |
Re: perl in the stars [pre- vs. c-tags]
by kcott (Archbishop) on Dec 21, 2022 at 00:26 UTC | |
Re: perl in the stars
by Anonymous Monk on Dec 20, 2022 at 16:13 UTC | |
by Anonymous Monk on Dec 23, 2022 at 16:50 UTC |