Beyond the Mouse: Computer Programming and Automation for Geoscientists
GEOS 436/636
Fall 2017
Tu-Th 3:40-5:40, Reichardt 316 (G&G Computer Lab)
Instructor: Jeff Freymueller
x7286 Elvey 413B jfreymueller@alaska.edu
TA: Shanshan Li
sli11@alaska.eduOffice 413H Elvey
Office Hours: By appointment
Last Updated: August 25, 2017
Contents
Introduction
Course Topics
Prerequisites
Textbook
Student Learning Outcomes
Grading Scheme
Policies and Make-up Labs
Detailed Schedule
Introduction
[return to top]
In the (geo)sciences - as in many other disciplines - we collect data which need to be analyzed in ways that depend on the problem posed. The ability to modify your working environment according to your needs instead of having it dictate how you approach a problem is invaluable. This is especially true in a setting that is supposed to generate fresh knowledge. Also, we do not want to waste time by repeating the same steps again and again, and ... again. Doing repetitive, boring tasks leads to errors. A computer (the machine, and earlier the person) exists to perform such routines rapidly, reliably and repetitively: it takes in data, manipulates the data following your commands, and produces a result. The point of writing computer programs is to automate an intellectual challenge that has been solved and make it reusable at all times - for yourself and ideally for others. 21st century scientific research frequently involves manipulation or analysis of very large data sets, or the development of numerical models; this work can only be used effectively by scientists who can make software tools themselves. Accordingly, the geophysics graduate curriculum now expects students to be able to write simple computer programs. This course will teach you the basic techniques and skills to do this.
This course will teach you how to make simple tools that will allow you to read in and massage data in exactly the way you want, and plot or visualize the results. We will start out manipulating your thinking, introduce you to programming in general, and then take off into specific working environments namely Unix/Linux and Matlab while teaching you how to map your data using GMT and create simple web pages by writing the HTML yourself. All of this is easier than you might think - you simply have to get up over the initial part of the learning curve. We will cover many things in a short amount of time, which means that we will give you many pointers that you can follow up on depending on your needs. There is a tremendous amount of reference material (and examples to adapt) available on the web. We encourage you to play with the tools we are teaching you to use beyond the course assignments, and do things with them that are fun for you. The more you do, the more you will learn.
The use of scripting and well-documented tools is not just my idea; it is widely accepted as a good practice. The paper "Ten Simple Rules for Reproducible Compuational Research" by Sandve et al. (2013) is a good example.
Course Topics
[return to top]- Basic computer programming concepts, using MATLAB
- Unix tools to enhance automation, including making figures and maps with GMT
- HTML and creating your own web page
Prerequisites
[return to top]- GEOS 436: Senior standing or permission of instructor.
- GEOS 636: Graduate standing.
Textbook
[return to top]
Essential MATLAB For Engineers and Scientists, 5th edition. There is now a 6th
edition, and that or the 3rd or 4th Edition are both OK, although we will have to confirm
the section numbers as sometims they change.
Student Learning Outcomes
[return to top]
By actively participating in this course you will become significantly more proficient at:
- Breaking problems down into a series of steps.
- Organizing data and tools to make automated work easier.
- Writing and understanding how to read computer programs in MATLAB.
- Writing and understanding how to read Unix/Linux shell scripts.
- Making publication-quality maps and figures using GMT (Generic Mapping Tools).
- Using HTML and CSS for web pages.
Grading Scheme
[return to top]
This 2 credit class is pass/fail. The class assignments are primarily lab exercises, specifically computer programs written in the computer lab. We use software that is available to students at no cost (for use within the UAF network), so all students could also install and use it on their own computer if they wish. The computer lab is also available for students to use at other times, if they need to finish an assignment outside of lab. During the first third of the semester, additional short homework assignments will be given outside of lab (these do not require any particular computer or software).
Grading is based on weekly lab exercises, homework assignments, a final project, and the presentation of that project in the form of a web page or pages. There will be a total of 12 graded lab assignments, equally weighted, and all other assignments except for the final project itself are scored points equivalent to a lab assignment or a fraction of that.
Graduate Students
- Labs+Homework+Project Presentation 70% of total
- Final Project 30% of total
- Each Lab assignment 1 Lab
- Each Homework assignment 1/2 Lab
- Final Project Presentation 1 Lab
Undergraduate Students
- Labs+Homework+Project Presentation 70% of total
- Attendance and Participation 30% of total
- Each Lab assignment 1 Lab
- Each Homework assignment 1/2 Lab
- Final Final Presentation 1 Lab
Passing >= 65%
The homework and lab exercises consist of basic application of methods and practices presented in class. The labs help you apply things taught in class. The complexity of the labs varies. Usually they consist of a simple introduction problem to get you used to the environment, understand new commands, etc. In a second part you will apply this in a slightly more complex way to data, or simply write more complex code.
The final project will (hopefully) be specific to your research project. We want to encourage you to set up an efficient and safe environment in which you apply the methods and tools introduced in class.
Graduate students are expected to carry out a complete project within their own field of specialization (this can and should be something that helps them in their own research). The project will be presented in the form of a web page or pages, for which the student will write the HTML using the templates provided in class and used in one of the labs. Undergraduates will substitute a presentation of some of their own work from the labs in place of an independent project, also presented in the form of a web page or pages.
There are several styles of project that a student could take on, depending on
their needs. Flexibility in this regard is beneficial for the students, as they
learn more by doing more, and do more when they are excited about and see the
relevance of the project. The project must be implemented in code using one of
the tools used in the class (or a different tool with instructor permission).
The students must turn in complete code, raw data files, etc, so that the instructor
could run their code and replicate their results. Code must be adequately commented.
All of the code and data files should be linked on the web page or pages.
Sample projects include one of these, at a minimum: (a) reading in data and doing
useful manipulation and visualization of the data; (b) constructing a coherent
suite of scientific figures or visualizations of data; (c) developing and running
a numerical model; (d) writing a program or programs to automate a task that must
be done repeatedly (for example, a data processing or analysis task), and using
this program to run a substantial amount of data.
In the beginning of the semester you will provide us with
a snapshot of your project directory (If you have one). Send rudimentary data files,
and any scripts/programs should be executable. If you do not have such a project
directory, make one up! (Tell us it is made up). In that case, tell us how you would
organize and name files, what kind of data they contain, and how you would store
other information. You will do the same at the end of
the term through your final project, and tell us how you improved or changed the
organization to make working with your data easier to automate. If your project
involved doing something totally new, you will tell us why you chose to organize
things as you did.
Note: Everything will be done for this course as of December 10, just before Finals Week.
You are subject to the UAF Student Code of Conduct.
We will work with the Office of Disabilities Services (203 WHIT, 474-5655) to provide
reasonable accommodation to student with disabilities.
Late assignment will be penalized by 25% off for each class period after the due
date. Exceptions can be granted in advance for students who have University sponsored
activities that will force them to miss class (for example, fieldwork or attending
a conference for graduate students). Arrangements for this need to be made in advance.
Makeup versions of labs will be provided if we have a convincing reason to do so.
All MATLAB lab assignments must be turned in before we begin
the Unix shell and GMT parts of the course.
Any makeup or late assignments must be completed prior to the final project presentations.
Each lecture title is a link to a web page for that lecture or lab.
Policies, late assignments, and makeup-labs
[return to top]
Detailed Schedule (DRAFT)
[return to top]
Day |
Date |
Lecture Topic |
Tue |
Aug 29 |
1. Thinking Programs;
|
Thu |
Aug 31 |
1. Thinking Programs Lab;
|
Tue |
Sep 5 |
2. Variables;
|
Thu |
Sep 7 |
2. Variables Lab;
|
Tue |
Sep 12 |
3. Variables and Functions;
|
Thu |
Sep 14 |
3. Variables and Functions Lab;
|
Tue |
Sep 19 |
4. Control Structures;
|
Thu |
Sep 21 |
4. Control Structures Lab;
|
Tue |
Sep 26 |
5. MATLAB I/O 1;
|
Thu |
Sep 28 |
5. MATLAB I/O 1 Lab;
|
Tue |
Oct 3 |
6. MATLAB Plotting and Graphics;
|
Thu |
Oct 5 |
6. MATLAB Plotting and Graphics Lab;
|
Tue |
Oct 10 |
Debugging;
|
Thu |
Oct 12 |
Live MATLAB;
|
Tue |
Oct 17 |
7. Unix Tools 1;
|
Thu |
Oct 19 |
7. Unix Tools 1 Lab;
|
Thu |
Oct 24 |
Live MATLAB; GUEST CODERS!;
|
Thu |
Oct 26 |
Live MATLAB; GUEST CODERS!;
|
Tue |
Oct 31 |
8. Unix Tools 2;
|
Thu |
Nov 2 |
8. Unix Tools 2 Lab;
|
Tue |
Nov 7 |
9. GMT 1;
|
Thu |
Nov 9 |
9. GMT 1 Lab;
|
Tue |
Nov 14 |
10. GMT 2;
|
Thu |
Nov 16 |
10. GMT 2 Lab;
|
Tue |
Nov 21 |
11. Live Shell. No material to download;
|
Thu |
Nov 23 |
NO CLASS: Thanksgiving;
|
Tue |
Nov 28 |
12. HTML;
|
Thu |
Nov 30 |
13. HTML Lab;
|
Tue |
Dec 5 |
WORK ON FINALIZING CLASS PROJECTS;
|
Thu |
Dec 7 |
Student Presentations;
|
END OF CLASSES
Dr. Jeffrey T. Freymueller
Professor of Geophysics
Geophysical Institute
University of Alaska, Fairbanks
Fairbanks, AK 99775-7320