SSBW - Jupyter Tutorial 2: Creating Your Own Jupyter Notebook

Mike Brudzinski, Miami University-Oxford

Author Profile

Summary

In this interactive tutorial built for a learning management system, students 1) create a Jupyter notebook on a Linux system, 2) practice using basic Python syntax, 3) use the ObsPy library to retrieve an earthquake catalog, 4) use matplotlib to plot earthquake magnitudes over time and a histogram of earthquake rates, 5) review the patterns associated with the 2009 L'Aquila earthquake sequence, and 6) revise a Jupyter notebook to apply the code to a different dataset.

Used this activity? Share your experiences and modifications

Context

Audience

The IRIS Seismology Skill Building Workshop (SSBW), which is a free, online, open-access, large-enrollment, 12-week summer workshop for upper level undergraduates.

Skills and concepts that students must have mastered

This assignment builds on prior experience using basic Python command syntax and variables, using a Jupyter notebook creation environment, basic components of the ObsPy library (catalog objects, Client functions), basic use of matplotlib functionality for making plots, and the ability to retrieve relevant information about programming and seismology from internet research or help pages.

How the activity is situated in the course

This is assignment number 32 of 35 in the Seismology Skill Building Workshop (SSBW).

Goals

Content/concepts goals for this activity

Proficiency with creating Jupyter notebooks, Python, ObsPy, matplotlib, object structures, earthquake magnitudes and rates over time, foreshock sequences, science communication.

Higher order thinking skills goals for this activity

Retrieving relevant information from digital sources to accomplish tasks, using correct programming syntax, evaluating and describing computing output in the context of science concepts.

Other skills goals for this activity

Description and Teaching Materials

Students will:
1. Review the details of the 2009 L'Aquila earthquake sequence
2. Create a Jupyer notebook using Python on their Linux virtual machine
3. Generate different types of cells (markdown, code input, output), using some html formatting
4. Use the ObsPy Client functionality to get an earthquake catalog
5. Store the event times and magnitudes in arrays for plotting using a loop
6. Plot earthquake magnitudes over time using matplotlib functions (dates and plot_date)
7. Plot a histogram of earthquake rate over time using matplotlib functionality (axes)
8. Revise the notebook to retrieve a catalog from a different region and make the same type of plots

 

Teaching Notes and Tips

This assignment was constructed in the Moodle learning management system, and has been exported in the GIFT format. More information about the syntax of this format can be found here: https://docs.moodle.org/en/GIFT_format

Assessment

This assignment is automatically graded by the learning management system. The number of questions of each type used are:
16 multiple choice questions
5 multiple answer question
2 numeric questions (quantifying output, measurement, time calculation)
3 short answer (auto-graded) question
3 free response (all accepted) question

References and Resources

During the Seismology Skill Building Workshop, students are provided with a virtual Linux machine that was tailored to include the software specifically needed to complete the assignments. This software is all freely available on the internet, but interested parties are encouraged to contact the instructor for access to this tailored virtual machine.

Advertisement