Scientific Programming, Analysis, and Visualization with Python. Mteor 227 Fall 2015



Similar documents
Introduction to Python

McGraw-Hill The McGraw-Hill Companies, Inc.,

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Programming Languages & Tools

BEST WEB PROGRAMMING LANGUAGES TO LEARN ON YOUR OWN TIME

Chapter 13: Program Development and Programming Languages

Introduction to Python

Data Analytics at NERSC. Joaquin Correa NERSC Data and Analytics Services

HPC Wales Skills Academy Course Catalogue 2015

Python for Data Analysis and Visualiza4on. Fang (Cherry) Liu, Ph.D PACE Gatech July 2013

Computational Mathematics with Python

Chapter 12 Programming Concepts and Languages

Chapter 13: Program Development and Programming Languages

Python for Scientific Computing.

Computational Mathematics with Python

Computational Mathematics with Python

Postprocessing with Python

The Julia Language Seminar Talk. Francisco Vidal Meca

University of Hull Department of Computer Science. Wrestling with Python Week 01 Playing with Python

Global Variables. However, when global variables are used in a function block or control modules, they must be declared as external

Availability of the Program A free version is available of each (see individual programs for links).

CRASH COURSE PYTHON. Het begint met een idee

HEP data analysis using jhepwork and Java

Fall 2012 Q530. Programming for Cognitive Science

22S:295 Seminar in Applied Statistics High Performance Computing in Statistics

Unlocking the True Value of Hadoop with Open Data Science

CSCI 3136 Principles of Programming Languages

CE 504 Computational Hydrology Computational Environments and Tools Fritz R. Fiedler

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

Introduction to ACENET Accelerating Discovery with Computational Research May, 2015

The Fastest Way to Parallel Programming for Multicore, Clusters, Supercomputers and the Cloud.

Introducing the.net Framework 4.0

Big Data Paradigms in Python

Session 85 IF, Predictive Analytics for Actuaries: Free Tools for Life and Health Care Analytics--R and Python: A New Paradigm!

6.170 Tutorial 3 - Ruby Basics

Semester Review. CSC 301, Fall 2015

Python Programming: An Introduction to Computer Science

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

Part I Courses Syllabus

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

Overview of HPC Resources at Vanderbilt

Using Python in Climate and Meteorology

Data Analysis with MATLAB The MathWorks, Inc. 1

CHAPTER 1 ENGINEERING PROBLEM SOLVING. Copyright 2013 Pearson Education, Inc.

Integrating TAU With Eclipse: A Performance Analysis System in an Integrated Development Environment

An Introduction to Using Python with Microsoft Azure

Open Access Design of a Python-based Wireless Network Optimization and Testing System

Lesson 1 Introduction to Rapid Application Development using Visual Basic

Beginners Shell Scripting for Batch Jobs

Why (and Why Not) to Use Fortran

CHAPTER 1: CLIENT/SERVER INTEGRATED DEVELOPMENT ENVIRONMENT (C/SIDE)

Programming PHREEQC Calculations with C++ and Python A Comparative Study

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

Bachelors of Computer Application Programming Principle & Algorithm (BCA-S102T)

1/20/2016 INTRODUCTION

Effective Java Programming. efficient software development

SUNPY: PYTHON FOR SOLAR PHYSICS. AN IMPLEMENTATION FOR LOCAL CORRELATION TRACKING

Python programming guide for Earth Scientists. Maarten J. Waterloo and Vincent E.A. Post

EARTH SYSTEM SCIENCE ORGANIZATION Ministry of Earth Sciences, Government of India

High-Level Programming Languages. Nell Dale & John Lewis (adaptation by Michael Goldwasser)

Sourcery Overview & Virtual Machine Installation

MPJ Express Meets YARN: Towards Java HPC on Hadoop Systems

Using WestGrid. Patrick Mann, Manager, Technical Operations Jan.15, 2014

Lesson 06: Basics of Software Development (W02D2

Software: Systems and. Application Software. Software and Hardware. Types of Software. Software can represent 75% or more of the total cost of an IS.

CSE 307: Principles of Programming Languages

Outline. hardware components programming environments. installing Python executing Python code. decimal and binary notations running Sage

Levels of Programming Languages. Gerald Penn CSC 324

Chapter 6: Programming Languages

Analysis Programs DPDAK and DAWN

CS 106 Introduction to Computer Science I

IF The customer should receive priority service THEN Call within 4 hours PCAI 16.4

GR.jl Plotting for Julia based on GR

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008

The Benefits of Modular Programming

Beginning to Program Python

Practical Programming, 2nd Edition

Optimization tools. 1) Improving Overall I/O

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

The Clean programming language. Group 25, Jingui Li, Daren Tuzi

