Code Monkey home page Code Monkey logo

geog0111's Introduction

GEOG0111 Scientific Computing

Course Documentation

Binder Colab

For previous versions of the course:

Course information

Course Convenor

Dr. Martin Mokros

Teaching Staff 2023-2024
Dr. Martin Mokros
Support Staff 2023-2024
Jie Gong
Rebekah Horner
Other Contributing Staff
TBA

Purpose of this course

This course, GEOG0111 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 run by the Department of Geography UCL, but the material should be of wider value to others wishing to make use of scientific computing.

The module will cover:

  • Computing in Python
  • Computing for image analysis
  • Computing for environmental modelling
  • Data visualisation for scientific applications

Learning Outcomes

At the end of the module, students should:

  • have an understanding of the Python programmibng language and experience of its use
  • 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

Running on UCL JupyterHub

Follow the instructions on UCL installation and running

Timetable

class timetable for 2023/24

The course takes place over 10 weeks in term 1, on Monday 11:00-14:00 in the the Birkbeck Main Building, room 109 in Birkbeck Malet Street, Malet Street, Torrington Square Entrance, London, WC1E 7HX, UCL.

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.

The timetable is available on the UCL Academic Calendar. Live class sessions will take place in groups on Monday with help sessions on Thursdays.

The Thursday help sessions will be held in room 110 in the Northwest Wing (Geography Department, first floor)

Assessment

Assessment is through two pieces of coursework, submitted in both paper form and electronically via Moodle.

See the Moodle page for more details.

Useful links

Course Moodle page

Using the notes

Using the course notes

We will use jupyter notebooks for running interactive Python programs. If you are taking this course at UCL, follow the instructions on UCL installation and running.

If you are interested in running the course notes from outside UCL on your own computer, there are several options:

  1. Do a local install of the required software to run the notebooks (basically, Anaconda Python and some packages, this is around 15 GB of space on my own setup, but you might get away with a smaller Pythjon install). Its quite easy to set up, particularly on linux or OS X. It is a little more involved on Windows, but quite achievable following these notes
  2. You can run a Docker container on your local computer. That Docker image contains all of the software you need to do the course, so all you have to do is to set up Docker on your computer. There are various ways to run it, but we adviuse that you make a copy of the notes on your local computer, then run the notebookjs using Docker. There are full instructions these here, but the basics of what you need are given in the docker hub.
  3. You could use Binder or Colab to run the course. These use external resources (so, not UCL and not your own computer) to run the notebooks. The only problem for you is that the sessions are not persistent, so any changes or exercises you do in a notebook would be lost to you the next time you start a binder or colab session. There are ways around that that would work fine for the first half of the course. The simplest is for you to download any notebook that you change to your local computer, then relaod it the next time you run a session. Its a bit of a hassle, but the service is free, and you can run it simply from any browser (e.g. yopur phone or ipad).

Updating the course notes

From time-to-time we will need to provide updates to the notes or software. You need to be aware of how to do that and also what the consequences of pulling a new version are. Please go through these notes before you start using the notes.

geog0111's People

Contributors

github-actions[bot] avatar jgomezdans avatar martinmokros avatar proflewis avatar qwu-570 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

geog0111's Issues

wiki

Use the wiki - eg for instructions on setting up the notes

Style guides

More on style guides/PEPs

PEPs (Python Enhancement Proposals) are design documents for Python. They are primarily aimed at developers of features in the language, but some also contain clear definitions of how to use the language well. The most important of these is PEP8, but PEP257 is also of relevance.

On top of these core language definitions, there are ‘house styles’ for particular organisations or code bases, to ensure a consistent style of code, comments etc to both developers and users.

Further, there are many documents with suggestions on how to write good code, clear comments etc. since these are things you will be marked on, you should pay some attention to these.

Full list of PEPs

https://www.python.org/dev/peps/

Most relevant PEPs

doc strings:

https://www.python.org/dev/peps/pep-0257/

###code style: pep8
https://www.python.org/dev/peps/pep-0008/

Further pep8 advice:

https://realpython.com/python-pep8/

house styles

https://google.github.io/styleguide/pyguide.htm

comments

https://realpython.com/python-comments-guide/

README

make README.md and notebooks/README.md consistent

Switch to snow 6.1

Dear Colleague,

The MODIS Collection 6.1 Snow Cover and Sea Ice data sets, accessible through the NASA National Snow and Ice Data Center Distributed Active Archive Center (NSIDC DAAC), were released in the last year and data reprocessing is now complete. The full temporal coverage, from February 2000 for MODIS/Terra data sets and July 2002 for MODIS/Aqua data sets to present, is available. Collection 6.1, also known as Version 61, is largely compatible with Collection 6/Version 6, but NSIDC urges users to switch to the newer Collection 6.1 as Collection 6 will stop forward processing in mid 2022.

Access to the data sets and their documentation is provided at https://nsidc.org/data/modis/data_summaries

Data Acknowledgments
Data Authors: Hall, D. K. and G. A. Riggs
Data center: NSIDC DAAC (https://nsidc.org/daac)
Sponsor: NASA EOSDIS (https://earthdata.nasa.gov)

If you have any questions please contact the User Services Office at [email protected].

Remove np.prod

We use np.prod to get array size for multi d grids. Could simplify with using size.

Should add size to when shape is introduced in numpy.

Issue in notebook 018 Running Python

In the geog0111/notebook/018_Running_Python.ipynb, the first code cell under the section Running a Python script got a warning of Permission denided because the file geog0111/helloWorld.py is not executable.

!geog0111/helloWorld.py
/bin/bash: geog0111/helloWorld.py: Permission denied

!ls -l geog0111/helloWorld.py
-rw-r--r-- 1 ucfawya ucfapb 514 Oct 6 17:01 helloWorld.py

The possible solutions to this would be:
Method 1: make the file executable
!chmod u+x geog0111/helloWorld.py

Or

Method 2: call python interpreter
!python geog0111/helloWorld.py

small error in Exercise 3 in Notebook 015 Control in Python: if

In Exercise 3 in Notebook 015 Control in Python: if

line 16: month = 'out of bounds error: doy='+doy

The last variable 'doy' is integer and cannot be concatenated with string. The solution would be converting 'doy' into string type:
month = 'out of bounds error: doy=' + str(doy)

tidy

tidy up old directory

Update is required for Summary in 040_GDAL_mosaicing_and_masking.ipynb

Location: The Summary section at the end of the notebook 040_GDAL_mosaicing_and_masking.ipynb.

An update might be required for the last column in the row of gdal.BuilVRT():
replace file, sds = modis.get_files(year, doy) with

data = getModisFile(**kwargs)
for sds, sds_v in data.items():
      for doy, doy_v in sds_v.items():
            files = doy_v.keys()
            ofile = f"work/stitch_{sds}_{kwargs['year']}_{doy:03d}_{'Tiles_'+'_'.join(tiles)}.vrt"
            stitch_vrt = gdal.BuildVRT(ofile, list(doy_v.values()))
            del stitch_vrt

Readthedocs

Sphinx version broken for rtd- change to using mkdocs in config file. Once mkdocs issues resolved

software

separate out clog and other main codes

Update of 070_Summary.ipynb

In the notebook 070_Summary.ipynb, please update 021 URLs:

from geog0111.gurlpath import URL -> from urlpath import URL

Notes plan

Course basics 1
Put earthdata in here
Submit running python

Core concepts 2,3
Submit code

Datasets 4,5

Coursework part 1

Image processing 6,7
Submit code
Geospatial data 8,9
Submit code

Coursework part 2

This would leave 1 week for slippage.

Implicit for loops

Need to have implicit for loops in for section. These are used later on but not introduced.

Some small typos in 050_Models.ipynb

In the notebook 050_Models.ipynb, some typos might cause confusion and would be better to update:

Prerequisties section:

  • np**/mgrid -> np.**mgrid
  • "You should by know be familiar" -> "You should now be familiar"

Models section:

  • the last line above the first code cell: "This has two parameters p[0] and p[0]" -> the second p[0] might be p[1]

Discrepancy and optimisation section:

  • "The best approach with depend on circumstances" -> "The best approach will depend on circumstances"

migrate from MODIS to ... sentinel2

Given that MOSIS will soon finish collecting data, the examples and c/w should probably be re-developed fro some other data source. Something with Sentinel-2 time series would be interesting.

A simpler job would be to migrate to VIIRS, which no doubt has a similar snow and LAI product.

I leave this for the next convenor of the course to manage.

docker

need to revisit and fix the docker setup for the course

Qingling edits ? broken notebook 021

Unreadable Notebook: /nfs/cfs/home3/Uucfa6/ucfalew/geog0111/notebooks/021_Streams.ipynb NotJSONError('Notebook does not appear to be JSON: '{\n "cells": [\n {\n "cell_type": "m...')****

I think you (qingling) have edited the file but broken the formatting -- can you roll it back and fix?

notebook 023_Plotting.ipynb small problem caused by nan value

Notebook 023_Plotting.ipynb - the example data in Errorbar Section have NAN values for 2022 Oct-Dec because there is no data for these months yet.

The error bar graph cannot be plotted correctly unless get rid of nan in std. So, I would suggest to replace:

mean = np.array(df[months]).mean(axis=1)
std  = np.array(df[months]).std(axis=1)

by:

mean = np.nanmean(np.array(df[months]), axis=1)
std  = np.nanstd(np.array(df[months]), axis=1)

summaries

make sure each session has full summaries of what has been learned

TODOs

  • I need to finish redoing the last session (fitting phenology model based on Jose’s previous)

  • I need to sort out what material to use for feedback assessments

  • I need to decide what the new submitted practical will be
    There is opportunity for a new part 1 submitted practical at half term. I was thinking submit some code … a bunch of functions and tests to do XXX
    The 2nd part will be snow still, but changed in form

  • fix some known bugs:

    • nasa login test broken and links on pages broken
      DONE
    • Fire dataset image missing from repo
      DONE
    • sort documentation script
      TESTING
      bin/notebook-mkdocs.sh

Packages

Move packages notes to the intro

pyephem

Trying to install geog0111 on os-x M1 computer.

Error msg on running:

mamba env create -y --force -n geog0111 -f environment.yml
is

Could not solve for environment specs
The following package could not be installed
└─ pyephem does not exist (perhaps a typo or a missing channel).

I seem to recall that pyephem is being depreciated. We use it in some of the practicals (also for geog0133?) so they should;d be checked for this dependency and updated. It'll be ok for the Ucl notebooks, as it's all installed there. May be it's just an M1 issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.