{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Data Cube Cloud Statistics\n", "\n", "This notebook explores Landsat-7 and Landsat-8 Data Cubes and reports cloud statistics for selected regions within a cube. This is valuable information for performing analysis. For example, if there are extensive clouds for a season it may significantly impact the mosaic product or index values. Another example is that a user may want to find a single date when there are few clouds to assess land features." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Supress Warning \n", "import warnings\n", "warnings.filterwarnings('ignore')" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Load Data Cube Configuration\n", "import datacube\n", "dc = datacube.Datacube(app = 'my_app')\n", "# Import Data Cube API\n", "import utils.data_cube_utilities.data_access_api as dc_api \n", "api = dc_api.DataAccessApi()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "## LS8 Caqueta\n", "# Latitude: (0.000134747292617865, 1.077843593651382) \n", "# Longitude: (-74.91935994831539, -73.30266193148462) \n", "# '2013-04-13', '2018-03-26'\n", "# Resolution: (-0.000269494585236, 0.000269494585236)\n", "\n", "## LS8 Vietnam\n", "# Latitude: (10.513927001104687, 12.611133863411238) \n", "# Longitude: (106.79005909290998, 108.91906631627438) \n", "# '2014-01-14', '2016-12-21'\n", "# Resolution: (-0.000269494585236, 0.000269494585236)\n", "\n", "## LS7 Caqueta\n", "# Latitude: (0.000134747292617865, 1.077843593651382) \n", "# Longitude: (-74.91935994831539, -73.30266193148462) \n", "# '1999-08-21', '2018-03-25'\n", "# Resolution: (-0.000269494585236, 0.000269494585236)\n", "\n", "## LS7 Lake Baringo\n", "# Latitude: (0.4997747685, 0.7495947795) \n", "# Longitude: (35.9742163305, 36.473586859499996) \n", "# '2005-01-08', '2016-12-24'\n", "# Resolution: (-0.000269493, 0.000269493)" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# CHANGE HERE >>>>>>>>>>>>>>>>>\n", "\n", "# Select a Product and Platform\n", "# product = ls7_collection1_AMA_ingest\n", "# platform = \"LANDSAT_7\"\n", "\n", "product = 'ls8_collection1_AMA_ingest'\n", "platform = \"LANDSAT_8\"\n", "output_crs = 'EPSG:4326'\n", "resolution = (-0.000269494585236, 0.000269494585236)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# CHANGE HERE >>>>>>>>>>>>>>>>>>\n", "# Select an analysis region (Lat-Lon) within the extents listed above. \n", "# HINT: Keep your region small (<0.5 deg square) to avoid memory overload issues\n", "# Select a time period (Min-Max) within the extents listed above (Year-Month-Day)\n", "# This region and time period will be used for the cloud assessment\n", "\n", "#Sub-region selection - e.g Vietnam\n", "latitude = (11.3124, 10.9124)\n", "longitude = (106.9170, 107.3170) \n", "time_extents = ('2014-01-01', '2016-01-01')" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | times | \n", "clean_percentage | \n", "clean_count | \n", "
---|---|---|---|
0 | \n", "2014-02-15 03:08:30 | \n", "0.998885 | \n", "2202766 | \n", "
1 | \n", "2014-06-07 03:07:19 | \n", "0.593769 | \n", "1309395 | \n", "
2 | \n", "2014-06-23 03:07:22 | \n", "0.374145 | \n", "825075 | \n", "
3 | \n", "2014-07-25 03:07:32 | \n", "0.373095 | \n", "822758 | \n", "
4 | \n", "2014-11-30 03:07:51 | \n", "0.000000 | \n", "0 | \n", "
5 | \n", "2015-02-02 03:07:36 | \n", "0.976143 | \n", "2152615 | \n", "
6 | \n", "2015-04-07 03:07:02 | \n", "0.815570 | \n", "1798515 | \n", "
7 | \n", "2015-06-10 03:06:54 | \n", "0.507053 | \n", "1118167 | \n", "
8 | \n", "2015-08-29 03:07:27 | \n", "0.394455 | \n", "869861 | \n", "
9 | \n", "2015-09-30 03:07:40 | \n", "0.560573 | \n", "1236190 | \n", "
10 | \n", "2015-10-16 03:07:40 | \n", "0.710985 | \n", "1567881 | \n", "
11 | \n", "2015-12-03 03:07:48 | \n", "0.992532 | \n", "2188757 | \n", "