1 Day – Met Office Python Overview

A 1 day introduction to the Met Office Python programming environment designed to give a high level overview of Python, Numpy, plotting and Iris as used for climate research and forecasting. The primary purpose is to give staff enough knowledge to read and potentially modify Python programs used for numerical analysis.  This course is not an exhaustive introduction to Python and simplifies aspects of writing programs in order to introduce as many topics as possible, this courses is not intended as a replacement for the full Python Programming or Numeric Python for Scientists courses.

Prerequisites

This course is designed primarily for interns with experience of using a Windows PC and some knowledge if numerical analysis using environment such as Excel formula, Matlab or R. A knowledge of basic programming concepts such as IF statements and FOR loops gained from any other programming language is expected, but no prior knowledge of Python is required.

Learning Objectives

The course will introduce the basic principles of Python programs without providing too much detail, specifically:

  • Understanding Python syntax
  • Built in data types and objects
  • Flow control statements and functions
  • Reading and writing text files
  • Numerical data analysis and plotting

Delivery

This course comprises a mix of theory, demonstrations and hands on exercises. Staff will be given several short, exercises to attempt during each session, and staff will be shown how to configure and use the Eclipse IDE to develop and run Python programs.

Topic Covered

Python  Fundamentals

  • Running Python programs from the command line and the Eclipse IDE
  • Python overview, numbers strings and object notation
  • Libraries and importing modules
  • IF statement

Collections & Loops

  • WHILE loops
  • Lists and list manipulation
  • FOR loops

Functions & File I/O

  • Defining and calling functions
  • Function parameters and return values
  • File I/O, reading and writing text files

Numpy, Plotting and Iris

  • Numpy arrays
  • Plotting line charts
  • Overview of Iris cubes and contour plots