Analyzing Appearance and Properties
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?
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)
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)')
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')
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
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)")
In [ ]:
Image(url= 'http://hmxearthscience.com/Galaxies%20and%20Stars/HR%20Lab%202.jpg')
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?
In [ ]:
# These are the abbreviations for all the constellations
data.sort_values('con').con.unique()
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)')
9. Which constellation did you choose? How many stars in it? Is it visible above Miami right now? Is it visible over Sydney?
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)")
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?
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)
In [ ]: