Sunsets and sunrises

Aug 3, 2023 · 2 min read

Have you ever wondered how sunset, sunrise, and day lengths compare globally?

Grades 5 - 9

This exercise visualizes the specific times at which the sun rises and sets in various geographical locations at different times of the year. These times vary depending on the rotation of the Earth on its axis, time zones, and changes in the Earth’s atmosphere.

To answer our question we:

  • Utilized API data from this website https://sunrise-sunset.org/api
  • Compared sunset and sunrise visualizations based on inputted latitudes and longitudes

Visualizing the data

We began by inputting Calgary’s latitude and longitude into the API to see the current sunset and sunrise times in the region. We then manipulated aspects of the outputted data to improve the clarity of the visualization. The API outputs data in the 12-hour format. For ease of visualization and to better capture the differences between times, we converted the data into the 24-hour format.. Moreover, the times obtained from the API were in Universal Time Coordinated (UTC), but for visualization purposes, it’s more convenient to display the times using local time zones. To address this issue, we created a function that converts UTC into local times. Thankfully, using an online time zone converter (https://www.timeanddate.com/worldclock/converter.html) made the process much easier.

After addressing these major issues, we could visualize our sunset, sunrise, and day-length values.

The visualization reveals that sunrise times steadily decrease while sunset times and day lengths steadily increase during Spring. This increase is the result of the Earth’s rotation on its axis. During the spring season, the Northern Hemisphere leans towards the sun, leading to more daylight hours. The opposite occurs in the fall and winter seasons. During these months, the Northern Hemisphere leans away from the sun, leading to fewer daylight hours.

Reflect on what you see

Look and interact with the data visualizations above. When you hover your mouse over the plots, you’ll notice more information appears. You can also use the legend to make plots appear and disappear.

Think about the following questions.

  • What do you notice about these graphs?
  • What do you wonder about the data?

Use the fill-in-the-blank prompts to summarize your thoughts.

  • “I used to think _______”
  • “Now I think _______”
  • “I wish I knew more about _______”
  • “These data visualizations remind me of _______”
  • "I really like _______”

Learn how we visualized the data

Go to our walk-through (in Jupyter notebook format) to see how the data science process was applied to create these graphs, from formulating a question to gathering the data and analyzing the data with code.

Authors
Building tomorrow’s digital leaders
Developing data science tools for Canadian K12 classrooms