CERI 7104/8104
Data Analysis in Geophysics

TR 11:20-12:45
CERI "Mac Lab" (in the long building)

This course focuses on developing computer tools useful in scientific research. Topics to be covered include: UNIX environment (Mac), Python, MATLAB, Seismic Analysis Code (SAC), AWK, shell scripting, and Generic Mapping Tools (GMT). Learning to use computers requires extensive practice on your own - I will try to provide many examples and problems to work on for each class, but ultimately it is up to you to figure things out. Because this course is mainly computer lab based, attendance is mandatory, and all absences must be cleared in advance with the instructor.

Textbook: These is no text for this course. I will provide notes on the topics for each class, which you should read prior to coming to class in order to spend the majority of class time working on exercises. Additional resources are listed below, and Bob Smalley's past course webpages (here, here, and here) have additional useful resources.

Evaluation: 40% homework, 50% final project, 10% class participation

Homework: There are four required homework assignments. Homework will be assigned for each major computer tool that we study, and are spread out every few weeks. Homework should be "submitted" by placing the required code (with appropriate documentation), figures, and write-up in a clearly named directory in your public folder so that I can check your code. You are encouraged to work with other members of the class on homework assignments, but all write-ups, plots, and computer codes must be your own. Roughly half of each homework assignment forms part of the final project (see below), while the other half consists of independent problems for which I will assign a grade and distribute solutions.

Writing good, well-organized computer code is not something that can be done at the last minute. To encourage you to start your homework in advance, I have the following policy: I will not answer questions on a homework assignment after the Wednesday before it is due unless you have already asked a question showing you have put some thought and effort into the problem. Good ways to demonstrate this include: showing me your code, showing me an outline of your code, or asking a detailed (i.e. not a clarification) question that shows you have thought about how to best solve a problem.

Final Project: There is no final exam for this class. Instead, all students will conduct a data analysis project locating a large earthquake that combines all of the computer tools used in the course. The individual code pieces that will be needed will be assigned as homework problems throughout the semester, and then at the end of the term you will be required to piece them all together to carry out your analysis. You will turn in each part with the appropriate homework assignment, and I will give you comments and a preliminary grade. You will then have the opportunity to revise and improve your code before submission of the entire project at the end of the term. I will grade all of your code for the project and average the preliminary and final grades (i.e. you can get up to half credit on anything that you missed the first time). More details on the semester-long project will be announced as the term progresses.

Resources:
Software Carpentry (introductory programming materials for scientists)
Wikibooks computer programming
Python
Mathworks
IRIS SAC Manual
GMT

Documents:

Syllabus (8/28/18)
HW 1, Files for HW 1 (9/6/18), HW 1 Solutions, hw1_catalog_solution.py (10/11/18)
HW 2, Files for HW 2 (9/27/18), HW 2 Solutions, hw2.m, wave_loop.m, wave_vector.m, wave_matmul.m (11/8/18)
HW 3 (10/18/18), HW 3 Solutions, hw3.csh, rotate_data.macro, plot_recordsection.macro (11/15/18)
HW 4, parkfield_velocity.txt, Historic.kml, backprojection_amplitudes.txt, backprojection_focalmech.txt (11/6/18), HW 4 Solutions, hw4.csh, kml2txt.awk
Final Project, readsac.m, travel_time.m (11/6/18)

Reading:

Learning Unix for Mac OS X (beginner text on using the Unix command line on a Mac)
Best Practices for Scientific Computing (We will not cover everything mentioned in this article, but this is an excellent overview for developing programming skills, from the same people that developed Software Carpentry)

Schedule:

Notes and in-class lab exercises: html or pdf.

8/28/18: Intro, Notes on Backprojection
8/30/18: Unix 1
9/4/18: Unix 2
9/6/18: Python 1, average.py, square.py, perfect_square.py, divisible.py, primes.py
9/11/18: No Class (I am at a conference)
9/13/18: Python 2, lab5.py
9/18/18: Python 3, appendList.py, lab6.py
9/20/18: MATLAB 1, columnorder.dat, roworder.dat, columnorder_binary_double.dat, columnorder_binary_bigint32.dat, calcsqrt.m, checkprimes.m
9/25/18: MATLAB 2, newmadrid2015.txt
9/27/18: MATLAB 3, Matlab_Graphics.pdf, graphics_handle.m, MATLAB 5, lab11files.tar.gz (HW 1)
10/2/18: MATLAB 4, mtt.pdf, stringwave.m, stringwave_2loops.m, stringwave_1loop.m, stringwave_matmul.m
10/4/18: SAC 1
10/9/18: SAC 2
10/11/18: SAC 3
10/16/18: Fall Break
10/18/18: SAC 4, stack.tar.gz, SAC 5, waveformcc.tar.gz, stacknoisy.macro, correlate_template.macro
10/23/18: AWK 1, newmadrid2015raw.txt
10/25/18: AWK 2, imperial.kml (HW 2)
10/30/18: Shell Scripts 1
11/1/18: Shell Scripts 2, Shell Scripts 3, listinfo.csh, listsize.csh, canexecute.csh, adddate.csh, findpath.csh, makebackup.csh
11/6/18: GMT 1, gmt1.csh
11/8/18: GMT 2, gmt2.csh, nuvel_plates.txt (HW 3)
11/13/18: GMT 3, gmt3.csh, ceribroadband.txt, ceristrongmotion.txt, cerishortperiod.txt, 1999.catalog, japancmt2011.txt, pbo_velocities.txt
11/15/18: GMT 4, gmt4.csh, alu_slab1.0_clip.xyz
11/20/18: Work on Homework/Project
11/22/18: Thanksgiving
11/27/18: Work on Homework/Project
11/29/18: Work on Homework/Project (HW 4)
12/4/18: Work on Homework/Project
12/12/18: Final Project Due