Astronomy Project – Day 4

I’ve been dabbling a little bit every day with this project and I’ve made some big changes since day 1.

First, with some help from Brandon Rhodes on StackOverflow, I got the function to print the altitude/azmiuth data for a planet when you run the script. This is still hardcoded for South Bend, but that’s where I live, so it makes sense. Down the line, I’ll make this a variable a user can use to set their locality.

Next, I found a python module to pull the current date and time when requesting the planet’s location. Since the Earth moved, it didn’t make sense to display the position based on date alone. Now, it will read that information from the computer and give more accurate results. Because I did this during the day, I used the sun as my object so I could check it’s position in my program vs other databases and calculators online. And this is where my brain started to hurt.

If you’re not familiar with astronomy (and I’m still learning) you can display position in a few different ways. The easiest (most popular?) way to describe position is using altitude and azimuth coordinates. The altitude is the angle of the object above the horizon and the azimuth is it’s angular distance around the horizon. So, if it’s position is 30o, 270o, it would be 30 degrees above the horizon looking due west.

You can also use celestial coordinates, right ascension and declination. RA is the angular distance from the celestial equator. In other words, if you stand on the equator and look up, you’re looking at RA = 0. The declination, on the other hand, is the direction north or south of the celestial plane. To me, this is much harder to conceptualize in my brain, which is why I prefer alt/az descriptors.

So, back to the code. I got it to print alt/az data, which was awesome. So, to make sure it was working correctly, I checked it against some other tools, and that’s when I ran into problems.

So, I went back to the code and changed it to print out the RA/Dec instead of alt/az to see what would happen.

Which was better.

I need to find some way to improve my alt/az calculations. I don’t know if it’s my location data or if there need to be adjustments to conversions, but I’m getting funny answers. For now, I’ll keep it in RA/Dec because the entire point of this program down the line is to pass this data to a telescope, so it doesn’t matter which one is easier for the user to look at. We’ll see.

If you want to see the current code, here’s the current dev code base. If you’re a python coder, feel free to fork and contribute.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.