Instructor Özgür ZEYDAN BEU Dept. of Enve. Eng. CIV 112 Computer Programming Lecture Notes (1)

Multicore Parallel Computing with OpenMP

Astronomical Instruments Software System Design

Modern Software Development Tools on OpenVMS

A Python-Based Simulation Code Repository for Complex Systems Education. Hiroki Sayama

A Modular Approach to Teaching Mobile APPS Development

Computer Layers. Hardware BOOT. Operating System. Applications

CSCE 110 Programming I Basics of Python: Variables, Expressions, and Input/Output

Creating a Java application using Perfect Developer and the Java Develo...

3 SOFTWARE AND PROGRAMMING LANGUAGES

Transcription:

Scientific Programming, Analysis, and Visualization with Python Mteor 227 Fall 2015

Python The Big Picture Interpreted General purpose, high-level Dynamically type Multi-paradigm Object-oriented Functional programming features

Python is Interpreted, not Compiled Python is an interpreted programming language. The difference between an interpreted language and a compiled language (such as Fortran or C++) is: Compiled language: the entire source code text file is read and then and then converted into an executable code (in machine language) that can be directly executed by the operating system. This executable code is often optimized for the operating system. Interpreted language the source code text file is read line-by-line and each statement converted into machine language and executed before the next line is read, or the text-file is read completely and converted into an intermediate code that is then further converted into machine language for execution by the operating system.

About Python Compiled languages are generally more efficient and faster, since the conversion to machine language only occurs one time and the machine language code can be executed whenever the program needs to be run. In an interpreted language, the interpretation process occurs every time the program is run. Interpreted languages are often more flexible and changes can be easily made to the program at runtime.

Python is Dynamically Typed Most variables do not need to be declared as real, integer, string, etc. The type of a variable is defined by the value assigned to it. The type of a variable can change throughout the program execution. The opposite of dynamically-typed is statically-typed. Fortran and C are examples of statically-typed languages.

Python is Object-oriented Although Python is an object-oriented language, we will often use it in a more traditional procedural or functional programming paradigm. For those who want to truly learn about what object-oriented means, and how to use it to its fullest, I recommend a book titled The Objectoriented Thought Process by Matt Weisfeld.

Python is Open-source and Free Unlike with MATLAB or IDL there are no licenses required. There are companies such as Enthought that put together high quality Python bundles and support them for a fee. The advantage is that the libraries supported by these bundles work together with few bugs. However, the same libraries can be assembled and installed freely from other sources, though there may be some additional headaches sorting out dependencies, etc.

Versions of Python Python is a young and fast moving language Python 1.0: 1994 Python 2.0: 2000 Python 2.7: 2010 Python 3.0: 2008 Python 3.4: 2014 Python 3.X does not maintain backward compatibility with the older versions of Python Thus, code developed for Python 2.X may not work with Python 3.X, and viceversa. New, large projects should be written in 3.X For research code, often depending on exotic modules, use 2.7. So much code and so many libraries have been developed for Python 2.X that most persons in the scientific community still use 2.X. My plan is to use Python 2.7 in this course.

Basic Shell Scripting/Programming with Python Shell: a user interface for access to an operating system s services. The outer layer between the user and the operating system. The first line in your program needs to be: #!/usr/bin/python This line tells the computer what python interpreter to use.

Python IDLE / Eclipse/Ipython IDLE: Nice interactive development environment. Eclipse: a multi-language integrated development environment that is popular on campus. You are free to use the command line, Eclipse, IDLE, or any other text editor or interactive development environment you choose. For now, we will focus on Ipython Notebook.

Advantages for Scientific Computing Large and fast growing user community. Large and fast growing number of libraries for scientific computing. Well integrated with popular existing codes. Highly extensible, large collection of addon packages. Easy communication with R, C, Fortran

When to use Python Always! Except.. You need the speed of C or Fortran You can re-use significant code written in other languages. You do HPC (using MPI, OpenMP) You can profit from a non-python tradition in your field or workgroup. Something else is better for the task R, Matlab at times, for example

Documentation and Books One book that I use more than any other for reference is: Python: Essential Reference (4th ed.) by David M. Beazley. Another book that may be helpful is: Python Pocket Reference by Mark Lutz.

Online Documentation Much of the Python documentation, as well as that for its libraries, is online. Websites that I frequently visit for documentation are: Python v2 documentation page: http://docs.python.org/genindex.html MATPLOTLIB documentation page: http://matplotlib.sourceforge.net Numerical Python (NumPy) documentation page: http://docs.scipy.org/doc/numpy/reference ScientificPython (SciPy) documentation page: http://docs.scipy.org/doc/scipy/reference

Online Documentation There is a growing community of Python users in the atmospheric and oceanic sciences community. They have their own webpage/blog called PyAOS, which can be found at http://pyaos.johnny-lin.com.