Orion constallation project for review 7 May 2020

The project is here.
Please review if possible

https://github.com/mcng4570/codecacemy_stuff/blob/master/constellation_mcng4570_7May.ipynb

1 Like

Hey,

Your project looks to me like it fulfills all requirements stated in the task.
My code looked very similar when I did it.

I especially liked that you labelled some of the stars, which I hadn’t thought of previously.

Cheers and have a good Sunday!

1 Like

Thanks for taking the time to look at it.
I added the text because I spent some time trying to figure out the conversion in the PDF article. I just could not understand the conversion. Did not want to just waste the time so I used what I thought were the ‘best’ stars for orientation. Could not get it to work in the 3d model.

Keep learning!

What issue were you having with the original data? It has been a long time but I did a fair bit of astro back at uni and whilst spherical trigonometry still makes me tense up I might be able to help. If you’re just interested in the coding portion you could probably just move on.

However, for you and anyone else who wants a more obvious visual link between the two with perhaps a little less mathematics I suggest having a quick look at Stellarium. It’s a big open source (it’s even on github- https://github.com/Stellarium/stellarium) project for astronomy kinda like Google Earth (3d/visual perspective) but for the night sky (imo it wipes the floor with google sky, which is nice but it isn’t quite as advanced).

There’s a downloadable version but the web version is handy for a quick look-
https://stellarium-web.org/

1 Like

There is nothing wrong with the project or the original data.
What I did not understand was the conversion in https://arxiv.org/ftp/arxiv/papers/1110/1110.3469.pdf
I could not find any mathematical relationship in the conversion of the coordinates
It was just a chart of coordinates and no display of ‘how’ they converted astronomical reference to 3D Cartesian coordinates.
I was going to take another constellation and work on it if I could figure out the conversion for the project. Overkill, but I was curious as to how other constellations would plot, like Ursa Major. No need to do that with the website you sent

I appreciate your response and https://stellarium-web.org/ is great! Lot of info with the grids, satellites, etc. Really neat

Ah, that’d be converting the co-ordinates they provided e.g. distance, right ascension and declination into a cartesian co-ordinate system, e.g. X = distance * cos(declination) * cos(right ascension). Wikipedia is good for the basics but there’s loads of books/lessons about this sort of thing-

It’s pretty decent project as you’d need to consider things like converting hour angles to radians and such.
*note that the Z they provide is shifted by 1 as they defined Earth at position (0, 0, 1)

You can throw a little extra code at the end on the 3D model which I think highlights the point the paper was covering (despite being a constellation these stars aren’t particularly close together) though the field of view/viewer reference makes that tricky to work out.

# cotinuing from where the stars have been plotted in 3D.
earth_loc = (0, 0, 1)
earth = ax_3d.scatter(*earth, marker='x', s=40, c='r')

# quickly/lazily creating values for the lines to plot
packed_positions = [((0, star_x), (0, star_y), (1, star_z))
                    for (star_x, star_y, star_z) in zip(x, y, z)]
for xs, ys, zs in packed_positions:
    # each line is the path a ray of light would trace
    ax_3d.plot(xs, ys, zs)

Upping the 3D plot limits makes it a bit clearer what’s going on-

# Akin to zooming out for our sake
limits = -15, 15
ax_3d.set_xlim(*limits)
ax_3d.set_ylim(*limits)
ax_3d.set_zlim(*limits)
1 Like

OK that makes better sense.
Bringing back my surveying class (25 years ago) where we had a whole section on astronomical coordinates and conversions.
I regularly do mapping coordinate conversions and just could not get their conversion in my head
The offset of the Earth is also notable.
Thanks

1 Like

I won’t lie I had to look up how they worked to remind myself quickly. I think it’s just that curse of astronomy where there’s a thousand different ways/units to describe the same thing.