Properties of the Stars

Analyzing Appearance and Properties

Importing the functions and getting the data...


In [2]:
# Import modules that contain functions we need
import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib.pyplot as plt

In [3]:
# Read in data that will be used for the calculations.
# Using pandas read_csv method, we can create a data frame
data = pd.read_csv("https://github.com/adamlamee/CODINGinK12-data/raw/master/stars.csv")

In [4]:
# We wish too look at the first 3 rows of our data set
data.head(3)


Out[4]:
proper ra dec dist mag absmag ci temp x y z con lum var var_min var_max
0 Sol 0.000000 0.000000 0.0000 -26.70 4.850 0.656 5756.588113 0.000005 0.000000 0.000000 NaN 1.000000 NaN NaN NaN
1 Proxima Centauri 14.495985 -62.679485 1.2959 11.01 15.447 1.807 3383.441193 -0.472264 -0.361451 -1.151219 Cen 0.000058 V645 11.079 10.939
2 Rigil Kentaurus 14.660765 -60.833976 1.3248 -0.01 4.379 0.710 5567.728737 -0.495203 -0.414084 -1.156625 Cen 1.543121 NaN 0.113 -0.087

PART 1: All the Stars in Our Catalogue

Declination is the distance a star is North or South of the Celestial Equator, similar to lattitude</i> on Earth. Right Ascension is how far east or west a star is, similar to longitude</i> on Earth.


In [5]:
fig = plt.figure(figsize=(15, 6))
plt.scatter(data.ra,data.dec, s=0.01)
plt.xlim(24, 0)
plt.title("All the Stars in the Catalogue")
plt.xlabel('Right Ascension (Hours)')
plt.ylabel('Declination (Degrees)')


Out[5]:
<matplotlib.text.Text at 0x2d51381e320>

In [6]:
from IPython.display import Image
from IPython.core.display import HTML 

Image(url= 'http://www.hpcf.upr.edu/~abel/phl/nearby_stars_with_exoplanets.png')


Out[6]:

PART 2: Relationships Between Two Properties


In [7]:
# format the points on the graph
transparency = 1
size = 1

# draws a scatter plot
fig = plt.figure(figsize=(20, 4.5))
plt.scatter(data.temp, data.lum, s=size, edgecolors='none', alpha=transparency)
plt.xlim(2000,15000)
plt.ylim(0,1000)
plt.title("Does hotter mean brighter?")
plt.ylabel("Luminosity")
plt.xlabel("Temperature (K)")


Out[7]:
<matplotlib.text.Text at 0x2d513d01978>

In [8]:
Image(url= 'http://hmxearthscience.com/Galaxies%20and%20Stars/HR%20Lab%202.jpg')


Out[8]:

PART 3: Constellations and Star Properties


In [9]:
# These are the abbreviations for all the constellations
data.sort_values('con').con.unique()


Out[9]:
array(['And', 'Ant', 'Aps', 'Aql', 'Aqr', 'Ara', 'Ari', 'Aur', 'Boo',
       'CMa', 'CMi', 'CVn', 'Cae', 'Cam', 'Cap', 'Car', 'Cas', 'Cen',
       'Cep', 'Cet', 'Cha', 'Cir', 'Cnc', 'Col', 'Com', 'CrA', 'CrB',
       'Crt', 'Cru', 'Crv', 'Cyg', 'Del', 'Dor', 'Dra', 'Equ', 'Eri',
       'For', 'Gem', 'Gru', 'Her', 'Hor', 'Hya', 'Hyi', 'Ind', 'LMi',
       'Lac', 'Leo', 'Lep', 'Lib', 'Lup', 'Lyn', 'Lyr', 'Men', 'Mic',
       'Mon', 'Mus', 'Nor', 'Oct', 'Oph', 'Ori', 'Pav', 'Peg', 'Per',
       'Phe', 'Pic', 'PsA', 'Psc', 'Pup', 'Pyx', 'Ret', 'Scl', 'Sco',
       'Sct', 'Ser', 'Sex', 'Sge', 'Sgr', 'Tau', 'Tel', 'TrA', 'Tri',
       'Tuc', 'UMa', 'UMi', 'Vel', 'Vir', 'Vol', 'Vul', nan], dtype=object)

Choose a Constellation from the list above and insert the 3 letter code below in the " ", for example "Vir".

In [10]:
# This shows just one constellation
data_con = data.query('con == "Vir"')

# This plots where the brightest 10 stars are in the sky
data_con = data_con.sort_values('mag').head(10)
plt.scatter(data_con.ra,data_con.dec)
plt.gca().invert_xaxis()
plt.title("A constellation in the sky")
plt.xlabel('Right Ascension (degrees)')
plt.ylabel('Declination (Hours)')


Out[10]:
<matplotlib.text.Text at 0x2d513d594e0>

Can we see your constellation now?

Which types of stars make up your constellation?


In [12]:
# format the points on the graph
transparency = 0.2
size = 1

# draws a scatter plot
fig = plt.figure(figsize=(6, 4.5))
plt.scatter(data.temp, data.absmag, s=size, edgecolors='none', alpha=transparency)
plt.scatter(data_con.temp, data_con.absmag, color='red', edgecolors='none')
plt.xlim(17000,2000)
plt.ylim(18,-18)
plt.title("Types of stars in a constellation")
plt.ylabel("Absolute Magnitude")
plt.xlabel("Temperature (K)")


Out[12]:
<matplotlib.text.Text at 0x2d513dc8ac8>

HR Diagram

The Stars in the constellation are highlighted as red dots in the graph above

References

  • The data came from The Astronomy Nexus and their colletion of the Hipparcos, Yale Bright Star, and Gliese catalogues (huge zip file here).
  • Thanks to UCF Physics undergrad Tyler Townsend for contributing to the development of this notebook.

In [ ]: