Doing a li6le astronomy with. Python. Ryan Cooke (K16) These slides & examples:

Size: px
Start display at page:

Download "Doing a li6le astronomy with. Python. Ryan Cooke (K16) These slides & examples:"

Transcription

1 Doing a li6le astronomy with Python Ryan Cooke (K16) These slides & examples:

2 An aside Let s begin by installing ATLAS: (AutomaIcally Tuned Linear Algebra SoKware) > cd ~! > mkdir local! You need to idenify a directory where you can keep your sokware. A datadisk would be ideal if you already have one, if not, your home directory is fine (i.e. /home/<your name>). Go to this directory. > mkdir software! > cd software! > mkdir python! > cd python! > mkdir bin py-lib scripts numpy scipy pymc examples!

3 Now open your.mytcshrc file > emacs.mytcshrc &! An aside and include the following code: # Settings for PYTHON! setenv PYDIR /usr/local/lib/python2.6! setenv MYPYDIR /home/rcooke/software/python! setenv PYTHONPATH $MYPYDIR/scripts! setenv PYTHONPATH ${PYTHONPATH}:$MYPYDIR/py-lib! setenv PATH ${PATH}:$MYPYDIR/bin! setenv BLAS /home/rcooke/local/lib/libf77blas.a! setenv LAPACK /home/rcooke/local/lib/liblapack.a!

4 Now open your.mytcshrc file > emacs.mytcshrc &! An aside and include the following code: # Settings for PYTHON! setenv PYDIR /usr/local/lib/python2.6! setenv MYPYDIR /home/rcooke/software/python! setenv PYTHONPATH $MYPYDIR/scripts! setenv PYTHONPATH ${PYTHONPATH}:$MYPYDIR/py-lib! setenv PATH ${PATH}:$MYPYDIR/bin! setenv BLAS /home/rcooke/local/lib/libf77blas.a! setenv LAPACK /home/rcooke/local/lib/liblapack.a! To save some Ime, go to to get a copy this text, and just change the red highlighted text from the file install_notes.txt to your sevngs.

5 An aside Now go into the packages directory, which is located: and download the atlas package into the sokware directory. Type the following command: > bunzip2 c atlas tar.bz2 tar xfm -! > cd ATLAS! Now download the lapack package and put it in this ATLAS directory. Type the following into the command line: > mkdir BUILD! > cd BUILD! >../configure (see install_notes.txt for full command)! > make! ~10 mins Let s get started!!!

6 Before I begin Here are some great slides which describe the correct programming technique: Some thoughts on coding with Python Andrew Pontzen These slides & examples

7 Python vs IDL Open source (free) Widely used Clean Syntax Loads of Packages 1/20 Astronomers Creates nice GUIs Commercial (costs money) Astronomers (almost) only! Syntax is crap(ish) Loads of Astro Packages 18.9/20 Astronomers Forget about it!!! Which should you pick?

8 Which should you pick You will probably use what your Ph.D. supervisor uses which is likely to be IDL (or Fortran/C in some cases). Python is officially THE language supported by the University CompuIng Service you can ask them for help! There are some great Python courses offered through the University and they re free! Go to the following website and enter the search term: python h6p:// You should pick the language you feel most comfortable with.

9 Recommended Python Packages Science/Numerical SciPy, NumPy PloVng Matplotlib, Veusz Astro Tools Astropysics, AstroLib, PyRAF FiVng Tools mpfit, pymc GUIs pygtk, PyQT Arbitrary Precision mpmath Fits files PyFITS (We ll start by installing the bold packages today) See the AstroPython website for useful notes: h6p://

10 The Aim of this Lecture Course Set you up with Python at the IoA. Teach you the easy way to set yourself up with Python! Do a li6le useful Astronomy Create fake data Fit this data with our models using two methods: Markov chain Monte Carlo (MCMC) χ 2 - minimisaion

11 GeVng you setup with Python There are 4 ways you can do this!!! Be the IoA administrator which you re not! Mac OS X User installaion virtual- python Tradi8onal approach PYTHONPATH

12 Let s coninue with our install The last command we gave was make. Now do the following: > cd lib! > make shared! > make ptshared! > cd../! > make install! check that this worked by typing the following: > echo $BLAS! > echo $LAPACK! Great! Now go to: and download a copy numpy, scipy, and pymc. Put these three packages in your python directory ($MYPYDIR)

13 We re almost there! Now type the following command into a terminal: > emacs ~/.pydistutils.cfg &! This file should be blank. Enter the following text in this file: [install]! install_lib = $MYPYDIR/py-lib! install_scripts = $MYPYDIR/bin! Close this file and then install numpy by entering the following into a terminal > cd $MYPYDIR! > gunzip numpy tar.gz! > tar xvf numpy tar! > cd numpy-1.6.1! > python setup.py build --fcompiler=gnu95! > python setup.py install! ~1 min

14 We re almost there! Now install scipy in much the same way: > cd $MYPYDIR! > gunzip scipy b2.tar.gz! > tar xvf scipy b2.tar! > cd scipy b2! > python setup.py build --fcompiler=gnu95! > python setup.py install! ~5 mins and again for pymc: > cd $MYPYDIR! > unzip pymc-devs-pymc-raked_sandbox-159-g28953e9.zip! > cd pymc-devs-pymc-28953e9! > python setup.py config_fc --fcompiler=gnu95 build! ~30 s > python setup.py install! FantasIc! These have all been installed in $MYPYDIR/py-lib/

15 Now let s do it the easy way! Download a copy of setuptools from the packages directory. Place this in your python directory (i.e. $MYPYDIR/py-lib/). Issue the following commands: > cd $MYPYDIR! > sh setuptools-0.6c11-py2.6.egg! We are now ready to use easy_install! Try this: > easy_install numexpr! > easy_install matplotlib! That s easy! These have all been installed in $MYPYDIR/py-lib/ There are some other useful scripts that we will use in this course. To make use of these, download mpfit.py and MCMC_errors.py from the packages directory and put them in your python scripts directory (i.e. $MYPYDIR/scripts/). These scripts are just single.py files (not packages) and handle a few tasks, or have a handful of useful funcions.

16 How do we do Python? Write a script and execute it with the python command in a terminal > python myscript.py! ! >! Use Python on the command line > python! >>> import numpy as np! >>> print np.pi! ! Use ipython on the command line (much, much be6er) > ipython! In [1]: import numpy as np! In [2]: print np.pi! Out[2]: !

17 How do we do Python? We ll be wriing python scripts (i.e. filename.py files). Here s a crash course: # A hash symbol (#) indicates a comment line! # We can use the packages we have just! # installed with the import command:! import numpy! # To print text to a terminal use the print command:! print The number pi is equal to, numpy.pi! # We can also rename numpy to np! import numpy as np! print The number pi is equal to, np.pi! # or just import the function pi:! from numpy import pi! print The number pi is equal to, pi!

18 How do we do Python? # Here s an example of how to create a number array! import numpy as np! numbers = np.array([1,2,3,4,5])! # Or you could use! # (start at 1, end at 6, separate numbers by 1):! numbers = np.arange(1,6,1)! # We can write simple definitions (or functions)! # to perform certain tasks:! import numpy as np! def info(thing):! # Note that we now have to indent!! print This array has, len(thing), elements! print thing[0], thing[1]! somearray = np.array([np.pi, 2*np.pi, 3*np.pi])! info(somearray) # Call the definition!

19 What we are going to do Go to your python directory and cd into the examples folder (cd $MYPYDIR/ examples). Open a file called gen_fakedata.py (gedit gen_fakedata.py &) Import numpy, and pyplot (part of the matplotlib package) Create a definiion for a Gaussian (use numpy.exp for the exponenial) Be sure to allow four free parameters (offset, amplitude, mean, dispersion). Generate a wavelength array between Å with 1Å increments. Create an array with four elements these numbers will be the parameters of the Gaussian emission line we will synthesise (set the mean to ). Generate a Gaussian emission line! Add some noise to the flux nothing is ever perfect Create an error array that stores this noise value at each wavelength. Write this generated data to a file called my_fakedata.dat Plot the data you have created! That s it for now! Next Lesson we ll a6empt to fit this data with a Gaussian model.

zap Documentation Release 1.0.dev86 Kurt Soto

zap Documentation Release 1.0.dev86 Kurt Soto zap Documentation Release 1.0.dev86 Kurt Soto February 03, 2016 Contents 1 Installation 3 1.1 Requirements............................................... 3 1.2 Steps...................................................

More information

Introduction to Python

Introduction to Python Introduction to Python Ryan Gutenkunst Molecular and Cellular Biology University of Arizona Before we start, fire up your Amazon instance, open a terminal, and enter the command sudo apt-get install ipython

More information

Week Two. Arrays, packages, and writing programs

Week Two. Arrays, packages, and writing programs Week Two Arrays, packages, and writing programs Review UNIX is the OS/environment in which we work We store files in directories, and we can use commands in the terminal to navigate around, make and delete

More information

Introduction to Scientific Computing with Python, part two.

Introduction to Scientific Computing with Python, part two. Introduction to Scientific Computing with Python, part two. M. Emmett Department of Mathematics University of North Carolina at Chapel Hill June 20 2012 The Zen of Python zen of python... fire up python

More information

Using Jails in FreeNAS to set up Backblaze B2

Using Jails in FreeNAS to set up Backblaze B2 Using Jails in FreeNAS to set up Backblaze B2 A Jail can be thought of as a virtual machine within the FreeNAS system. It is an implementation of operating system-level virtualization. It allows users

More information

Python Advance Course via Astronomy street. Sérgio Sousa (CAUP) ExoEarths Team (http://www.astro.up.pt/exoearths/)

Python Advance Course via Astronomy street. Sérgio Sousa (CAUP) ExoEarths Team (http://www.astro.up.pt/exoearths/) Python Advance Course via Astronomy street Sérgio Sousa (CAUP) ExoEarths Team (http://www.astro.up.pt/exoearths/) Advance Course Outline: Python Advance Course via Astronomy street Lesson 1: Python basics

More information

Introduction to Scientific Python, CME 193 Jan. 9, web.stanford.edu/~ermartin/teaching/cme193-winter15

Introduction to Scientific Python, CME 193 Jan. 9, web.stanford.edu/~ermartin/teaching/cme193-winter15 1 LECTURE 1: INTRO Introduction to Scientific Python, CME 193 Jan. 9, 2014 web.stanford.edu/~ermartin/teaching/cme193-winter15 Eileen Martin Some slides are from Sven Schmit s Fall 14 slides 2 Course Details

More information

Python for Scientists

Python for Scientists High level programming language with an emphasis on easy to read and easy to write code Includes an extensive standard library We use version 3 History: Exists since 1991 Python 3: December 2008 General

More information

Core Python is small by design

Core Python is small by design Core Python is small by design One of the key features of Python is that the actual core language is fairly small. This is an intentional design feature to maintain simplicity. Much of the powerful functionality

More information

Python for Astronomers. Week 1- Basic Python

Python for Astronomers. Week 1- Basic Python Python for Astronomers Week 1- Basic Python UNIX UNIX is the operating system of Linux (and in fact Mac). It comprises primarily of a certain type of file-system which you can interact with via the terminal

More information

Python for Earth Scientists

Python for Earth Scientists Python for Earth Scientists Andrew Walker andrew.walker@bris.ac.uk Python is: A dynamic, interpreted programming language. Python is: A dynamic, interpreted programming language. Data Source code Object

More information

Introducing LCG Views. Pere Mato LIM Meeting, 16th January 2016

Introducing LCG Views. Pere Mato LIM Meeting, 16th January 2016 Introducing LCG Views Pere Mato LIM Meeting, 16th January 2016 Motivations Easy runtime environment setup Current methods allow to setup a running environment starting from a top level package/application

More information

Scientific Python. 1 of 10 23/11/ :00

Scientific Python.   1 of 10 23/11/ :00 Scientific Python Neelofer Banglawala Kevin Stratford nbanglaw@epcc.ed.ac.uk kevin@epcc.ed.ac.uk Original course authors: Andy Turner Arno Proeme 1 of 10 23/11/2015 00:00 www.archer.ac.uk support@archer.ac.uk

More information

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you. https://www.virtualbox.org/

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you. https://www.virtualbox.org/ Virtual Machine Anyone have problems installing it? VM: Virtual Box - allows you to run a different operating system within the current operating system of your machine. https://www.virtualbox.org/ Linux

More information

Installation Guide for Python

Installation Guide for Python GPDI 513 Beginner s Guide to the Python Programming Language Installation Guide for Python Linux Operating System If you are using a Linux computer, open the terminal and type the following commands in

More information

Linux Software Installation Session 2. Qi Sun Bioinformatics Facility

Linux Software Installation Session 2. Qi Sun Bioinformatics Facility Linux Software Installation Session 2 Qi Sun Bioinformatics Facility Installation as non-root user Change installation directory; o Default procedure normally gives permission denied error. Sometimes not

More information

KNIME Python Integration Installation Guide. KNIME AG, Zurich, Switzerland Version 3.7 (last updated on )

KNIME Python Integration Installation Guide. KNIME AG, Zurich, Switzerland Version 3.7 (last updated on ) KNIME Python Integration Installation Guide KNIME AG, Zurich, Switzerland Version 3.7 (last updated on 2019-02-05) Table of Contents Introduction.....................................................................

More information

Linux Software Installation Part 2

Linux Software Installation Part 2 Linux Software Installation Part 2 Qi Sun Bioinformatics Facility bin lib Root / etc /programs BioHPC system admin install python software here $HOME You can install python software in home directory How

More information

Command Line and Python Introduction. Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016

Command Line and Python Introduction. Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016 Command Line and Python Introduction Jennifer Helsby, Eric Potash Computation for Public Policy Lecture 2: January 7, 2016 Today Assignment #1! Computer architecture Basic command line skills Python fundamentals

More information

Scientific Programming. Lecture A08 Numpy

Scientific Programming. Lecture A08 Numpy Scientific Programming Lecture A08 Alberto Montresor Università di Trento 2018/10/25 Acknowledgments: Stefano Teso, Documentation http://disi.unitn.it/~teso/courses/sciprog/python_appendices.html https://docs.scipy.org/doc/numpy-1.13.0/reference/

More information

NAVIGATING UNIX. Other useful commands, with more extensive documentation, are

NAVIGATING UNIX. Other useful commands, with more extensive documentation, are 1 NAVIGATING UNIX Most scientific computing is done on a Unix based system, whether a Linux distribution such as Ubuntu, or OSX on a Mac. The terminal is the application that you will use to talk to the

More information

Manual of SPCI (structural and physico-chemical interpretation) open-source software version 0.1.5

Manual of SPCI (structural and physico-chemical interpretation) open-source software version 0.1.5 Manual of SPCI (structural and physico-chemical interpretation) open-source software version 0.1.5 Version (date) Changes and comments 0.1.0 (02.02.2015) Changes from alpha version: 1. More precise default

More information

Installing the new LOFAR Software on a fresh Ubuntu 14.04

Installing the new LOFAR Software on a fresh Ubuntu 14.04 2017/11/20 23:19 1/5 Installing the new LOFAR Software on a fresh Ubuntu 14.04 Installing the new LOFAR Software on a fresh Ubuntu 14.04 This are my private, unedited notes on installing the LOFAR Software

More information

GILDAS-Python binding

GILDAS-Python binding GILDAS-Python binding Using Python from GILDAS, and vice-versa Sébastien BARDEAU, IRAM Grenoble MPIfR, 23-mar-2010 A kernel: SIC: Sympathetic Interpreter of Commands GreG: Grenoble Graphic The GILDAS software

More information

EE516: Embedded Software Project 1. Setting Up Environment for Projects

EE516: Embedded Software Project 1. Setting Up Environment for Projects EE516: Embedded Software Project 1. Setting Up Environment for Projects By Dong Jae Shin 2015. 09. 01. Contents Introduction to Projects of EE516 Tasks Setting Up Environment Virtual Machine Environment

More information

CME 193: Introduction to Scientific Python Lecture 1: Introduction

CME 193: Introduction to Scientific Python Lecture 1: Introduction CME 193: Introduction to Scientific Python Lecture 1: Introduction Nolan Skochdopole stanford.edu/class/cme193 1: Introduction 1-1 Contents Administration Introduction Basics Variables Control statements

More information

Overview. Monte Carlo Methods. Statistics & Bayesian Inference Lecture 3. Situation At End Of Last Week

Overview. Monte Carlo Methods. Statistics & Bayesian Inference Lecture 3. Situation At End Of Last Week Statistics & Bayesian Inference Lecture 3 Joe Zuntz Overview Overview & Motivation Metropolis Hastings Monte Carlo Methods Importance sampling Direct sampling Gibbs sampling Monte-Carlo Markov Chains Emcee

More information

FROM SCRIPT TO PACKAGES. good practices for hassle-free code reuse

FROM SCRIPT TO PACKAGES. good practices for hassle-free code reuse FROM SCRIPT TO PACKAGES good practices for hassle-free code reuse WHAT S THIS TUTORIAL IS ABOUT How to make your code usable by someone else WHO AM I? Contributor to numpy/scipy since 2007 Windows, Mac

More information

BE CAREFUL! The Summer Research Student s Guide to UNIX

BE CAREFUL! The Summer Research Student s Guide to UNIX BE CAREFUL! The Summer Research Student s Guide to UNIX Luke Leisman adapted from Andrew Butler June 2011 This is a guide designed to help summer researchers navigate the complexities of using a unix/linux

More information

VIP Documentation. Release Carlos Alberto Gomez Gonzalez, Olivier Wertz & VORTEX team

VIP Documentation. Release Carlos Alberto Gomez Gonzalez, Olivier Wertz & VORTEX team VIP Documentation Release 0.8.9 Carlos Alberto Gomez Gonzalez, Olivier Wertz & VORTEX team Feb 17, 2018 Contents 1 Introduction 3 2 Documentation 5 3 Jupyter notebook tutorial 7 4 TL;DR setup guide 9

More information

CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup

CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup Purpose: The purpose of this lab is to setup software that you will be using throughout the term for learning about Python

More information

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017 Einführung in die Programmierung für Physiker WS 207/208 Marc Wagner Francesca Cuteri: cuteri@th.physik.uni-frankfurt.de Alessandro Sciarra: sciarra@th.physik.uni-frankfurt.de Exercise sheet To be corrected

More information

Lab 1 Introduction to UNIX and C

Lab 1 Introduction to UNIX and C Name: Lab 1 Introduction to UNIX and C This first lab is meant to be an introduction to computer environments we will be using this term. You must have a Pitt username to complete this lab. NOTE: Text

More information

Scientific Computing: Lecture 1

Scientific Computing: Lecture 1 Scientific Computing: Lecture 1 Introduction to course, syllabus, software Getting started Enthought Canopy, TextWrangler editor, python environment, ipython, unix shell Data structures in Python Integers,

More information

Plotting with an introduction to functions

Plotting with an introduction to functions Plotting with CERN@school: an introduction to functions Twitter: @nicoleshearer93 N. Shearer a, T. Whyntie b, c a Durham University, b Langton Star Centre, c Queen Mary University of London Coding with

More information

Sunpy Python for Solar Physics Juan Carlos Martínez Oliveros

Sunpy Python for Solar Physics Juan Carlos Martínez Oliveros Sunpy Python for Solar Physics Juan Carlos Martínez Oliveros In the beginning (ENIAC) Evolution Evolution Evolution Introduction The SunPy project is an effort to create an opensource software library

More information

ME30_Lab1_18JUL18. August 29, ME 30 Lab 1 - Introduction to Anaconda, JupyterLab, and Python

ME30_Lab1_18JUL18. August 29, ME 30 Lab 1 - Introduction to Anaconda, JupyterLab, and Python ME30_Lab1_18JUL18 August 29, 2018 1 ME 30 Lab 1 - Introduction to Anaconda, JupyterLab, and Python ME 30 ReDev Team 2018-07-18 Description and Summary: This lab introduces Anaconda, JupyterLab, and Python.

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

arxiv: v1 [astro-ph.im] 12 Jul 2018

arxiv: v1 [astro-ph.im] 12 Jul 2018 jcis@epacis.org Use of Python programming language in astronomy and science arxiv:1807.04806v1 [astro-ph.im] 12 Jul 2018 Daniel M. Faes 1 Instituto de Astronomia, Geofísica e Ciências Atmosféricas, Universidade

More information

Instituto Politécnico de Tomar. Python. Introduction. Ricardo Campos. Licenciatura ITM Técnicas Avançadas de Programação Abrantes, Portugal, 2018

Instituto Politécnico de Tomar. Python. Introduction. Ricardo Campos. Licenciatura ITM Técnicas Avançadas de Programação Abrantes, Portugal, 2018 Instituto Politécnico de Tomar Python Introduction Ricardo Campos Licenciatura ITM Técnicas Avançadas de Programação Abrantes, Portugal, 2018 This presentation was developed by Ricardo Campos, Professor

More information

How to install and build an application. Giuliana Milluzzo INFN-LNS

How to install and build an application. Giuliana Milluzzo INFN-LNS How to install and build an application Giuliana Milluzzo INFN-LNS Outline Supported platforms & compilers Required software Where to download the packages Geant4 toolkit installation (release 10) Using

More information

tutorial : modeling synaptic plasticity

tutorial : modeling synaptic plasticity tutorial : modeling synaptic plasticity Computational Neuroscience by the Mediterranean Winter School, Jan 20th, 2016 Michael Graupner Université Paris Descartes CNRS UMR 8118, Paris, France michael.graupner@parisdescartes.fr

More information

Data Reduction Helpdesk First Responder Guidelines

Data Reduction Helpdesk First Responder Guidelines Data Reduction Helpdesk First Responder Guidelines Kathleen Labrie Science Users Support Department V1.1 12 March 2018 Revision History V1.0 16 January 2018 Kathleen Labrie V1.1 12 March 2018 Kathleen

More information

Setting up Python 3.4 and numpy and matplotlib on your own Windows PC or laptop

Setting up Python 3.4 and numpy and matplotlib on your own Windows PC or laptop CS-1004, Introduction to Programming for Non-Majors, A-Term 2015 Setting up Python 3.4 and numpy and matplotlib on your own Windows PC or laptop Hugh C. Lauer Adjunct Professor Worcester Polytechnic Institute

More information

Containers. Pablo F. Ordóñez. October 18, 2018

Containers. Pablo F. Ordóñez. October 18, 2018 Containers Pablo F. Ordóñez October 18, 2018 1 Welcome Song: Sola vaya Interpreter: La Sonora Ponceña 2 Goals Containers!= ( Moby-Dick ) Containers are part of the Linux Kernel Make your own container

More information

#To import the whole library under a different name, so you can type "diff_name.f unc_name" import numpy as np import matplotlib.

#To import the whole library under a different name, so you can type diff_name.f unc_name import numpy as np import matplotlib. In [1]: #Here I import the relevant function libraries #This can be done in many ways #To import an entire library (e.g. scipy) so that functions accessed by typing "l ib_name.func_name" import matplotlib

More information

5 File I/O, Plotting with Matplotlib

5 File I/O, Plotting with Matplotlib 5 File I/O, Plotting with Matplotlib Bálint Aradi Course: Scientific Programming / Wissenchaftliches Programmieren (Python) Installing some SciPy stack components We will need several Scipy components

More information

mpl Release latest May 17, 2017

mpl Release latest May 17, 2017 mpl a nimationmanagerdocumentation Release latest May 17, 2017 Contents 1 NOTE: Documentation is curently in development!!! 1 1.1 Matplotlib animation manager (GUI) 1.0a1...............................

More information

Astronomical Data Analysis with Python

Astronomical Data Analysis with Python Astronomical Data Analysis with Python Lecture 8 Yogesh Wadadekar NCRA-TIFR July August 2010 Yogesh Wadadekar (NCRA-TIFR) Topical course 1 / 27 Slides available at: http://www.ncra.tifr.res.in/ yogesh/python_course_2010/

More information

Conda Documentation. Release latest

Conda Documentation. Release latest Conda Documentation Release latest August 09, 2015 Contents 1 Installation 3 2 Getting Started 5 3 Building Your Own Packages 7 4 Getting Help 9 5 Contributing 11 i ii Conda Documentation, Release latest

More information

When you first log in, you will be placed in your home directory. To see what this directory is named, type:

When you first log in, you will be placed in your home directory. To see what this directory is named, type: Chem 7520 Unix Crash Course Throughout this page, the command prompt will be signified by > at the beginning of a line (you do not type this symbol, just everything after it). Navigation When you first

More information

Advanced Python on Abel. Dmytro Karpenko Research Infrastructure Services group Department for Scientific Computing USIT, UiO

Advanced Python on Abel. Dmytro Karpenko Research Infrastructure Services group Department for Scientific Computing USIT, UiO Advanced Python on Abel Dmytro Karpenko Research Infrastructure Services group Department for Scientific Computing USIT, UiO Support for large, multi-dimensional arrays and matrices, and a large library

More information

NumPy quick reference

NumPy quick reference John W. Shipman 2016-05-30 12:28 Abstract A guide to the more common functions of NumPy, a numerical computation module for the Python programming language. This publication is available in Web form1 and

More information

LECTURE 22. Numerical and Scientific Computing Part 2

LECTURE 22. Numerical and Scientific Computing Part 2 LECTURE 22 Numerical and Scientific Computing Part 2 MATPLOTLIB We re going to continue our discussion of scientific computing with matplotlib. Matplotlib is an incredibly powerful (and beautiful!) 2-D

More information

Introduction to Computer Programming for Non-Majors

Introduction to Computer Programming for Non-Majors Introduction to Computer Programming for Non-Majors CSC 2301, Fall 2016 Chapter 1 Instructor: Long Ma The Department of Computer Science Objectives To understand the respective roles of hardware and software

More information

GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux

GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux BDMICRO http://www.bdmicro.com/ Brian S. Dean bsd@bdmicro.com April 24, 2007 Copyright (c) 2005 BDMICRO All Rights Reserved. GNU-AVR April

More information

PyAMG. Algebraic Multigrid Solvers in Python Nathan Bell, Nvidia Luke Olson, University of Illinois Jacob Schroder, University of Colorado at Boulder

PyAMG. Algebraic Multigrid Solvers in Python Nathan Bell, Nvidia Luke Olson, University of Illinois Jacob Schroder, University of Colorado at Boulder PyAMG Algebraic Multigrid Solvers in Python Nathan Bell, Nvidia Luke Olson, University of Illinois Jacob Schroder, University of Colorado at Boulder Copper Mountain 2011 Boot disc For Mac Press and hold

More information

NOTES ON RUNNING PYTHON CODE

NOTES ON RUNNING PYTHON CODE NOTES ON RUNNING PYTHON CODE ERIC MARTIN Part 1. Setting things up The School has python 3.2.3 installed. 1. Installing python if necessary On personal computers with no version of python 3 installed,

More information

Introduction to Python. Didzis Gosko

Introduction to Python. Didzis Gosko Introduction to Python Didzis Gosko Scripting language From Wikipedia: A scripting language or script language is a programming language that supports scripts, programs written for a special run-time environment

More information

Using IDLE for

Using IDLE for Using IDLE for 15-110 Step 1: Installing Python Download and install Python using the Resources page of the 15-110 website. Be sure to install version 3.3.2 and the correct version depending on whether

More information

Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science

Introduction to Computer Programming for Non-Majors CSC 2301, Fall The Department of Computer Science Introduction to Computer Programming for Non-Majors CSC 2301, Fall 2015 The Department of Computer Science CSC 2301 Welcome to Class CSC 2301! Introduction to Computer Programming for Non-Majors Who are

More information

Getting Started with Python

Getting Started with Python Getting Started with Python A beginner course to Python Ryan Leung Updated: 2018/01/30 yanyan.ryan.leung@gmail.com Links Tutorial Material on GitHub: http://goo.gl/grrxqj 1 Learning Outcomes Python as

More information

STAT 203 SOFTWARE TUTORIAL

STAT 203 SOFTWARE TUTORIAL STAT 203 SOFTWARE TUTORIAL PYTHON IN BAYESIAN ANALYSIS YING LIU 1 Some facts about Python An open source programming language Have many IDE to choose from (for R? Rstudio!) A powerful language; it can

More information

Molecular Statistics Exercise 1. As was shown to you this morning, the interactive python shell can add, subtract, multiply and divide numbers.

Molecular Statistics Exercise 1. As was shown to you this morning, the interactive python shell can add, subtract, multiply and divide numbers. Molecular Statistics Exercise 1 Introduction This is the first exercise in the course Molecular Statistics. The exercises in this course are split in two parts. The first part of each exercise is a general

More information

Import That! Import Basics. I have a small confession: I often think that I don t fully understand the Python

Import That! Import Basics. I have a small confession: I often think that I don t fully understand the Python Import That! DAVID BEAZLEY David Beazley is an open source developer and author of the Python Essential Reference (4th Edition, Addison-Wesley, 2009). He is also known as the creator of Swig (http://www.swig.org)

More information

Data Analysis Frameworks

Data Analysis Frameworks Data Analysis Frameworks ROOT Data Analysis Frameworks Computational Physics Prof. Paul Eugenio Department of Physics Florida State University April 10, 2018 Exercise 8 Due Date extended to Noon Thursday

More information

Programming for Engineers in Python

Programming for Engineers in Python Programming for Engineers in Python Lecture 13: Shit Happens Autumn 2011-12 1 Lecture 12: Highlights Dynamic programming Overlapping subproblems Optimal structure Memoization Fibonacci Evaluating trader

More information

The Python interpreter

The Python interpreter The Python interpreter Daniel Winklehner, Remi Lehe US Particle Accelerator School (USPAS) Summer Session Self-Consistent Simulations of Beam and Plasma Systems S. M. Lund, J.-L. Vay, D. Bruhwiler, R.

More information

Module File Name on "Add or Remove Programs" 1 Python 2.5 python-2.5.mci Python MCR MCRInstaller.exe

Module File Name on Add or Remove Programs 1 Python 2.5 python-2.5.mci Python MCR MCRInstaller.exe BMEGUI 3.0.1 Installation Manual BMEGUI3.0.1 Update 1 (Last Edited on: 2016/10) Table of content Step 1: Download and unzip various libraries Step 2: Install the libraries Step 3: Download and unzip the

More information

CMSC 201 Fall 2018 Lab 04 While Loops

CMSC 201 Fall 2018 Lab 04 While Loops CMSC 201 Fall 2018 Lab 04 While Loops Assignment: Lab 04 While Loops Due Date: During discussion, September 24 th through September 27 th Value: 10 points (8 points during lab, 2 points for Pre Lab quiz)

More information

Matplotlib Python Plotting

Matplotlib Python Plotting Matplotlib Python Plotting 1 / 6 2 / 6 3 / 6 Matplotlib Python Plotting Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive

More information

LECTURE 19. Numerical and Scientific Packages

LECTURE 19. Numerical and Scientific Packages LECTURE 19 Numerical and Scientific Packages NUMERICAL AND SCIENTIFIC APPLICATIONS As you might expect, there are a number of third-party packages available for numerical and scientific computing that

More information

Python and Machine Learning. by Semen A. Trygubenko

Python and Machine Learning. by Semen A. Trygubenko Python and Machine Learning by Semen A. Trygubenko Machine learning around us Voice recognition Spam filtering Player ranking in online games Vehicle stability systems Computer vision (barcode, fingerprint

More information

Setting up Python 3.5, numpy, and matplotlib on your Macintosh or Linux computer

Setting up Python 3.5, numpy, and matplotlib on your Macintosh or Linux computer CS-1004, Introduction to Programming for Non-Majors, C-Term 2017 Setting up Python 3.5, numpy, and matplotlib on your Macintosh or Linux computer Hugh C. Lauer Adjunct Professor Worcester Polytechnic Institute

More information

COMP s1 Lecture 1

COMP s1 Lecture 1 COMP1511 18s1 Lecture 1 1 Numbers In, Numbers Out Andrew Bennett more printf variables scanf 2 Before we begin introduce yourself to the person sitting next to you why did

More information

Python Development Workflow

Python Development Workflow Python Development Workflow Best Practice to create / test / versioning / automate and more Marcelo Mello mmello@redhat.com / tchello.mello@gmail.com Pablo Hess phess@redhat.com / pablonhess@gmail.com

More information

PHY Introduction to Python Programming, week 5

PHY Introduction to Python Programming, week 5 PHY1024 - Introduction to Python Programming, week 5 The lecture materials, worksheets, and assignments can all be found here: http://go.qub.ac.uk/phy1024y2016 (http://go.qub.ac.uk/phy1024y2016) Lecture

More information

Discrete-Event Simulation and Performance Evaluation

Discrete-Event Simulation and Performance Evaluation Discrete-Event Simulation and Performance Evaluation 01204525 Wireless Sensor Networks and Internet of Things Chaiporn Jaikaeo (chaiporn.j@ku.ac.th) Department of Computer Engineering Kasetsart University

More information

Saving Time. Bill Rising StataCorp LLC 2018 Italian Stata Users Group Meeting Bologna 15 Nov 2018

Saving Time. Bill Rising StataCorp LLC 2018 Italian Stata Users Group Meeting Bologna 15 Nov 2018 Saving Time Bill Rising StataCorp LLC 2018 Italian Stata Users Group Meeting Bologna 15 Nov 2018 Contents 1 Introduction 1 1.1 Background................................................ 1 1.2 Stata s User

More information

First steps on Linux and programming

First steps on Linux and programming First steps on Linux and programming Adrien Poteaux CRIStAL, Université de Lille Year 2017-2018 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License. http://creativecommons.org/licenses/by-nc-sa/3.0/

More information

AMath 483/583 Lecture 28 June 1, Notes: Notes: Python scripting for Fortran codes. Python scripting for Fortran codes.

AMath 483/583 Lecture 28 June 1, Notes: Notes: Python scripting for Fortran codes. Python scripting for Fortran codes. AMath 483/583 Lecture 28 June 1, 2011 Today: Python plus Fortran Comments on quadtests.py for project Linear vs. log-log plots Visualization Friday: Animation: plots to movies Binary I/O Parallel IPython

More information

Lab #3 Automating Installation & Introduction to Make Due in Lab, September 15, 2004

Lab #3 Automating Installation & Introduction to Make Due in Lab, September 15, 2004 Lab #3 Automating Installation & Introduction to Make Due in Lab, September 15, 2004 Name: Lab Time: Grade: /10 Error Checking In this lab you will be writing a shell script to automate the installation

More information

Goals for this lecture. Lecture 4 Getting Started with ITK! Getting help. Assignments. Assignments, cont. Grading of assignments

Goals for this lecture. Lecture 4 Getting Started with ITK! Getting help. Assignments. Assignments, cont. Grading of assignments Goals for this lecture Lecture 4 Getting Started with ITK! Methods in Medical Image Analysis - Spring 2018 16-725 (CMU RI) : BioE 2630 (Pitt) Dr. John Galeotti Compile, compile, compile Learn how to use

More information

GPI, Exercise #1. Part 1

GPI, Exercise #1. Part 1 GPI, Exercise #1 In this exercise you will gain some experience with GPI data and the basic reduction steps. Start by reading the three papers related to GPI s commissioning, first- light and observations

More information

Algorithms and Data Structures

Algorithms and Data Structures Algorithms and Data Structures IPython Łódź 2012 IPython ipython.org IPython Mac OS PyLab Interac

More information

10.4 Linear interpolation method Newton s method

10.4 Linear interpolation method Newton s method 10.4 Linear interpolation method The next best thing one can do is the linear interpolation method, also known as the double false position method. This method works similarly to the bisection method by

More information

Numerical Calculations

Numerical Calculations Fundamentals of Programming (Python) Numerical Calculations Sina Sajadmanesh Sharif University of Technology Some slides have been adapted from Scipy Lecture Notes at http://www.scipy-lectures.org/ Outline

More information

Bi 1x Spring 2014: Plotting and linear regression

Bi 1x Spring 2014: Plotting and linear regression Bi 1x Spring 2014: Plotting and linear regression In this tutorial, we will learn some basics of how to plot experimental data. We will also learn how to perform linear regressions to get parameter estimates.

More information

Computer Lab 1: Introduction to Python

Computer Lab 1: Introduction to Python Computer Lab 1: Introduction to Python 1 I. Introduction Python is a programming language that is fairly easy to use. We will use Python for a few computer labs, beginning with this 9irst introduction.

More information

Packaging Python code and Sphinx

Packaging Python code and Sphinx Packaging Python code and Sphinx 1 Python packages extending Python with your own package making ourfirstpackage 2 the software PHCpack a package for Polynomial Homotopy Continuation polyhedral homotopies

More information

BMEGUI Installation Manual BMEGUI2.1.1 Update 1 (Last Edited on: 2009/02/25)

BMEGUI Installation Manual BMEGUI2.1.1 Update 1 (Last Edited on: 2009/02/25) BMEGUI 2.1.1 Installation Manual BMEGUI2.1.1 Update 1 (Last Edited on: 2009/02/25) Table of content Step 1: Download and unzip various libraries Step 2: Install the libraries Step 3: Download and unzip

More information

Euler s Method with Python

Euler s Method with Python Euler s Method with Python Intro. to Differential Equations October 23, 2017 1 Euler s Method with Python 1.1 Euler s Method We first recall Euler s method for numerically approximating the solution of

More information

GILDAS-Python binding

GILDAS-Python binding GILDAS-Python binding Using Python from GILDAS, and vice-versa Sébastien BARDEAU, IRAM Grenoble Science Software User Meeting, 08-apr-2016 The GILDAS software http://www.iram.fr/iramfr/gildas/ gildas@iram.fr

More information

Python Packaging. Jakub Wasielak

Python Packaging. Jakub Wasielak Python Packaging Jakub Wasielak http://blog.pykonik.org/ http://koderek.edu.pl/ facebook.com/startechkrk https://pl.pycon.org/2017/ What? Why? Architecture https://packaging.python.org/current/ Installation

More information

Introduction to Python for Scientific Computing

Introduction to Python for Scientific Computing 1 Introduction to Python for Scientific Computing http://tinyurl.com/cq-intro-python-20151022 By: Bart Oldeman, Calcul Québec McGill HPC Bart.Oldeman@calculquebec.ca, Bart.Oldeman@mcgill.ca Partners and

More information

Session 1: Accessing MUGrid and Command Line Basics

Session 1: Accessing MUGrid and Command Line Basics Session 1: Accessing MUGrid and Command Line Basics Craig A. Struble, Ph.D. July 14, 2010 1 Introduction The Marquette University Grid (MUGrid) is a collection of dedicated and opportunistic resources

More information

6 Git & Modularization

6 Git & Modularization 6 Git & Modularization Bálint Aradi Course: Scientific Programming / Wissenchaftliches Programmieren (Python) Prerequisites Additional programs needed: Spyder3, Pylint3 Git, Gitk KDiff3 (non-kde (qt-only)

More information

MS6021 Scientific Computing. TOPICS: Python BASICS, INTRO to PYTHON for Scientific Computing

MS6021 Scientific Computing. TOPICS: Python BASICS, INTRO to PYTHON for Scientific Computing MS6021 Scientific Computing TOPICS: Python BASICS, INTRO to PYTHON for Scientific Computing Preliminary Notes on Python (v MatLab + other languages) When you enter Spyder (available on installing Anaconda),

More information

Pandas and Friends. Austin Godber Mail: Source:

Pandas and Friends. Austin Godber Mail: Source: Austin Godber Mail: godber@uberhip.com Twitter: @godber Source: http://github.com/desertpy/presentations What does it do? Pandas is a Python data analysis tool built on top of NumPy that provides a suite

More information

python 01 September 16, 2016

python 01 September 16, 2016 python 01 September 16, 2016 1 Introduction to Python adapted from Steve Phelps lectures - (http://sphelps.net) 2 Python is interpreted Python is an interpreted language (Java and C are not). In [1]: 7

More information