Question
Using the data in irma.csv, your irma function must show hurricane Irma's path. Your solution must include the following: Correctly show each point in the
Using the data in irma.csv, your irma function must show hurricane Irma's path. Your solution must include the following:
Correctly show each point in the data file (together with lines between each point)
At each point, you must display what category the storm is, if it has hurricane strength winds, otherwise, draw no text.
Color code the hurricane strength:
Red for Category 5
Orange for Category 4
Yellow for Category 3
Green for Category 2
Blue for Category 1
Black if not hurricane strength
The thickness of the line should change in proportion to the hurricane category.
The data from the irma.csv file:
Below is irma_setup:
import turtle def irma_setup(): """Creates the Turtle and the Screen with the map background and coordinate system set to match latitude and longitude. :return: a tuple containing the Turtle and the Screen DO NOT CHANGE THE CODE IN THIS FUNCTION! """ import tkinter turtle.setup(1025, 600) # set size of window to size of map wn = turtle.Screen() wn.title("Hurricane Irma") # kludge to get the map shown as a background image, # since wn.bgpic does not allow you to position the image canvas = wn.getcanvas() turtle.setworldcoordinates(-110, 0, 0, 50) # set the coordinate system to match lat/long map_bg_img = tkinter.PhotoImage(file="atlantic-hurricane-tracking-map.gif") # additional kludge for positioning the background image # when setworldcoordinates is used # for some reason I have to move it 15 less than than 1025 width canvas.create_image(-1010, -600, anchor=tkinter.NW, image=map_bg_img) t = turtle.Turtle() wn.register_shape("hurricane.gif") t.shape("hurricane.gif") return (t, wn, map_bg_img) def irma(): """Animates the path of hurricane Irma """ (t, wn, map_bg_img) = irma_setup() # your code to animate Irma goes here # BEFORE the call to wn.exitonclick() wn.exitonclick() if __name__ == "__main__": irma()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started