Difference between revisions of "Time Series Analysis using Google Earth Engine and Google Colab"

From CUOSGwiki
Jump to navigationJump to search
Line 12: Line 12:
 
=Initial Setup=
 
=Initial Setup=
 
==Signing up for an Earth Engine Account==
 
==Signing up for an Earth Engine Account==
 
[[File:Signup Part 1.png|thumb|150px|The first section of signup. Use your Google Account email, name, and institution (Carleton) with a description of why you will use Earth Engine to sign up.]]
 
[[File:Signup Part 2.png|150px|thumb|The second section of signup. Accept the terms of service, but do not apply for commercial use (unless you are interested in Commercial Earth Engine)]]
 
[[File:EarthEngineFailure.png|150px|thumb|The email that will appear if you fail in setting up an account. ]]
 
[[File:Success Email for Earth Engine.png|150px|thumb|The email that you want to receive, when successfully creating an account.]]
 
A key part in using Google Earth Engine for any purpose, either in Colab or the Code Editor, is setting up an account and applying for Earth Engine access.
 
A key part in using Google Earth Engine for any purpose, either in Colab or the Code Editor, is setting up an account and applying for Earth Engine access.
   
Line 17: Line 21:
   
 
With a Google account, you can apply for an Earth Engine account [https://signup.earthengine.google.com/#!/ here]. The setup process will be detailed below.
 
With a Google account, you can apply for an Earth Engine account [https://signup.earthengine.google.com/#!/ here]. The setup process will be detailed below.
  +
[[File:Signup Part 1.png|thumb|250px|The first section of signup. Use your Google Account email, name, and institution (Carleton) with a description of why you will use Earth Engine to sign up.]]
 
[[File:Signup Part 2.png|250px|thumb|The second section of signup. Accept the terms of service, but do not apply for commercial use (unless you are interested in Commercial Earth Engine)]]
 
[[File:EarthEngineFailure.png|250px|thumb|The email that will appear if you fail in setting up an account. ]]
 
[[File:Success Email for Earth Engine.png|250px|thumb|The email that you want to receive, when successfully creating an account.]]
 
 
Steps to the setup process:
 
Steps to the setup process:
 
* If you haven't already, create a Google platform account (with any type of email) at Google.ca (top right corner of page).
 
* If you haven't already, create a Google platform account (with any type of email) at Google.ca (top right corner of page).

Revision as of 17:21, 19 December 2021

Introduction/Earth Engine Background

Google Earth Engine is a powerful and useful platform with many built-in tools to run geospatial analyses using Google's servers and computational infrastructure. Earth Engine hosts a number of datasets of various categories and applications including selections of Landsat collections from 1979 to present, Sentinel collections, MODIS collections, and a host of various data including DEMs, crop inventories, several radiance sensors, and many more vector and raster datasets.

This data can be accessed, queried, and processed within a short timeframe and allows a user to select and process data into workable products within minutes. Google Earth Engine relies on user scripting to query datasets and process data into charts, graphs, maps, animations, applets, and any available products that Google's API offers. This tutorial will assume that you have an understanding of Python scripting and GIS experience, however all code will be provided.

Earth Engine offers a 'Code Editor' and 'Explorer' to find, access, and manipulate data. The Code Editor is used in strictly JavaScript API/language, an example of which can be seen at Supervised Classifications using Google Earth Engine by Loucas Diamant-Boustead. Rather than using the Code Editor exclusively, Google also offers a Python API within the Google Colab environment. Colab allows for instant Python writing and execution within a web browser, with little setup required. There are plenty of Python libraries that can be used to assist in geospatial analysis, with the ability to create, query, and mutate dataframes (like Excel), perform spatial joins, perform statistical analysis, and to map and plot trends using Earth Engine datasets.

This tutorial will focus on using Google Colab as a platform to perform Earth Engine analyses. Python functions and processes will be displayed as code and explained at a basic level, with a focus placed on the meaning/reasoning behind the code, rather than a full explanation of how Python scripting works. Basic levels of knowledge and understanding of GIS, statistics, and Python is highly recommended for this tutorial.

The subject of this walkthrough will focus on Google Earth Engine's Sentinel 5-P TROPOMI dataset, which is offered at a level 3 (pre-processed) product. Because it is pre-processed, its data products can be used directly to perform analysis. No pre-processing or quality assurance work is necessary (as is necessary with other Level 1-2 remote sensing datasets). Google Earth Engine's Colab API will be utilized to analyze changes in atmospheric nitrogen dioxide (NO2) during the 2020 COVID pandemic (specifically, their related lockdowns) using TROPOMI products. An example of both statistical/quantitative analysis and visual/qualitative analysis will be provided and walked through.

Initial Setup

Signing up for an Earth Engine Account

The first section of signup. Use your Google Account email, name, and institution (Carleton) with a description of why you will use Earth Engine to sign up.
The second section of signup. Accept the terms of service, but do not apply for commercial use (unless you are interested in Commercial Earth Engine)
The email that will appear if you fail in setting up an account.
The email that you want to receive, when successfully creating an account.

A key part in using Google Earth Engine for any purpose, either in Colab or the Code Editor, is setting up an account and applying for Earth Engine access.

Although Google Earth Engine is an 'open' platform, it does require that you fill out a form to setup an Earth Engine account. As well, you'll need to create a Google-platform account in order to access Earth Engine and Google Colab notebooks/Google Drive, so the preliminary step would be to sign-in or sign up for a Google Account on the Google platform.

With a Google account, you can apply for an Earth Engine account here. The setup process will be detailed below.

Steps to the setup process:

  • If you haven't already, create a Google platform account (with any type of email) at Google.ca (top right corner of page).
  • Go to this website and sign-up for an Earth Engine account
  • Add your email (this will be done automatically if signed in to Google).
  • Add your first and last name (don't lie here!)
  • Add your institution (likely Carleton University) and type of institution (likely Education/Academic).
  • Select your region (likely Canada)
  • Provide a few sentence description of why you want to use Earth Engine
  • Accept the Terms of Service
    • Do not apply for a commercial-use license
  • Prove you are not a robot
  • You will likely receive an email of your successful registration within 24 hours.


And that's all it takes to sign-up for an Earth Engine account! It usually is a very simple process, and if you are denied you can re-apply. The most common reason for denial would be incorrect information, or the accidental application for a commercial license.

Setting up your Google Colab Environment