Properties of the Stars

Analyzing Appearance and Properties

Pre-Questions

1. How do absolute magnitude (absmag) and apparent magnitude (mag) differ? How is luminosity related?
2. A star’s appearance gives clues about its properties. Since the nearest star would take thousands of years to reach to measure directly, how are these clues helpful to astronomers?
3. Astronomers have made observations of millions of stars, how might knowing the properties of these stars help them understand things like the composition of different parts of the universe or how solar systems form?

Importing the functions and getting the data...


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

In [ ]:
# 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 [ ]:
# We wish too look at the first 3 rows of our data set
data.head(3)

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 [ ]:
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)')

Run the Code below to create a chart containing all of the Stars with Exoplantes within 100 light years!


In [ ]:
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')

Part 1 Questions

4. The graph you produced shows right ascension on the x-axis and declination on the y-axis. What does the resulting graph actually show?
5. Your code also produced a chart- how are the chart and graph similar to each other? How are they different?
6. Are there any stars you can identify on both of them? What are their names? What aspect of the graph allowed you to do that? Is there

PART 2: Relationships Between Two Properties


In [ ]:
# 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)")

Run the code below to display a chart of Star color and temperatures.


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

Part 2 Questions

7. Each point on the scatter plot shows a star’s temperature and luminosity. What trends do you see in the data?
8. Around what temperature is the largest range of luminosities? Using the chart below the graph you produced determine the most likely color? If a star is blue, what temperature can you infer it is?

PART 3: Constellations and Star Properties


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

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

In [ ]:
# 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)')

Part 3 Question 9

9. Which constellation did you choose? How many stars in it? Is it visible above Miami right now? Is it visible over Sydney?

Which types of stars make up your constellation?


In [ ]:
# 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)")

HR Diagram - The Stars in the constellation are highlighted as red dots in the graph above!

Part 3 Questions 10 & 11

10. Using the H-R Diagram, what types of stars make up your constellation? How many of each type are in your constellation?
11. What is the temperature of the hottest star in your constellation? What is its absolute magnitude? What about the coldest constellation? 

Part 4: Unstructured Coding

Using the coding blocks apove, find the answers to questions 12 and 13.

Part 4 Questions

12. Is there a relationship between distance (dist) & apparent magnitude (mag)? Use the coding block from part 2 (hint: you will need to adjust the x & y limits)
13. Is there a relationship between apparent magnitude (mag) & absolute magnitude (absmag)? Use the coding block from part 2 (hint: you will need to adjust the x & y limits)

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 [ ]: