Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import *
- from tkinter import *
- import tkinter.simpledialog
- import tkinter.messagebox
- root = Tk()
- w = Label(root, text="Quake Data")
- w.pack()
- #Load seismic data from file into a List called data (ignoring time column)
- #data file should be in same folder as this file
- #Your file name might be different
- data = []
- for line in open('PE44.EHN.ascii'):
- parts = line.split()
- #applify data save as an int
- data.append(int(float(parts[1])*250))
- #1. Traverse List, find average, max and min. Output them.
- #2. If the max was greater than 200, output that there was a possilbe earthquake
- #setup graph
- setup(width=1850, height=800)
- pen = Pen()
- pen.speed('fastest')
- pen.up()
- x = -920
- pen.goto(-920,0)
- pen.down()
- #3. Graph Data sampling every 60 entries. In other words, graph, skip 59, graph, skip 59, etc.
- # Use pen.goto(x, y) to draw the lines. y is the seismic reading.
- # x will be time. Increment x everytime through the loop so the graph continues to the right.
- #4. If the data value is greater than 200 or less than -200, change the pen color to red.
- # Otherwise, change it back to black.
- #5. Change the Data sampling to every 30 entries; every 100 entries.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement