#!/usr/bin/env python # coding: utf-8 # # Welcome to GeogG122: Scientific Computing (Univeristy College London) # # ## Course information # # ### Course Convenor # # [Dr Gómez-Dans](http://www.geog.ucl.ac.uk/people/research-staff/jose-gomez-dans) # # ### Course Staff # [Dr. Gómez-Dans](http://www.geog.ucl.ac.uk/people/research-staff/jose-gomez-dans) # [Prof P. Lewis](http://www.geog.ucl.ac.uk/~plewis) # # # # ### Useful links # # [Course Moodle page](http://moodle.ucl.ac.uk/course/view.php?id=13891) # # [A useful reading list for basic and advanced Unix.](http://www.ee.surrey.ac.uk/Teaching/Unix/books-uk.html) # # - **0.0 Introduction ** # [Introductory notes](http://nbviewer.ipython.org/urls/raw.github.com/profLewis/geogg122/master/Chapter0_Introduction/f1_index.ipynb) # # # - **1.0 Unix** # [Unix notes](http://nbviewer.ipython.org/urls/raw.github.com/profLewis/geogg122/master/Chapter1_Unix/f3_1_unix_intro.ipynb) # [Unix exercises](http://nbviewer.ipython.org/urls/raw.github.com/profLewis/geogg122/master/Chapter1_Unix/f3_1a_unix_intro_answers.ipynb) # # # - **2.0 Python 101** # The aim of this Chapter is to introduce you to some of the fundamental concepts in Python. Mainly, this is based around fundamental data types in Python (`int`, `float`, `str`, `bool` etc.) and ways to group them (`tuple`, `list` and `dict`). We then learn about how to loop over groups of things, which gives us control to iterate some process. We need to spend a little time on strings, as you will likely to quite a bit of string processing in Scientific Computing (e.g. reading/writing data to/from ASCII text files). Although some of the examples we use are very simple to explain a concept, the more developed ones should be directly applicable to the sort of programming you are likely to need to do. A set of exercises is developed throughout the chapter, with worked answers available to you once you have had a go yourself. In addition, a more advanced section of the chapter is available, that goes into some more detail and complkications. This too has a set of exercises with worked examples. # # [Course Notes](http://nbviewer.ipython.org/urls/raw.github.com/profLewis/geogg122/master/Chapter2_Python_intro/python101.ipynb) # [Answers](http://nbviewer.ipython.org/urls/raw.github.com/profLewis/geogg122/master/Chapter2_Python_intro/main_answers.ipynb) # [Advanced](http://nbviewer.ipython.org/urls/raw.github.com/profLewis/geogg122/master/Chapter2_Python_intro/advanced.ipynb) # [Advanced Answers](http://nbviewer.ipython.org/urls/raw.github.com/profLewis/geogg122/master/Chapter2_Python_intro/advanced_answers.ipynb) # # # # # # # ## Purpose of this course # # This course, GeogG122 Scientific Computing, is a term 1 MSc module worth 15 credits (25% of the term 1 credits) that aims to: # # * impart an understanding of scientific computing # * give students a grounding in the basic principles of algorithm development and program construction # * to introduce principles of computer-based image analysis and model development # # It is open to students from a number of [MSc courses](http://www.geog.ucl.ac.uk/admissions-and-teaching/postgraduates) run by the [Department of Geography](http://www.geog.ucl.ac.uk) [UCL](www.ucl.ac.uk), but the material should be of wider value to others wishing to make use of scientific computing. # # The module will cover: # # * Introduction to programming (algorithms, data structures, control structures, I/O, languages and pseudocode) # * Introduction to linux environment (login, shell, file systems) and hardware # * Compilation and debugging # * Computing for image analysis (with reference to software such as ENVI/IDL) # * Computing in Python # * Computing for environmental modelling # * Data visualisation for scientific applications # # ## Learning Outcomes # # # At the end of the module, students should: # # * have a working knowledge of linux / unix operating systems and have the knowledge and confidence to obtain, compile and install commonly available scientific software packages # * have an understanding of algorithm development and be able to use widely used scientific computing software to manipulate datasets and accomplish analytical tasks # * have an understanding of the technical issues specific to image-based analysis, model implementation and scientific visualisation # # ## Timetable # # The course takes place over 10 weeks in term 1, on Wednesdays usually from 10:00 to 13:00 (09:00-13:00 in the first two sessions) in the Geography Department Unix Computing Lab (PB110) in the [Pearson Building, UCL](http://www.ucl.ac.uk/efd/roombooking/building-location/?id=003). Classes take place from the second week of term to the final week of term, other than Reading week. See [UCL term dates for further information](http://www.ucl.ac.uk/transition/joining/all-students/term-dates). # # ## Assessment # # Assessment is through one piece of coursework that is submitted in both paper form and electronically via Moodle. See the [Moodle page](http://moodle.ucl.ac.uk/course/view.php?id=13891) for more details. # # ## Structure of the Course # # # * 06 3 Oct 09:00-13:00 4 hrs Introduction to Unix 110 JGD # * 07 10 Oct 09:00-13:00 4 hrs Introduction to Python 110 JGD # * 08 17 Oct 10:00-13:00 3 hrs Python coding 110 JGD # * 09 24 Oct 10:00-13:00 3 hrs Python coding 110 JGD # * 10 31 Oct 10:00-13:00 3 hrs Raster and vector data 110 JGD # * 11 READING WEEK (ENVI) # * 12 14 Nov 10:00-13:00 3 hrs Raster and vector data 110 JGD # * 13 21 Nov 10:00-13:00 3 hrs Building and calibrating a model 110 JGD # * 14 28 Nov 10:00-13:00 3 hrs Building and calibrating a model 110 JGD # * 15 5 Dec 10:00-13:00 3 hrs Group practical 110 JGD # * 16 12 Dec 10:00-13:00 3 hrs Group practical 110 JGD # # Total scheduled hours: 32 hours # # JGD: Dr. Gómez-Dans # # Rooms: PB110 = Pearson Building Unix Lab, Room 110, 1st floor # # # ## Using these notes # There are several ways you can access this course material. # # These notes are created in [jupyter notebooks](http://jupyter.org). # # The course is all stored online in [github](https://github.com/profLewis/geogg122), so you can just navigate to that site and download the files as you like. # # All notes will have been downloaded for you to your `DATA` area, so you can directly access them from there. # # If you want to access these same notes from outside UCL, see [connection from outsiude UCL](Connection.ipynb). # # # Provided you have a relatively up to date version of [`ipython`](http://ipython.org/ipython-doc/dev/interactive/nbconvert.html#nbconvert) and a few other tools such as [`pandoc`](http://johnmacfarlane.net/pandoc/installing.html) you can convert your own notebooks to other formats using `ipython`, e.g.: # # `berlin% jupyter nbconvert --to html f2_intro.ipynb` # # You can also convert the notebooks to other [formats](http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html) though you might need some other tools as well for this. If you have a working copy of `LaTeX` on your system (e.g. [MacTeX](http://tug.org/mactex/downloading.html) on OS X), you can convert the notebooks to pdf format: # # `berlin% jupyter nbconvert --to latex --post PDF f2_intro.ipynb` # ### Obtaining the course material # # Alternatively, you can obtain the whole course from [github](https://github.com/profLewis/geogg122). # # To download the whole course, you can: # # 1. **using git** # # use the command [`git`](http://en.wikipedia.org/wiki/Git_%28software%29), if available: # Create a place on the system that you want to work in (N.B., don't type `berlin%`: that represents the command line prompt), e.g.: # # `berlin% mkdir -p ~/Data/msc` # `berlin% cd ~/Data/msc` # `berlin% git clone https://github.com/profLewis/geogg122.git` # `berlin% cd ~/Data/msc/geogg122` # # This will create a directory `~/Data/msc/geogg122` which has the current versions of the notebooks for the course and associated files. # # If the course notes change at all (e.g. are updated), you can update your copy with: # # `berlin% git pull` # # To find out more about using `git`, type `git --help`, get [help online](http://www.siteground.com/tutorials/git/commands.htm) or download and use a [gui tool](http://git-scm.com/downloads). # # # If you set up an account on [github](https://github.com/edu), you can fork the [course repository](https://github.com/profLewis/geogg122) to make your own version of the course notes, and add in your own comments and examples, if that helps you learn or remember things. # #
#
# 2. **using a zip file**
#
# Download the course as a zip file:
#
# `berlin% mkdir -p ~/Data/msc`
# `berlin% cd ~/Data/msc`
# `berlin% wget -O geogg122.zip https://github.com/profLewis/geogg122/archive/master.zip`
# `berlin% unzip geogg122.zip`
# `berlin% cd ~/Data/msc/geogg122-master`
#
#
# ### Using the course material
# Once you have copied the course material as described above (and have changed directory to where you have put the course (e.g. `~/Data/msc/geogg122-master` or `~/Data/msc/geogg122`) then `cd` to the chapter you want, e.g.:
#
# `berlin% cd ~/Data/msc/geogg122/Chapter0_Introduction`
#
# and you can start the notebooks with:
#
# `berlin% ipython notebook`
#
# This should launch a web browser with the address `http://127.0.0.1:8888/` or similar with links to the notebooks you have available.
# To load a *specific* notebook, you can type e.g.:
#
# `berlin% ipython notebook f1_index.ipynb`
# ### Python
# For most users wanting to install a working python environment, Anaconda appears to be far easier and overall quite nice to use: