import pandas as pd
import numpy as np
%matplotlib inline
import matplotlib as mpl
import matplotlib.pyplot as plt

# Read in data that will be used for answering some of the questions below
data = pd.read_csv("./significant_month.csv")

# Observe the first 5 rows of the data provided below
data.head(4)

"""
Explanation: Layers of the Earth
Students will analyze the following information and answer questions a long the way in order to learn the different layers of the earth.
Through BBC's website (provided below), students can find further information about the topic of Layers of the Earth
http://www.bbc.co.uk/schools/gcsebitesize/geography/natural_hazards/tectonic_plates_rev1.shtml
The Different Layers
There are four different layers of the earth. Information for this section can be read through Annenberg Learner's website: https://www.learner.org/interactives/dynamicearth/structure.html
Use the following image to answer the questions bellow
<img src='https://classroom.therefugeecenter.org/wp-content/uploads/2016/04/Pic22.jpg'>
Questions

Name the four layers of the Earth in order.
What are the names of the two regions of the Mantle?
How deep is the Earth's crust?
What materials make up the inner core?

Composition and Density
The following link contains information written by Eugene C. Robertson from USGS.gov, which will help you understand this concept some more https://pubs.usgs.gov/gip/interior/
Use the following table to answer the questions below.
<img src='https://apionline.sodapdf.com/Public/widgets/convertmyimage/download/density.jpg'>
Questions

What is the approximate density in grams per cubic centimeter of the earth at 1600km below sea level?
Why do you think the density of the earth increases as we go further down?
What kind of rocks are found in the thickest layer of the Earth?
Name the first internal structural element to be identified.

Earthquakes
The Crust layer of the Earth may be broken into pieces identified as plates. When such plates move,they can produce an earthquake and/or volcano.
To learn the abriviations used for this chart, visit USGS at https://earthquake.usgs.gov/earthquakes/feed/v1.0/csv.php
End of explanation
"""


# Read the data that will be used for answering the questions below.
data = pd.read_csv("./temp.csv")

# Observe the first 20 rows and plot provided for you below.
data.head(20)

fig = plt.figure(figsize=(10,3))
plt.plot(data['Depth in km'],data['Temperature in C'])
plt.ylabel('Temperature in C')
plt.xlabel('Depth in km')

plt.annotate('Lithosphere', xy=(0,0), xytext=(90,0))
plt.annotate('Asthenosphere', xy=(100,1100), xytext=(500,1100),
            arrowprops=dict(facecolor='yellow', shrink=0.02))
plt.annotate('Mantle', xy=(400,1900), xytext=(1000,1900),
             arrowprops=dict(facecolor='green',shrink=0.1))
plt.annotate('Outer Core', xy=(2800,3840), xytext=(3200,3840),
            arrowprops=dict(facecolor='orange'))
plt.annotate('Inner Core', xy=(5100,5400), xytext=(5100,4300),
            arrowprops=dict(facecolor='red'))

# Note: the arrows on the graph point out where the specific layer begins

# Observe the following graph, it will also be needed to answer the questions below.
data = pd.read_csv("./Pressure_Data.csv")

# Note: 1 on the y-axis is equal to 1 x 10^6.
fig = plt.figure(figsize=(10,3))
plt.plot(data['Depth in km'],data['Pressure in bar'], 'r--')
plt.ylabel('Pressure [10^6bar]')
plt.xlabel('Depth [km]')

plt.annotate('Mantle', xy=(1500,1.5))
plt.annotate('Core', xy=(4800,1.0))

"""
Explanation: Questions

Where are earthquakes most likely to occur?
What is the name for movements between plates?
Using the data above, which earthquake caused had a stronger impact?
Using the link provided above, analyze the table given and identify each locations magnitude type along with its range.

Temperature and Pressure
Earth's internal temperature increases with depth.  This increase rate is not linear, though. As shown in the data below, the temperature increases quickly through the crust at about 20°C per kilometer. The temperature then increases more slowly as we descend through the mantle, sharply increases at the base of the mantle, and then increases slowly through the core. The temperature is around 1000°C at the base of the crust, around 3500°C at the base of the mantle, and around 5,000°C at Earth’s center.
End of explanation
"""


