Prepare Colab for Spatial Ecology courses

We first mount your own google drive folder and then dowload the dataset and scripts that will be used during the full course.

Mount your own google drive by following the instruction

[1]:
from google.colab import drive
drive.mount('/gdrive')
Mounted at /gdrive

List the mounted gdrive. If you have folders and files in you gdrive you should be able to see them

[2]:
! ls /gdrive/MyDrive
 auto
 Big_blue
'Colab Notebooks'
'Dataset for global stream network and MOSQLAND.gdoc'
'Discharge Tasks.gdoc'
 Elena_intro.gdoc
 GeoCompCourse
 GeoCompYaleMay2020
 grants
'ID PASSPORT'
 LandscapeGenetic
 Lawsuit
 Margosa
 panniers-trailers.pdf
 RDOC_CMS
 review
 Sofia_intro.gdoc
 Stream_Variables_dataset_selected.gsheet
 Taino
 yale

Download the SE_data folder yousing git

First remove the directory if already exist, then enter in the directory.

[3]:
%rm -rf /gdrive/MyDrive/SE_data
%cd /gdrive/MyDrive
%ls
/gdrive/MyDrive
 auto/
 Big_blue/
'Colab Notebooks'/
'Dataset for global stream network and MOSQLAND.gdoc'
'Discharge Tasks.gdoc'
 Elena_intro.gdoc
 GeoCompCourse/
 GeoCompYaleMay2020/
 grants/
'ID PASSPORT'/
 LandscapeGenetic/
 Lawsuit/
 Margosa/
 panniers-trailers.pdf
 RDOC_CMS/
 review/
 Sofia_intro.gdoc
 Stream_Variables_dataset_selected.gsheet
 Taino/
 yale/

Then perform the downloading

[4]:
!git clone https://github.com/selvaje/SE_data.git
Cloning into 'SE_data'...
remote: Enumerating objects: 188, done.
remote: Counting objects: 100% (188/188), done.
remote: Compressing objects: 100% (150/150), done.
remote: Total 255 (delta 20), reused 183 (delta 18), pack-reused 67
Receiving objects: 100% (255/255), 78.98 MiB | 13.21 MiB/s, done.
Resolving deltas: 100% (23/23), done.
Checking out files: 100% (161/161), done.
[6]:
! ls -l SE_data/*
total 9
drwx------ 4 root root 4096 Jan  6 02:37 exercise
drwx------ 3 root root 4096 Jan  6 02:37 pktools_local
-rw------- 1 root root   58 Jan  6 02:37 README.md
[7]:
%cd /gdrive/MyDrive/SE_data
/gdrive/MyDrive/SE_data
[8]:
! ls -l *
-rw------- 1 root root   58 Jan  6 02:37 README.md

exercise:
total 177
-rw------- 1 root root   6592 Jan  6 02:37 00_Setting_Colab_for_for_Spatial_Ecology_course.ipynb
-rw------- 1 root root 153327 Jan  6 02:37 01_gdal.ipynb
-rw------- 1 root root  16338 Jan  6 02:37 02_pktools.ipynb
drwx------ 7 root root   4096 Jan  6 02:37 geodata

pktools_local:
total 4
drwx------ 5 root root 4096 Jan  6 02:37 usr

Start to learn

  • Everytime that you ope a new jupter-notebook with colab you have to mount your gdrive and make it permanent by File > Update Drive preview

  • Navigate into your Google Drive SE_data/exercise via GUI and open the *.ipynb by right click and “open with” > “Google collaboratory”