in reply to Re^2: calculating planet conjunction with mojo front end
in thread calculating planet conjunction with mojo front end

Use Astro::Telescope to calculate the position in the sky from your location:
#!/usr/bin/perl use strict; use warnings; use Time::Piece; use Astro::Coords; use Astro::Telescope; print qq/Planet\tAzimuth\t\t\tElevation\n/; for my $name (qw/Jupiter Saturn/) { my $planet = Astro::Coords->new(planet => $name); $planet->datetime(Time::Piece->new); $planet->telescope(Astro::Telescope->new( Name => q/1600 Pennsylvania Ave, Washington DC/, Long => -77, Lat => 38.9, Alt => 16.7)); my $az = $planet->az(format => 'deg'); my $el = $planet->el(format => 'deg'); print qq/$name\t$az\t $el\n/ }
Output:
Planet	Azimuth			Elevation
Jupiter	132.670727106298	 -7.05306603251409
Saturn	131.551952092501	 -7.04332546770451

Replies are listed 'Best First'.
Re^4: calculating planet conjunction with mojo front end
by Anonymous Monk on Dec 12, 2020 at 08:55 UTC
    Oops forgot that Astro::Telescope requires Lat and Long in radians:
    #!/usr/bin/perl use strict; use warnings; use Time::Piece; use Astro::Coord::ECI::Utils 'deg2rad'; use Astro::Coords; use Astro::Telescope; print qq/Planet\tAzimuth\t\t\tElevation\n/; for my $name (qw/Jupiter Saturn/) { my $planet = Astro::Coords->new(planet => $name); $planet->datetime(Time::Piece->new); $planet->telescope(Astro::Telescope->new( Name => '1600 Pennsylvania Ave, Washington DC', Long => deg2rad(-77), Lat => deg2rad(38.9), Alt => 16.7)); my $az = $planet->az(format => 'deg'); my $el = $planet->el(format => 'deg'); print qq/$name\t$az\t $el\n/ }