Datasets

We need to download some data for the examples. Some files are bundled with the notebooks because I am not smart enough to understand how to download them through the various web / ftp interfaces directly or I needed to filter or compress the information for the purposes of the class. Please go to the original sites if you need to use these data for anything other than the demonstrations in these notebooks.

Most datasets are too large for the repository (and generally, that's not a place to keep anything which is not the primary target of revision management. The bundled data are compressed and will be unpacked (copied) to the ../../Data/Resources directory by the "download" functions in this notebook. If you mess them up, just run the download again. Anything that is undamaged will just be be skipped anyway.

Global Magnetic Data

Magnetic intensity data from geomag.org

Topography data

ETOPO1 images are from NOAA - we use their geotifs which are subsampled from the original (enormous) dataset but

NASA Blue marble images

Winter and Summer images for the Earth are grabbed for plotting examples. The winter ones (June) are used by default as these have less ice in the N. Hemisphere.

Earthquake hypocentres

Are grabbed from the NEIC - they are in the geoJSON format since that is very simple to read with python. The downloads are limited at 20k events so the time and magnitude range is whatever it takes to get just under this limit. The filenames give clues about that, but, so does the catalogue itself once it is read in.

Global age grid

Taken from Earthbyte and reduced in size by throwing away the grid information and saving in compressed numpy format.

Global strain rate

I grabbed the second invariant of the strain rate from the global strain rate map project through the 'Jules Vernes' portal.


In [1]:
%%sh

ls -l ../../Data/Reference/
ls -l ../../Data/Resources/

cp ../../Data/Reference/* ../../Data/Resources/


total 145296
-rw-r--r--  1 lmoresi  staff   4895422  9 Mar 16:04 AusMagAll.tiff.zip
-rw-r--r--  1 lmoresi  staff   5449584  9 Mar 16:04 Earthquake_data.zip
-rw-r--r--  1 lmoresi  staff    675266  9 Mar 16:04 OrthographicProjectionBlueMarble.png
-rw-r--r--  1 lmoresi  staff       214  9 Mar 16:04 README.md
-rw-r--r--@ 1 lmoresi  staff  33316312 14 Sep  2015 global_age_data.3.6.xyz.zip
-rw-r--r--  1 lmoresi  staff  21987373  9 Mar 16:04 global_age_data.3.6.z.npz
-rwxr-xr-x  1 lmoresi  staff      2183  9 Mar 16:04 nb_stripper.py
-rw-r--r--  1 lmoresi  staff   4309416  9 Mar 16:04 sec_invariant_strain_0.2.dat.zip
-rw-r--r--  1 lmoresi  staff    466364  9 Mar 16:04 velocity_AU.nc
-rw-r--r--  1 lmoresi  staff    466364  9 Mar 16:04 velocity_EU.nc
-rw-r--r--  1 lmoresi  staff    466364  9 Mar 16:04 velocity_IN.nc
-rw-r--r--  1 lmoresi  staff    466364  9 Mar 16:04 velocity_NA.nc
-rw-r--r--  1 lmoresi  staff    466364  9 Mar 16:04 velocity_NNR.nc
-rw-r--r--  1 lmoresi  staff    466364  9 Mar 16:04 velocity_OK.nc
-rw-r--r--  1 lmoresi  staff    466324  9 Mar 16:04 velocity_PA.nc
-rw-r--r--  1 lmoresi  staff    466364  9 Mar 16:04 velocity_TA.nc
total 8
-rw-r--r--  1 lmoresi  staff  214 21 Mar 17:52 README.md

The datasets that we use for this course are kept in a central location.

These can be downloaded on demand but the smaller files are stored away in the Reference directory and copied to the Resources directory.

  • Why do I do that ?

So if you happen to delete or break one of the datasets, we can get a new copy. Expand the cell to see the details of the download and caching mechanism.

  • md5 checksums
  • the requests module for handling urls (properly)
  • exception handling (!)
import requests
import os
import time
import sys
import shutil

def download_file(url, local_filename, expected_size):

    if (os.path.isfile(url)):
        shutil.copy(url, local_filename)

# and so on ...

In [2]:
## Here are some functions to download or install files. 


import requests
import os
import time
import sys
import shutil

def download_file(url, local_filename, expected_size):
    
    
# We might want to bundle some files if they are small / compressed or not readily available for download

    if (os.path.isfile(url)):
        shutil.copy(url, local_filename)
    
    else:
        r = requests.get(url, stream=True)

        start_time = time.time()
        last_time = start_time
        datasize = 0

        with open(local_filename, 'wb') as f:
            for chunk in r.iter_content(chunk_size=10000000): 
                if chunk: # filter out keep-alive new chunks
                    f.write(chunk)
                    f.flush()
                    datasize += len(chunk)
                    if (time.time() - last_time) > 2.5:
                        print "{:.1f} Mb in {:.1f}s / {}".format(datasize / 1.0e6, time.time() - start_time, expected_size)
                        last_time = time.time()

    return

In [3]:
import hashlib

def md5sum(filename, blocksize=65536):
    hash = hashlib.md5()
    with open(filename, "r+b") as f:
        for block in iter(lambda: f.read(blocksize), ""):
            hash.update(block)
    return hash.hexdigest()


def download_cached_file(location_url, local_file, expected_md5, expected_size="Unknown"):

    try:
        assert md5sum(local_file) == expected_md5
        print "Using cached file - {}".format(local_file)
        return(2)
    
    except (IOError, AssertionError) as error_info:
        # No file or the wrong file ... best go download it
        # print "Assertion failed - {}".format(sys.exc_info())
        
        try:
            data_file = download_file(location_url, local_file, expected_size)
            print "Downloaded from {}".format( location_url )
            return(1)

        except:
            print "Unable to download {} [{}] ".format( location_url, sys.exc_info() )
            return(0)


def report_cached_file(local_file, expected_md5):
    
    import os.path
    
    if not os.path.isfile(local_file):
        print "Local file {} does not exist".format(local_file)
    else:
        if len(expected_md5) == 0 or md5sum(local_file) == expected_md5:
            print "Cached file {} is valid".format(local_file)
        else:
            print "Cached file {} failed, checksum {}".format(local_file, md5sum(local_file))

The resources "database"

The files are managed by keeping a table of the download point and a checksum to validate the file.

Although it is a little laborious to set this up, it is a useful way to keep track of the data sources. For very large collections, you would probably do better with a database not a hand-built dictionary

The database takes the form of a dictionary like this:

resource_list = [
# Global magnetic data 
{
 "local_file":"../../Data/Resources/EMAG2_image_V2.tif",
 "md5":"c4944c27ed22ddc89225e506936b016b",
 "url":"http://geomag.org/models/EMAG2/EMAG2_image_V2.tif",
 "expected_size":"133Mb"
},

# and so on ...

In [4]:
# ../../Data/Resources required for the tutorial
# The checksum is to make sure any cached file is the right one.
# If the checksum is wrong the file gets downloaded again.

# Some of these files are local, stored in the repo in compressed form and installed into the
# ../../Data/Resources directory. 

resource_list = [
# Global magnetic data 
{
 "local_file":"../../Data/Resources/EMAG2_image_V2.tif",
 "md5":"c4944c27ed22ddc89225e506936b016b",
 "url":"http://geomag.org/models/EMAG2/EMAG2_image_V2.tif",
 "expected_size":"133Mb"
},
    
# Australian Mag Data from AuScope portal (built by hand)
{
 "local_file":"../../Data/Resources/AusMagAll.tiff.zip",
 "md5":'',
 "url":"../../Data/Reference/AusMagAll.tiff.zip",
 "expected_size":"10Mb"
},
    
# Blue Marble Image Geotiff June 2004 (11Mb)  
{
 "local_file": "../../Data/Resources/BlueMarbleNG-TB_2004-06-01_rgb_3600x1800.TIFF",
 "md5": '55e1399674d43a26353d84c114d7ff80',
 "url":"http://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=526294&cs=rgb&format=TIFF&width=3600&height=1800",
 "expected_size":"11Mb"
},
    
    
# Blue Marble Image with Bathymetry png - December 2004 
{
 "local_file": "../../Data/Resources/BlueMarbleNG-TB_2004-12-01_rgb_3600x1800.TIFF",
 "md5": '825da4b417ae19e24d2ea6db6cf8ad21',
 "url":"http://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=526311&cs=rgb&format=TIFF&width=3600&height=1800",
 "expected_size":"11Mb"
},
    
# Etopo1 - color image 
{
 "local_file": "../../Data/Resources/color_etopo1_ice_low.tif.zip",
 "md5": '3f53d72e85393deb28874db0c76fbfcb',
 "url":"https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/image/color_etopo1_ice_low.tif.zip",
 "expected_size":"35Mb"
},
    
# Etopo1 - bw shaded relief image 
{
 "local_file": "../../Data/Resources/etopo1_grayscale_hillshade.tif.zip",
 "md5": 'f38b8dc6cd971d72e77edaa837d5b85c',
 "url":"https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/image/etopo1_grayscale_hillshade.tif.zip",
 "expected_size":"115Mb"
},
    
    
# ETOPO_c_geotiff_10800 ... cell centred data for ETOPO1 
{
 "local_file": "../../Data/Resources/ETOPO_c_geotiff_10800.tif.zip",
 "md5":"fbd0478d0974ca433cdd5cb3530d0d48",
 "url":"https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/cell_registered/georeferenced_tiff/ETOPO1_Ice_c_geotiff.zip",
 "expected_size":"320Mb"
},    
    
# Natural Earth Hypsometry Images (same grid size as ETOPO1 image above)
{
 "local_file":"../../Data/Resources/HYP_50M_SR_W.zip",
 "md5":"f3323bc6f38ddec98cff4936fb324ec5",
 "url":"http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/raster/HYP_50M_SR_W.zip",
 "expected_size":"102Mb"
},   
 
# Natural Earth Ocean Bottom Images (same grid size as ETOPO1 image above)
{
 "local_file":"../../Data/Resources/OB_50M.zip",
 "md5":"69a2ed6ff8cf30b2dedd2d80461f9e43",
 "url":"http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/raster/OB_50M.zip",
 "expected_size":"50Mb"
},   
            
# Global age grid  [LOCAL]
{
 "local_file":"../../Data/Resources/global_age_data.3.6.z.npz",
 "md5":'',
 "url":"../../Data/Reference/global_age_data.3.6.z.npz",
 "expected_size":"22Mb"
},
 
# Global age grid (raw) [LOCAL]
{
 "local_file":"../../Data/Resources/global_age_data.3.6.xyz.zip",
 "md5":'',
 "url":"../../Data/Reference/global_age_data.3.6.xyz",
 "expected_size":"22Mb"
},


# Global second invariant of strain rate [LOCAL]
{
 "local_file":"../../Data/Resources/sec_invariant_strain_0.2.dat.zip",
 "md5":'',
 "url":"../../Data/Reference/sec_invariant_strain_0.2.dat.zip",
 "expected_size":"4Mb"
},
  
    
# Earthquake data for various regions as json files [LOCAL]
{
 "local_file":"../../Data/Resources/Earthquake_data.zip",
 "md5":'',
 "url":"../../Data/Reference/Earthquake_data.zip",
 "expected_size":"4Mb"
},
    
    
# Global surface velocity vector fields in various reference frames:
# http://gsrm.unavco.org/model/
# There are others ... 
    
{
 "local_file":"../../Data/Resources/velocity_AU.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_AU.nc",
 "expected_size":"1Mb"
},   
  
{
 "local_file":"../../Data/Resources/velocity_EU.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_EU.nc",
 "expected_size":"1Mb"
},   


{
 "local_file":"../../Data/Resources/velocity_IN.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_IN.nc",
 "expected_size":"1Mb"
},   


{
 "local_file":"../../Data/Resources/velocity_NA.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_NA.nc",
 "expected_size":"1Mb"
},   


{
 "local_file":"../../Data/Resources/velocity_OK.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_OK.nc",
 "expected_size":"1Mb"
},   


{
 "local_file":"../../Data/Resources/velocity_NNR.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_NNR.nc",
 "expected_size":"1Mb"
},   


{
 "local_file":"../../Data/Resources/velocity_PA.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_PA.nc",
 "expected_size":"1Mb"
},   


{
 "local_file":"../../Data/Resources/velocity_TA.nc",
 "md5":'',
 "url":"../../Data/Reference/velocity_TA.nc",
 "expected_size":"1Mb"
},   


       
]

In [5]:
for resource in resource_list:
    print "\nChecking {:s} ({})".format(resource["local_file"], resource["md5"])
    report_cached_file(resource["local_file"],resource["md5"])


Checking ../../Data/Resources/EMAG2_image_V2.tif (c4944c27ed22ddc89225e506936b016b)
Local file ../../Data/Resources/EMAG2_image_V2.tif does not exist

Checking ../../Data/Resources/AusMagAll.tiff.zip ()
Cached file ../../Data/Resources/AusMagAll.tiff.zip is valid

Checking ../../Data/Resources/BlueMarbleNG-TB_2004-06-01_rgb_3600x1800.TIFF (55e1399674d43a26353d84c114d7ff80)
Local file ../../Data/Resources/BlueMarbleNG-TB_2004-06-01_rgb_3600x1800.TIFF does not exist

Checking ../../Data/Resources/BlueMarbleNG-TB_2004-12-01_rgb_3600x1800.TIFF (825da4b417ae19e24d2ea6db6cf8ad21)
Local file ../../Data/Resources/BlueMarbleNG-TB_2004-12-01_rgb_3600x1800.TIFF does not exist

Checking ../../Data/Resources/color_etopo1_ice_low.tif.zip (3f53d72e85393deb28874db0c76fbfcb)
Local file ../../Data/Resources/color_etopo1_ice_low.tif.zip does not exist

Checking ../../Data/Resources/etopo1_grayscale_hillshade.tif.zip (f38b8dc6cd971d72e77edaa837d5b85c)
Local file ../../Data/Resources/etopo1_grayscale_hillshade.tif.zip does not exist

Checking ../../Data/Resources/ETOPO_c_geotiff_10800.tif.zip (fbd0478d0974ca433cdd5cb3530d0d48)
Local file ../../Data/Resources/ETOPO_c_geotiff_10800.tif.zip does not exist

Checking ../../Data/Resources/HYP_50M_SR_W.zip (f3323bc6f38ddec98cff4936fb324ec5)
Local file ../../Data/Resources/HYP_50M_SR_W.zip does not exist

Checking ../../Data/Resources/OB_50M.zip (69a2ed6ff8cf30b2dedd2d80461f9e43)
Local file ../../Data/Resources/OB_50M.zip does not exist

Checking ../../Data/Resources/global_age_data.3.6.z.npz ()
Cached file ../../Data/Resources/global_age_data.3.6.z.npz is valid

Checking ../../Data/Resources/global_age_data.3.6.xyz.zip ()
Cached file ../../Data/Resources/global_age_data.3.6.xyz.zip is valid

Checking ../../Data/Resources/sec_invariant_strain_0.2.dat.zip ()
Cached file ../../Data/Resources/sec_invariant_strain_0.2.dat.zip is valid

Checking ../../Data/Resources/Earthquake_data.zip ()
Cached file ../../Data/Resources/Earthquake_data.zip is valid

Checking ../../Data/Resources/velocity_AU.nc ()
Cached file ../../Data/Resources/velocity_AU.nc is valid

Checking ../../Data/Resources/velocity_EU.nc ()
Cached file ../../Data/Resources/velocity_EU.nc is valid

Checking ../../Data/Resources/velocity_IN.nc ()
Cached file ../../Data/Resources/velocity_IN.nc is valid

Checking ../../Data/Resources/velocity_NA.nc ()
Cached file ../../Data/Resources/velocity_NA.nc is valid

Checking ../../Data/Resources/velocity_OK.nc ()
Cached file ../../Data/Resources/velocity_OK.nc is valid

Checking ../../Data/Resources/velocity_NNR.nc ()
Cached file ../../Data/Resources/velocity_NNR.nc is valid

Checking ../../Data/Resources/velocity_PA.nc ()
Cached file ../../Data/Resources/velocity_PA.nc is valid

Checking ../../Data/Resources/velocity_TA.nc ()
Cached file ../../Data/Resources/velocity_TA.nc is valid

In [6]:
for resource in resource_list:
    print "\nDownloading {:s}".format(resource["local_file"])
    download_cached_file(resource["url"], resource["local_file"], resource["md5"], resource["expected_size"] )


Downloading ../../Data/Resources/EMAG2_image_V2.tif
2.9 Mb in 2.6s / 133Mb
9.3 Mb in 5.1s / 133Mb
17.9 Mb in 7.7s / 133Mb
24.9 Mb in 10.2s / 133Mb
33.4 Mb in 12.9s / 133Mb
40.5 Mb in 15.4s / 133Mb
47.3 Mb in 18.0s / 133Mb
53.6 Mb in 20.5s / 133Mb
59.3 Mb in 23.1s / 133Mb
64.4 Mb in 25.7s / 133Mb
70.1 Mb in 28.3s / 133Mb
76.4 Mb in 30.9s / 133Mb
83.0 Mb in 33.4s / 133Mb
89.8 Mb in 35.9s / 133Mb
97.3 Mb in 38.4s / 133Mb
104.4 Mb in 41.1s / 133Mb
111.2 Mb in 43.6s / 133Mb
118.3 Mb in 46.2s / 133Mb
125.4 Mb in 48.7s / 133Mb
131.8 Mb in 51.3s / 133Mb
Downloaded from http://geomag.org/models/EMAG2/EMAG2_image_V2.tif

Downloading ../../Data/Resources/AusMagAll.tiff.zip
Downloaded from ../../Data/Reference/AusMagAll.tiff.zip

Downloading ../../Data/Resources/BlueMarbleNG-TB_2004-06-01_rgb_3600x1800.TIFF
1.4 Mb in 2.5s / 11Mb
6.7 Mb in 5.0s / 11Mb
Downloaded from http://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=526294&cs=rgb&format=TIFF&width=3600&height=1800

Downloading ../../Data/Resources/BlueMarbleNG-TB_2004-12-01_rgb_3600x1800.TIFF
0.5 Mb in 2.6s / 11Mb
1.4 Mb in 5.2s / 11Mb
2.1 Mb in 7.9s / 11Mb
3.1 Mb in 10.5s / 11Mb
4.3 Mb in 13.0s / 11Mb
5.5 Mb in 15.5s / 11Mb
7.0 Mb in 18.0s / 11Mb
9.5 Mb in 20.5s / 11Mb
Downloaded from http://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=526311&cs=rgb&format=TIFF&width=3600&height=1800

Downloading ../../Data/Resources/color_etopo1_ice_low.tif.zip
10.0 Mb in 5.4s / 35Mb
20.0 Mb in 9.2s / 35Mb
30.0 Mb in 13.6s / 35Mb
35.8 Mb in 16.5s / 35Mb
Downloaded from https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/image/color_etopo1_ice_low.tif.zip

Downloading ../../Data/Resources/etopo1_grayscale_hillshade.tif.zip
10.0 Mb in 6.5s / 115Mb
20.0 Mb in 12.3s / 115Mb
30.0 Mb in 18.3s / 115Mb
40.0 Mb in 23.9s / 115Mb
50.0 Mb in 29.9s / 115Mb
60.0 Mb in 35.5s / 115Mb
70.0 Mb in 40.3s / 115Mb
80.0 Mb in 44.9s / 115Mb
90.0 Mb in 48.8s / 115Mb
100.0 Mb in 55.6s / 115Mb
110.0 Mb in 66.7s / 115Mb
115.0 Mb in 71.8s / 115Mb
Downloaded from https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/image/etopo1_grayscale_hillshade.tif.zip

Downloading ../../Data/Resources/ETOPO_c_geotiff_10800.tif.zip
10.0 Mb in 7.7s / 320Mb
20.0 Mb in 12.5s / 320Mb
30.0 Mb in 20.2s / 320Mb
40.0 Mb in 30.0s / 320Mb
50.0 Mb in 44.8s / 320Mb
60.0 Mb in 48.1s / 320Mb
70.0 Mb in 51.2s / 320Mb
80.0 Mb in 54.2s / 320Mb
90.0 Mb in 57.0s / 320Mb
100.0 Mb in 60.8s / 320Mb
110.0 Mb in 64.4s / 320Mb
120.0 Mb in 68.2s / 320Mb
130.0 Mb in 76.5s / 320Mb
140.0 Mb in 82.2s / 320Mb
150.0 Mb in 87.2s / 320Mb
160.0 Mb in 91.0s / 320Mb
170.0 Mb in 94.2s / 320Mb
180.0 Mb in 97.6s / 320Mb
190.0 Mb in 104.1s / 320Mb
200.0 Mb in 109.3s / 320Mb
210.0 Mb in 113.5s / 320Mb
220.0 Mb in 117.3s / 320Mb
230.0 Mb in 120.8s / 320Mb
240.0 Mb in 125.1s / 320Mb
250.0 Mb in 132.7s / 320Mb
260.0 Mb in 139.2s / 320Mb
270.0 Mb in 144.2s / 320Mb
280.0 Mb in 149.6s / 320Mb
290.0 Mb in 156.9s / 320Mb
300.0 Mb in 161.9s / 320Mb
310.0 Mb in 169.8s / 320Mb
320.0 Mb in 173.6s / 320Mb
Downloaded from https://www.ngdc.noaa.gov/mgg/global/relief/ETOPO1/data/ice_surface/cell_registered/georeferenced_tiff/ETOPO1_Ice_c_geotiff.zip

Downloading ../../Data/Resources/HYP_50M_SR_W.zip
10.0 Mb in 52.1s / 102Mb
20.0 Mb in 104.2s / 102Mb
30.0 Mb in 156.4s / 102Mb
40.0 Mb in 208.4s / 102Mb
50.0 Mb in 260.4s / 102Mb
60.0 Mb in 312.6s / 102Mb
70.0 Mb in 364.5s / 102Mb
80.0 Mb in 416.7s / 102Mb
90.0 Mb in 468.7s / 102Mb
100.0 Mb in 520.7s / 102Mb
102.2 Mb in 532.2s / 102Mb
Downloaded from http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/raster/HYP_50M_SR_W.zip

Downloading ../../Data/Resources/OB_50M.zip
10.0 Mb in 52.3s / 50Mb
20.0 Mb in 104.3s / 50Mb
30.0 Mb in 156.2s / 50Mb
40.0 Mb in 208.9s / 50Mb
50.0 Mb in 261.8s / 50Mb
50.5 Mb in 264.3s / 50Mb
Downloaded from http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/raster/OB_50M.zip

Downloading ../../Data/Resources/global_age_data.3.6.z.npz
Downloaded from ../../Data/Reference/global_age_data.3.6.z.npz

Downloading ../../Data/Resources/global_age_data.3.6.xyz.zip
Unable to download ../../Data/Reference/global_age_data.3.6.xyz [(<class 'requests.exceptions.MissingSchema'>, MissingSchema("Invalid URL '../../Data/Reference/global_age_data.3.6.xyz': No schema supplied. Perhaps you meant http://../../Data/Reference/global_age_data.3.6.xyz?",), <traceback object at 0x1047589e0>)] 

Downloading ../../Data/Resources/sec_invariant_strain_0.2.dat.zip
Downloaded from ../../Data/Reference/sec_invariant_strain_0.2.dat.zip

Downloading ../../Data/Resources/Earthquake_data.zip
Downloaded from ../../Data/Reference/Earthquake_data.zip

Downloading ../../Data/Resources/velocity_AU.nc
Downloaded from ../../Data/Reference/velocity_AU.nc

Downloading ../../Data/Resources/velocity_EU.nc
Downloaded from ../../Data/Reference/velocity_EU.nc

Downloading ../../Data/Resources/velocity_IN.nc
Downloaded from ../../Data/Reference/velocity_IN.nc

Downloading ../../Data/Resources/velocity_NA.nc
Downloaded from ../../Data/Reference/velocity_NA.nc

Downloading ../../Data/Resources/velocity_OK.nc
Downloaded from ../../Data/Reference/velocity_OK.nc

Downloading ../../Data/Resources/velocity_NNR.nc
Downloaded from ../../Data/Reference/velocity_NNR.nc

Downloading ../../Data/Resources/velocity_PA.nc
Downloaded from ../../Data/Reference/velocity_PA.nc

Downloading ../../Data/Resources/velocity_TA.nc
Downloaded from ../../Data/Reference/velocity_TA.nc

In [7]:
# Extract any files that were downloaded as zip archives (keep the originals to avoid re-downloading)

import zipfile
import glob

for zipped in glob.glob("../../Data/Resources/*.zip"):
    with zipfile.ZipFile(zipped) as zf:
        zf.extractall("../../Data/Resources")
        print "Unzipped {}".format(zipped)


Unzipped ../../Data/Resources/AusMagAll.tiff.zip
Unzipped ../../Data/Resources/color_etopo1_ice_low.tif.zip
Unzipped ../../Data/Resources/Earthquake_data.zip
Unzipped ../../Data/Resources/etopo1_grayscale_hillshade.tif.zip
Unzipped ../../Data/Resources/ETOPO_c_geotiff_10800.tif.zip
Unzipped ../../Data/Resources/global_age_data.3.6.xyz.zip
Unzipped ../../Data/Resources/HYP_50M_SR_W.zip
Unzipped ../../Data/Resources/OB_50M.zip
Unzipped ../../Data/Resources/sec_invariant_strain_0.2.dat.zip

In [8]:
# if you add a new url / file to the download list above, add the md5 checksum as well !
# unless it is small enough to have a local copy. I would suggest still providing a url
# in the comments just in case.

md5sum("../../Data/Resources/etopo1_grayscale_hillshade.tif.zip")


Out[8]:
'f38b8dc6cd971d72e77edaa837d5b85c'

In [ ]: