{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "colab": { "name": "00_Setting_Colab_for_for_Spatial_Ecology_course.ipynb", "provenance": [], "collapsed_sections": [], "toc_visible": true }, "kernelspec": { "name": "python3", "display_name": "Python 3" } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "sq1mWu1aQ5E2" }, "source": [ "# Prepare Colab for Spatial Ecology courses\n", "We first mount your own google drive folder and then dowload the dataset and scripts that will be used during the full course. " ] }, { "cell_type": "markdown", "metadata": { "id": "3aZhWk78RjoN" }, "source": [ "**Mount your own google drive by following the instruction**" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "p4olCy2CC7sD", "outputId": "060bda63-637f-4941-a6d2-4c13d651f16a" }, "source": [ "from google.colab import drive\n", "drive.mount('/gdrive')" ], "execution_count": 1, "outputs": [ { "output_type": "stream", "text": [ "Mounted at /gdrive\n" ], "name": "stdout" } ] }, { "cell_type": "markdown", "metadata": { "id": "0Khsr1iTR675" }, "source": [ "List the mounted gdrive. If you have folders and files in you gdrive you should be able to see them" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "zlqSY3qcDcHw", "outputId": "dc1b9eba-9af9-48dd-ed90-a575178c1802" }, "source": [ "! ls /gdrive/MyDrive" ], "execution_count": 2, "outputs": [ { "output_type": "stream", "text": [ " auto\n", " Big_blue\n", "'Colab Notebooks'\n", "'Dataset for global stream network and MOSQLAND.gdoc'\n", "'Discharge Tasks.gdoc'\n", " Elena_intro.gdoc\n", " GeoCompCourse\n", " GeoCompYaleMay2020\n", " grants\n", "'ID PASSPORT'\n", " LandscapeGenetic\n", " Lawsuit\n", " Margosa\n", " panniers-trailers.pdf\n", " RDOC_CMS\n", " review\n", " Sofia_intro.gdoc\n", " Stream_Variables_dataset_selected.gsheet\n", " Taino\n", " yale\n" ], "name": "stdout" } ] }, { "cell_type": "markdown", "metadata": { "id": "oB-4BANfDa7B" }, "source": [ "Download the SE_data folder yousing git\n", "\n", "First remove the directory if already exist, then enter in the directory." ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "89hCSc1ES22L", "outputId": "22a0e5b6-c4fd-496d-c31b-b4ab2f3f9fb4" }, "source": [ "%rm -rf /gdrive/MyDrive/SE_data\n", "%cd /gdrive/MyDrive\n", "%ls " ], "execution_count": 3, "outputs": [ { "output_type": "stream", "text": [ "/gdrive/MyDrive\n", " \u001b[0m\u001b[01;34mauto\u001b[0m/\n", " \u001b[01;34mBig_blue\u001b[0m/\n", "\u001b[01;34m'Colab Notebooks'\u001b[0m/\n", "'Dataset for global stream network and MOSQLAND.gdoc'\n", "'Discharge Tasks.gdoc'\n", " Elena_intro.gdoc\n", " \u001b[01;34mGeoCompCourse\u001b[0m/\n", " \u001b[01;34mGeoCompYaleMay2020\u001b[0m/\n", " \u001b[01;34mgrants\u001b[0m/\n", "\u001b[01;34m'ID PASSPORT'\u001b[0m/\n", " \u001b[01;34mLandscapeGenetic\u001b[0m/\n", " \u001b[01;34mLawsuit\u001b[0m/\n", " \u001b[01;34mMargosa\u001b[0m/\n", " panniers-trailers.pdf\n", " \u001b[01;34mRDOC_CMS\u001b[0m/\n", " \u001b[01;34mreview\u001b[0m/\n", " Sofia_intro.gdoc\n", " Stream_Variables_dataset_selected.gsheet\n", " \u001b[01;34mTaino\u001b[0m/\n", " \u001b[01;34myale\u001b[0m/\n" ], "name": "stdout" } ] }, { "cell_type": "markdown", "metadata": { "id": "izXu0JukTKmh" }, "source": [ "Then perform the downloading" ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "PsX-L0eyB_pg", "outputId": "13d5fe51-ed8d-4d8f-96c0-d540987aea46" }, "source": [ "!git clone https://github.com/selvaje/SE_data.git" ], "execution_count": 4, "outputs": [ { "output_type": "stream", "text": [ "Cloning into 'SE_data'...\n", "remote: Enumerating objects: 188, done.\u001b[K\n", "remote: Counting objects: 100% (188/188), done.\u001b[K\n", "remote: Compressing objects: 100% (150/150), done.\u001b[K\n", "remote: Total 255 (delta 20), reused 183 (delta 18), pack-reused 67\u001b[K\n", "Receiving objects: 100% (255/255), 78.98 MiB | 13.21 MiB/s, done.\n", "Resolving deltas: 100% (23/23), done.\n", "Checking out files: 100% (161/161), done.\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "NZLJl_56Cv7E", "outputId": "d9bbec8a-169b-41e6-a21e-37b21b4a25b8" }, "source": [ "! ls -l SE_data/*" ], "execution_count": 6, "outputs": [ { "output_type": "stream", "text": [ "total 9\n", "drwx------ 4 root root 4096 Jan 6 02:37 exercise\n", "drwx------ 3 root root 4096 Jan 6 02:37 pktools_local\n", "-rw------- 1 root root 58 Jan 6 02:37 README.md\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "ro0LU45wTkFy", "outputId": "76e47390-dd4d-478b-e7eb-f2f9441c70b3" }, "source": [ "%cd /gdrive/MyDrive/SE_data" ], "execution_count": 7, "outputs": [ { "output_type": "stream", "text": [ "/gdrive/MyDrive/SE_data\n" ], "name": "stdout" } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "z9xv1XqsTqAZ", "outputId": "2108487d-64d1-4269-a919-7a8319e28589" }, "source": [ "! ls -l *" ], "execution_count": 8, "outputs": [ { "output_type": "stream", "text": [ "-rw------- 1 root root 58 Jan 6 02:37 README.md\n", "\n", "exercise:\n", "total 177\n", "-rw------- 1 root root 6592 Jan 6 02:37 00_Setting_Colab_for_for_Spatial_Ecology_course.ipynb\n", "-rw------- 1 root root 153327 Jan 6 02:37 01_gdal.ipynb\n", "-rw------- 1 root root 16338 Jan 6 02:37 02_pktools.ipynb\n", "drwx------ 7 root root 4096 Jan 6 02:37 geodata\n", "\n", "pktools_local:\n", "total 4\n", "drwx------ 5 root root 4096 Jan 6 02:37 usr\n" ], "name": "stdout" } ] }, { "cell_type": "markdown", "metadata": { "id": "FBZgZojhF8lh" }, "source": [ "**Start to learn**\n", "\n", "- 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 \n", "\n", "- Navigate into your Google Drive SE_data/exercise via GUI and open the *.ipynb by right click and \"open with\" > \"Google collaboratory\"" ] } ] }