Python

Computing Environment

The main tools being used in this course is Python and Jupyter Notebook. Why are we going to learn python in this course? The scope of this class is to read atmospheric and oceanic datasets, do spatial, temporal and spectral analysis, and present the data graphically. Python provides an environment for us to fulfill those tasks seamlessly without asking too much time and effort to pay. Also, learning Python may open up other possibilities in your future because it is very popular computer languages these days. »

Python

The material here is based on the Chapter 3-5 in “A Hands-On Introduction to Using Python in the Atmospheric and Oceanic Sciences” by Johnny Wei-Bing Lin. Python, like any other programming language, has variables and all the standard control structures. We will go though Python’s basic data and control structures that support procedural programming. Then we will explore how to use arrays, followed by file input and output. A few list of changes in Python 3. »

Statistical analysis

Confidence intervals Linear Regression Correlation This lecture is based on the Chapter 3 in Data analysis methods in Physical Oceanography by Thomson and Emery. Sample distribution Fundamental to any form of data analysis is the realization that we are usually working with a limited set (or sample) of random events drawn from a much larger population. To describe the sample, we often use the concept of the sample mean. »

Basic Data and Control Structures

1. Overview of basic variables and operators Unlike languages like Fortran, Python is dynamically typed, variables take on the type of whatever they are set to when they are assigned. Thus, a=5 makes the variable a an integer, but a=5.0 makes the variable a floating point number. Additionally, because assignment can happen anytime during the program, this means you can change the type of the variable without changing the variable name. »

Python

I refer to Unidata online python training page for this page. I recommend you to visit Unidata Online Python Training page. The main program language we will use in this course to handle atmospheric data is python. Before getting into “What is Python?”, here is one of the statements that shows why we want to learn it I have used a combination of Perl, Fortran, NCL, Matlab, R and others for routine research, but found out this general- purpose language, Python, can handle almost all in an efficient way from requesting data from remote online sites to statistics, and graphics. »

Start Python / Jupyter Notebook

This page guides you how to use Python and Jupyter Notebook using the example, Celsius and Fahrenheit converter. When you want to convert the unit from Fahrenheit to Celsius, the formula is: From Celsius to Fahrenheit, the formula is: Python To start Python, you can type python in the terminal. $ python Then you may see that the prompt has been changed as Python 3.6.3 |Anaconda, Inc. »

Dealing with real data

The atmospheric and oceanic sciences (AOS) are “data” intensive fields, whether data refers to observations or model output. Most of the analysis we do involve datasets, and so facilities for file input/output (i/o) are critical. Fortunately, Python has very robust facilities for file i/o, and we will be dealing with realistic datasets using Python. Data in the text file Some data is not too big and stored in the text file. »