{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "kOn6Dorgx2wk" }, "source": [ "--------\n", "\n", "# Search and filter S1 and S2 data\n", "\n", "--------\n", "\n", "**Short description**\n", "\n", "This notebook introduces the Search and Filter functionality for SpaceSense catalog entries.\n", "\n", "In this notebook, you will search for Sentinel-1 and Sentinel-2 images over a specified area and time, and filter the returned results.\n", "\n", "--------\n", "\n", "![Thumbnail](../resources/thumbnails/filter_thumb_1.png)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "o4gN2FtIx2wl" }, "source": [ "### 0 - Install Spacesense Client Library and dependencies" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Please follow the [installation process](../gettingstarted/installation.rst) and use the virtual environment in this notebook." ] }, { "attachments": {}, "cell_type": "markdown", "metadata": { "colab_type": "text", "id": "keC_14irx2wq" }, "source": [ "### 1 - Import spacesense object(s) and other dependencies" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "colab": {}, "colab_type": "code", "id": "l1WpZ6RSx2wr" }, "outputs": [], "source": [ "from spacesense import Client" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 2 - Configure the API Key by setting the `SS_API_KEY` environment variable" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import os\n", "if \"SS_API_KEY\" not in os.environ:\n", " from getpass import getpass\n", " api_key = getpass('Enter your api key : ')\n", " os.environ[\"SS_API_KEY\"] = api_key" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 3 - Define AOI and output options" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Define the AOI\n", "aoi = {\n", " \"type\": \"FeatureCollection\",\n", " \"features\": [\n", " {\n", " \"id\": \"0\",\n", " \"type\": \"Feature\",\n", " \"properties\": {},\n", " \"geometry\": {\n", " \"type\": \"Polygon\",\n", " \"coordinates\": [\n", " [\n", " [\n", " 8.622499,\n", " 39.831038\n", " ],\n", " [\n", " 8.622499,\n", " 39.827197\n", " ],\n", " [\n", " 8.630311,\n", " 39.827197\n", " ],\n", " [\n", " 8.630311,\n", " 39.831038\n", " ],\n", " [\n", " 8.622499,\n", " 39.831038\n", " ]\n", " ]\n", " ]\n", " }\n", " }\n", " ]\n", "}\n", "\n", "# Get an instance of the SpaceSense Client object\n", "client = Client(id=\"search_filter_s1_s2\")\n", "\n", "# Enable to save data in local files\n", "client.enable_local_output()" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 4 - Search S1" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titledateswath_coverage_percentagerelativeorbitnumberlastrelativeorbitnumberproducttypesensoroperationalmodeacquisitiontypepolarisationmodebeginpositionplatformnamemissiondatatakeidorbitdirectionorbitnumberinstrumentnamelastorbitnumberendpositioningestiondateslicenumberplatformidentifier
0S1B_IW_GRDH_1SDV_20210101T...2021-01-01100.088.088.0GRDIWNOMINALVV VH2021-01-01T17:21:05.249000Sentinel-1194718.0ASCENDING24964.0Synthetic Aperture Radar (...24964.02021-01-01T17:21:30.2480002021-01-01T21:41:44.62600010.02016-025A
1S1A_IW_GRDH_1SDV_20210101T...2021-01-01100.0168.0168.0GRDIWNOMINALVV VH2021-01-01T05:28:57.811000Sentinel-1275881.0DESCENDING35940.0Synthetic Aperture Radar (...35940.02021-01-01T05:29:22.8110002021-01-01T09:42:44.75200024.02014-016A
2S1A_IW_GRDH_1SDV_20210107T...2021-01-07100.088.088.0GRDIWNOMINALVV VH2021-01-07T17:21:54.456000Sentinel-1276727.0ASCENDING36035.0Synthetic Aperture Radar (...36035.02021-01-07T17:22:19.4560002021-01-08T19:10:51.0740007.02014-016A
3S1B_IW_GRDH_1SDV_20210107T...2021-01-07100.0168.0168.0GRDIWNOMINALVV VH2021-01-07T05:28:18.784000Sentinel-1195358.0DESCENDING25044.0Synthetic Aperture Radar (...25044.02021-01-07T05:28:53.8390002021-01-07T10:54:44.85600011.02016-025A
4S1B_IW_GRDH_1SDV_20210113T...2021-01-13100.088.088.0GRDIWNOMINALVV VH2021-01-13T17:21:04.721000Sentinel-1196160.0ASCENDING25139.0Synthetic Aperture Radar (...25139.02021-01-13T17:21:29.7190002021-01-14T12:43:29.26400010.02016-025A
5S1A_IW_GRDH_1SDV_20210113T...2021-01-13100.0168.0168.0GRDIWNOMINALVV VH2021-01-13T05:28:59.422000Sentinel-1277466.0DESCENDING36115.0Synthetic Aperture Radar (...36115.02021-01-13T05:29:24.4210002021-01-13T10:04:56.3750005.02014-016A
\n", "
" ], "text/plain": [ " title date swath_coverage_percentage \\\n", "0 S1B_IW_GRDH_1SDV_20210101T... 2021-01-01 100.0 \n", "1 S1A_IW_GRDH_1SDV_20210101T... 2021-01-01 100.0 \n", "2 S1A_IW_GRDH_1SDV_20210107T... 2021-01-07 100.0 \n", "3 S1B_IW_GRDH_1SDV_20210107T... 2021-01-07 100.0 \n", "4 S1B_IW_GRDH_1SDV_20210113T... 2021-01-13 100.0 \n", "5 S1A_IW_GRDH_1SDV_20210113T... 2021-01-13 100.0 \n", "\n", " relativeorbitnumber lastrelativeorbitnumber producttype \\\n", "0 88.0 88.0 GRD \n", "1 168.0 168.0 GRD \n", "2 88.0 88.0 GRD \n", "3 168.0 168.0 GRD \n", "4 88.0 88.0 GRD \n", "5 168.0 168.0 GRD \n", "\n", " sensoroperationalmode acquisitiontype polarisationmode \\\n", "0 IW NOMINAL VV VH \n", "1 IW NOMINAL VV VH \n", "2 IW NOMINAL VV VH \n", "3 IW NOMINAL VV VH \n", "4 IW NOMINAL VV VH \n", "5 IW NOMINAL VV VH \n", "\n", " beginposition platformname missiondatatakeid orbitdirection \\\n", "0 2021-01-01T17:21:05.249000 Sentinel-1 194718.0 ASCENDING \n", "1 2021-01-01T05:28:57.811000 Sentinel-1 275881.0 DESCENDING \n", "2 2021-01-07T17:21:54.456000 Sentinel-1 276727.0 ASCENDING \n", "3 2021-01-07T05:28:18.784000 Sentinel-1 195358.0 DESCENDING \n", "4 2021-01-13T17:21:04.721000 Sentinel-1 196160.0 ASCENDING \n", "5 2021-01-13T05:28:59.422000 Sentinel-1 277466.0 DESCENDING \n", "\n", " orbitnumber instrumentname lastorbitnumber \\\n", "0 24964.0 Synthetic Aperture Radar (... 24964.0 \n", "1 35940.0 Synthetic Aperture Radar (... 35940.0 \n", "2 36035.0 Synthetic Aperture Radar (... 36035.0 \n", "3 25044.0 Synthetic Aperture Radar (... 25044.0 \n", "4 25139.0 Synthetic Aperture Radar (... 25139.0 \n", "5 36115.0 Synthetic Aperture Radar (... 36115.0 \n", "\n", " endposition ingestiondate slicenumber \\\n", "0 2021-01-01T17:21:30.248000 2021-01-01T21:41:44.626000 10.0 \n", "1 2021-01-01T05:29:22.811000 2021-01-01T09:42:44.752000 24.0 \n", "2 2021-01-07T17:22:19.456000 2021-01-08T19:10:51.074000 7.0 \n", "3 2021-01-07T05:28:53.839000 2021-01-07T10:54:44.856000 11.0 \n", "4 2021-01-13T17:21:29.719000 2021-01-14T12:43:29.264000 10.0 \n", "5 2021-01-13T05:29:24.421000 2021-01-13T10:04:56.375000 5.0 \n", "\n", " platformidentifier \n", "0 2016-025A \n", "1 2014-016A \n", "2 2014-016A \n", "3 2016-025A \n", "4 2016-025A \n", "5 2014-016A " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "start_date = \"2021-01-01\"\n", "end_date = \"2021-01-17\"\n", "# Retrieves all S1 images corresponding to the aoi, start date, and end date\n", "res_S1 = client.s1_search(aoi=aoi, start_date=start_date, end_date=end_date)\n", "res_S1.dataframe" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 5 - Search S2" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
iddatetilevalid_pixel_percentageplatformrelative_orbit_numberproduct_iddatetimeswath_coverage_percentageno_datacloud_shadowsvegetationnot_vegetatedwatercloud_medium_probabilitycloud_high_probabilitythin_cirrussnow
12S2B_32TMK_20210101_0_L2A2021-01-0132TMK0.00sentinel-2b065S2B_MSIL2A_20210101T102329_N0214_R065_T32TMK_2...2021-01-01T10:29:42Z100.00.00.00.000.000.00.00100.000.000.0
11S2A_32TMK_20210103_0_L2A2021-01-0332TMK0.00sentinel-2a022S2A_MSIL2A_20210103T101411_N0214_R022_T32TMK_2...2021-01-03T10:19:48Z100.00.00.00.000.000.00.00100.000.000.0
10S2A_32TMK_20210106_0_L2A2021-01-0632TMK0.00sentinel-2a065S2A_MSIL2A_20210106T102411_N0214_R065_T32TMK_2...2021-01-06T10:29:44Z100.00.00.00.000.000.00.00100.000.000.0
9S2B_32TMK_20210108_0_L2A2021-01-0832TMK50.73sentinel-2b022S2B_MSIL2A_20210108T101319_N0214_R022_T32TMK_2...2021-01-08T10:19:47Z100.00.00.00.000.000.049.270.000.000.0
8S2B_32TMK_20210111_0_L2A2021-01-1132TMK5.08sentinel-2b065S2B_MSIL2A_20210111T102309_N0214_R065_T32TMK_2...2021-01-11T10:29:43Z100.00.00.00.000.000.016.6977.530.700.0
7S2A_32TMK_20210113_0_L2A2021-01-1332TMK0.00sentinel-2a022S2A_MSIL2A_20210113T101401_N0214_R022_T32TMK_2...2021-01-13T10:19:48Z100.00.00.00.000.000.00.00100.000.000.0
6S2A_32TMK_20210116_0_L2A2021-01-1632TMK100.00sentinel-2a065S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2...2021-01-16T10:29:44Z100.00.00.097.560.000.00.000.000.000.0
5S2B_32TMK_20210118_0_L2A2021-01-1832TMK100.00sentinel-2b022S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2...2021-01-18T10:19:47Z100.00.00.096.590.490.00.000.000.000.0
4S2B_32TMK_20210121_0_L2A2021-01-2132TMK0.00sentinel-2b065S2B_MSIL2A_20210121T102239_N0214_R065_T32TMK_2...2021-01-21T10:29:43Z100.00.00.00.000.000.061.380.0038.620.0
3S2A_32TMK_20210123_0_L2A2021-01-2332TMK100.00sentinel-2a022S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2...2021-01-23T10:19:48Z100.00.00.097.400.000.00.000.000.000.0
2S2A_32TMK_20210126_0_L2A2021-01-2632TMK100.00sentinel-2a065S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2...2021-01-26T10:29:44Z100.00.00.097.400.000.00.000.000.000.0
1S2B_32TMK_20210128_0_L2A2021-01-2832TMK0.00sentinel-2b022S2B_MSIL2A_20210128T101159_N0214_R022_T32TMK_2...2021-01-28T10:19:47Z100.00.00.00.000.000.00.00100.000.000.0
0S2B_32TMK_20210131_0_L2A2021-01-3132TMK0.00sentinel-2b065S2B_MSIL2A_20210131T102149_N0214_R065_T32TMK_2...2021-01-31T10:29:43Z100.00.00.00.000.000.00.00100.000.000.0
\n", "
" ], "text/plain": [ " id date tile valid_pixel_percentage \\\n", "12 S2B_32TMK_20210101_0_L2A 2021-01-01 32TMK 0.00 \n", "11 S2A_32TMK_20210103_0_L2A 2021-01-03 32TMK 0.00 \n", "10 S2A_32TMK_20210106_0_L2A 2021-01-06 32TMK 0.00 \n", "9 S2B_32TMK_20210108_0_L2A 2021-01-08 32TMK 50.73 \n", "8 S2B_32TMK_20210111_0_L2A 2021-01-11 32TMK 5.08 \n", "7 S2A_32TMK_20210113_0_L2A 2021-01-13 32TMK 0.00 \n", "6 S2A_32TMK_20210116_0_L2A 2021-01-16 32TMK 100.00 \n", "5 S2B_32TMK_20210118_0_L2A 2021-01-18 32TMK 100.00 \n", "4 S2B_32TMK_20210121_0_L2A 2021-01-21 32TMK 0.00 \n", "3 S2A_32TMK_20210123_0_L2A 2021-01-23 32TMK 100.00 \n", "2 S2A_32TMK_20210126_0_L2A 2021-01-26 32TMK 100.00 \n", "1 S2B_32TMK_20210128_0_L2A 2021-01-28 32TMK 0.00 \n", "0 S2B_32TMK_20210131_0_L2A 2021-01-31 32TMK 0.00 \n", "\n", " platform relative_orbit_number \\\n", "12 sentinel-2b 065 \n", "11 sentinel-2a 022 \n", "10 sentinel-2a 065 \n", "9 sentinel-2b 022 \n", "8 sentinel-2b 065 \n", "7 sentinel-2a 022 \n", "6 sentinel-2a 065 \n", "5 sentinel-2b 022 \n", "4 sentinel-2b 065 \n", "3 sentinel-2a 022 \n", "2 sentinel-2a 065 \n", "1 sentinel-2b 022 \n", "0 sentinel-2b 065 \n", "\n", " product_id datetime \\\n", "12 S2B_MSIL2A_20210101T102329_N0214_R065_T32TMK_2... 2021-01-01T10:29:42Z \n", "11 S2A_MSIL2A_20210103T101411_N0214_R022_T32TMK_2... 2021-01-03T10:19:48Z \n", "10 S2A_MSIL2A_20210106T102411_N0214_R065_T32TMK_2... 2021-01-06T10:29:44Z \n", "9 S2B_MSIL2A_20210108T101319_N0214_R022_T32TMK_2... 2021-01-08T10:19:47Z \n", "8 S2B_MSIL2A_20210111T102309_N0214_R065_T32TMK_2... 2021-01-11T10:29:43Z \n", "7 S2A_MSIL2A_20210113T101401_N0214_R022_T32TMK_2... 2021-01-13T10:19:48Z \n", "6 S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2... 2021-01-16T10:29:44Z \n", "5 S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2... 2021-01-18T10:19:47Z \n", "4 S2B_MSIL2A_20210121T102239_N0214_R065_T32TMK_2... 2021-01-21T10:29:43Z \n", "3 S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2... 2021-01-23T10:19:48Z \n", "2 S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2... 2021-01-26T10:29:44Z \n", "1 S2B_MSIL2A_20210128T101159_N0214_R022_T32TMK_2... 2021-01-28T10:19:47Z \n", "0 S2B_MSIL2A_20210131T102149_N0214_R065_T32TMK_2... 2021-01-31T10:29:43Z \n", "\n", " swath_coverage_percentage no_data cloud_shadows vegetation \\\n", "12 100.0 0.0 0.0 0.00 \n", "11 100.0 0.0 0.0 0.00 \n", "10 100.0 0.0 0.0 0.00 \n", "9 100.0 0.0 0.0 0.00 \n", "8 100.0 0.0 0.0 0.00 \n", "7 100.0 0.0 0.0 0.00 \n", "6 100.0 0.0 0.0 97.56 \n", "5 100.0 0.0 0.0 96.59 \n", "4 100.0 0.0 0.0 0.00 \n", "3 100.0 0.0 0.0 97.40 \n", "2 100.0 0.0 0.0 97.40 \n", "1 100.0 0.0 0.0 0.00 \n", "0 100.0 0.0 0.0 0.00 \n", "\n", " not_vegetated water cloud_medium_probability cloud_high_probability \\\n", "12 0.00 0.0 0.00 100.00 \n", "11 0.00 0.0 0.00 100.00 \n", "10 0.00 0.0 0.00 100.00 \n", "9 0.00 0.0 49.27 0.00 \n", "8 0.00 0.0 16.69 77.53 \n", "7 0.00 0.0 0.00 100.00 \n", "6 0.00 0.0 0.00 0.00 \n", "5 0.49 0.0 0.00 0.00 \n", "4 0.00 0.0 61.38 0.00 \n", "3 0.00 0.0 0.00 0.00 \n", "2 0.00 0.0 0.00 0.00 \n", "1 0.00 0.0 0.00 100.00 \n", "0 0.00 0.0 0.00 100.00 \n", "\n", " thin_cirrus snow \n", "12 0.00 0.0 \n", "11 0.00 0.0 \n", "10 0.00 0.0 \n", "9 0.00 0.0 \n", "8 0.70 0.0 \n", "7 0.00 0.0 \n", "6 0.00 0.0 \n", "5 0.00 0.0 \n", "4 38.62 0.0 \n", "3 0.00 0.0 \n", "2 0.00 0.0 \n", "1 0.00 0.0 \n", "0 0.00 0.0 " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "start_date = \"2021-01-01\"\n", "end_date = \"2021-01-31\"\n", "# Retrieves all S2 images corresponding to the aoi, start date, and end date\n", "res_S2 = client.s2_search(aoi=aoi, start_date=start_date, end_date=end_date)\n", "res_S2.dataframe" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 6 - S2 search results can be viewed using a calendar" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 2021 \n", "\n", " January February March \n", "Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n", " \u001b[42m 1\u001b[0m 2 \u001b[41m 3\u001b[0m 1 2 3 4 5 6 7 1 2 3 4 5 6 7 \n", " 4 5 \u001b[41m 6\u001b[0m 7 \u001b[42m 8\u001b[0m 9 10 8 9 10 11 12 13 14 8 9 10 11 12 13 14 \n", "\u001b[42m11\u001b[0m 12 \u001b[41m13\u001b[0m 14 15 \u001b[41m16\u001b[0m 17 15 16 17 18 19 20 21 15 16 17 18 19 20 21 \n", "\u001b[42m18\u001b[0m 19 20 \u001b[42m21\u001b[0m 22 \u001b[41m23\u001b[0m 24 22 23 24 25 26 27 28 22 23 24 25 26 27 28 \n", "25 \u001b[41m26\u001b[0m 27 \u001b[42m28\u001b[0m 29 30 \u001b[42m31\u001b[0m 29 30 31 \n", "\n", "\u001b[41msentinel-2a (1)\u001b[0m\n", "\u001b[42msentinel-2b (1)\u001b[0m\n", "13 total dates\n" ] } ], "source": [ "print(res_S2.item_collection.calendar())" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### 7 - Filter and select only the S1 and S2 images you require\n", "There are many ways to select the data you need, as it is simply manipulating the Pandas Dataframe object. [Here](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) is a link to the Pandas documentation for DataFrames, and there are introductory tutorials available to teach the basics of DataFrame structure and manipulation [here](https://pandas.pydata.org/docs/user_guide/10min.html) and [here](https://www.w3schools.com/python/pandas/pandas_dataframes.asp)\n", "\n", "So experiment and find the best way that suits your use case!\n", " \n", "This same process works for both S1 and S2 search results. The following examples simply display the result after filtering. To apply the filters, set them equal to a new or existing variable." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titledateswath_coverage_percentagerelativeorbitnumberlastrelativeorbitnumberproducttypesensoroperationalmodeacquisitiontypepolarisationmodebeginpositionplatformnamemissiondatatakeidorbitdirectionorbitnumberinstrumentnamelastorbitnumberendpositioningestiondateslicenumberplatformidentifier
0S1B_IW_GRDH_1SDV_20210101T172105_20210101T1721...2021-01-01100.088.088.0GRDIWNOMINALVV VH2021-01-01T17:21:05.249000Sentinel-1194718.0ASCENDING24964.0Synthetic Aperture Radar (C-band)24964.02021-01-01T17:21:30.2480002021-01-01T21:41:44.62600010.02016-025A
1S1A_IW_GRDH_1SDV_20210101T052857_20210101T0529...2021-01-01100.0168.0168.0GRDIWNOMINALVV VH2021-01-01T05:28:57.811000Sentinel-1275881.0DESCENDING35940.0Synthetic Aperture Radar (C-band)35940.02021-01-01T05:29:22.8110002021-01-01T09:42:44.75200024.02014-016A
\n", "
" ], "text/plain": [ " title date \\\n", "0 S1B_IW_GRDH_1SDV_20210101T172105_20210101T1721... 2021-01-01 \n", "1 S1A_IW_GRDH_1SDV_20210101T052857_20210101T0529... 2021-01-01 \n", "\n", " swath_coverage_percentage relativeorbitnumber lastrelativeorbitnumber \\\n", "0 100.0 88.0 88.0 \n", "1 100.0 168.0 168.0 \n", "\n", " producttype sensoroperationalmode acquisitiontype polarisationmode \\\n", "0 GRD IW NOMINAL VV VH \n", "1 GRD IW NOMINAL VV VH \n", "\n", " beginposition platformname missiondatatakeid orbitdirection \\\n", "0 2021-01-01T17:21:05.249000 Sentinel-1 194718.0 ASCENDING \n", "1 2021-01-01T05:28:57.811000 Sentinel-1 275881.0 DESCENDING \n", "\n", " orbitnumber instrumentname lastorbitnumber \\\n", "0 24964.0 Synthetic Aperture Radar (C-band) 24964.0 \n", "1 35940.0 Synthetic Aperture Radar (C-band) 35940.0 \n", "\n", " endposition ingestiondate slicenumber \\\n", "0 2021-01-01T17:21:30.248000 2021-01-01T21:41:44.626000 10.0 \n", "1 2021-01-01T05:29:22.811000 2021-01-01T09:42:44.752000 24.0 \n", "\n", " platformidentifier \n", "0 2016-025A \n", "1 2014-016A " ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Select only the first (0) and second (1) elements of the Sentinel-1 results by their index (using \"iloc\")\n", "res_S1.dataframe.iloc[[0,1]]" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
iddatetilevalid_pixel_percentageplatformrelative_orbit_numberproduct_iddatetimeswath_coverage_percentageno_datacloud_shadowsvegetationnot_vegetatedwatercloud_medium_probabilitycloud_high_probabilitythin_cirrussnow
6S2A_32TMK_20210116_0_L2A2021-01-1632TMK100.0sentinel-2a065S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2...2021-01-16T10:29:44Z100.00.00.097.560.000.00.00.00.00.0
5S2B_32TMK_20210118_0_L2A2021-01-1832TMK100.0sentinel-2b022S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2...2021-01-18T10:19:47Z100.00.00.096.590.490.00.00.00.00.0
3S2A_32TMK_20210123_0_L2A2021-01-2332TMK100.0sentinel-2a022S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2...2021-01-23T10:19:48Z100.00.00.097.400.000.00.00.00.00.0
2S2A_32TMK_20210126_0_L2A2021-01-2632TMK100.0sentinel-2a065S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2...2021-01-26T10:29:44Z100.00.00.097.400.000.00.00.00.00.0
\n", "
" ], "text/plain": [ " id date tile valid_pixel_percentage \\\n", "6 S2A_32TMK_20210116_0_L2A 2021-01-16 32TMK 100.0 \n", "5 S2B_32TMK_20210118_0_L2A 2021-01-18 32TMK 100.0 \n", "3 S2A_32TMK_20210123_0_L2A 2021-01-23 32TMK 100.0 \n", "2 S2A_32TMK_20210126_0_L2A 2021-01-26 32TMK 100.0 \n", "\n", " platform relative_orbit_number \\\n", "6 sentinel-2a 065 \n", "5 sentinel-2b 022 \n", "3 sentinel-2a 022 \n", "2 sentinel-2a 065 \n", "\n", " product_id datetime \\\n", "6 S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2... 2021-01-16T10:29:44Z \n", "5 S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2... 2021-01-18T10:19:47Z \n", "3 S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2... 2021-01-23T10:19:48Z \n", "2 S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2... 2021-01-26T10:29:44Z \n", "\n", " swath_coverage_percentage no_data cloud_shadows vegetation \\\n", "6 100.0 0.0 0.0 97.56 \n", "5 100.0 0.0 0.0 96.59 \n", "3 100.0 0.0 0.0 97.40 \n", "2 100.0 0.0 0.0 97.40 \n", "\n", " not_vegetated water cloud_medium_probability cloud_high_probability \\\n", "6 0.00 0.0 0.0 0.0 \n", "5 0.49 0.0 0.0 0.0 \n", "3 0.00 0.0 0.0 0.0 \n", "2 0.00 0.0 0.0 0.0 \n", "\n", " thin_cirrus snow \n", "6 0.0 0.0 \n", "5 0.0 0.0 \n", "3 0.0 0.0 \n", "2 0.0 0.0 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Filter the Sentinel-2 search results by the \"valid_pixel_percentage\" column\n", "# This filter takes only those results with more than 80% of pixels considered valid\n", "res_S2.dataframe[res_S2.dataframe[\"valid_pixel_percentage\"] > 80]" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Learn more about what \"valid_pixel_percentage\" is [here](../apidocs/searchresults.rst#sentinel-2-search-result)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
iddatetilevalid_pixel_percentageplatformrelative_orbit_numberproduct_iddatetimeswath_coverage_percentageno_datacloud_shadowsvegetationnot_vegetatedwatercloud_medium_probabilitycloud_high_probabilitythin_cirrussnow
7S2A_32TMK_20210113_0_L2A2021-01-1332TMK0.0sentinel-2a022S2A_MSIL2A_20210113T101401_N0214_R022_T32TMK_2...2021-01-13T10:19:48Z100.00.00.00.000.000.00.00100.00.000.0
6S2A_32TMK_20210116_0_L2A2021-01-1632TMK100.0sentinel-2a065S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2...2021-01-16T10:29:44Z100.00.00.097.560.000.00.000.00.000.0
5S2B_32TMK_20210118_0_L2A2021-01-1832TMK100.0sentinel-2b022S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2...2021-01-18T10:19:47Z100.00.00.096.590.490.00.000.00.000.0
4S2B_32TMK_20210121_0_L2A2021-01-2132TMK0.0sentinel-2b065S2B_MSIL2A_20210121T102239_N0214_R065_T32TMK_2...2021-01-21T10:29:43Z100.00.00.00.000.000.061.380.038.620.0
3S2A_32TMK_20210123_0_L2A2021-01-2332TMK100.0sentinel-2a022S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2...2021-01-23T10:19:48Z100.00.00.097.400.000.00.000.00.000.0
2S2A_32TMK_20210126_0_L2A2021-01-2632TMK100.0sentinel-2a065S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2...2021-01-26T10:29:44Z100.00.00.097.400.000.00.000.00.000.0
1S2B_32TMK_20210128_0_L2A2021-01-2832TMK0.0sentinel-2b022S2B_MSIL2A_20210128T101159_N0214_R022_T32TMK_2...2021-01-28T10:19:47Z100.00.00.00.000.000.00.00100.00.000.0
0S2B_32TMK_20210131_0_L2A2021-01-3132TMK0.0sentinel-2b065S2B_MSIL2A_20210131T102149_N0214_R065_T32TMK_2...2021-01-31T10:29:43Z100.00.00.00.000.000.00.00100.00.000.0
\n", "
" ], "text/plain": [ " id date tile valid_pixel_percentage \\\n", "7 S2A_32TMK_20210113_0_L2A 2021-01-13 32TMK 0.0 \n", "6 S2A_32TMK_20210116_0_L2A 2021-01-16 32TMK 100.0 \n", "5 S2B_32TMK_20210118_0_L2A 2021-01-18 32TMK 100.0 \n", "4 S2B_32TMK_20210121_0_L2A 2021-01-21 32TMK 0.0 \n", "3 S2A_32TMK_20210123_0_L2A 2021-01-23 32TMK 100.0 \n", "2 S2A_32TMK_20210126_0_L2A 2021-01-26 32TMK 100.0 \n", "1 S2B_32TMK_20210128_0_L2A 2021-01-28 32TMK 0.0 \n", "0 S2B_32TMK_20210131_0_L2A 2021-01-31 32TMK 0.0 \n", "\n", " platform relative_orbit_number \\\n", "7 sentinel-2a 022 \n", "6 sentinel-2a 065 \n", "5 sentinel-2b 022 \n", "4 sentinel-2b 065 \n", "3 sentinel-2a 022 \n", "2 sentinel-2a 065 \n", "1 sentinel-2b 022 \n", "0 sentinel-2b 065 \n", "\n", " product_id datetime \\\n", "7 S2A_MSIL2A_20210113T101401_N0214_R022_T32TMK_2... 2021-01-13T10:19:48Z \n", "6 S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2... 2021-01-16T10:29:44Z \n", "5 S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2... 2021-01-18T10:19:47Z \n", "4 S2B_MSIL2A_20210121T102239_N0214_R065_T32TMK_2... 2021-01-21T10:29:43Z \n", "3 S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2... 2021-01-23T10:19:48Z \n", "2 S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2... 2021-01-26T10:29:44Z \n", "1 S2B_MSIL2A_20210128T101159_N0214_R022_T32TMK_2... 2021-01-28T10:19:47Z \n", "0 S2B_MSIL2A_20210131T102149_N0214_R065_T32TMK_2... 2021-01-31T10:29:43Z \n", "\n", " swath_coverage_percentage no_data cloud_shadows vegetation \\\n", "7 100.0 0.0 0.0 0.00 \n", "6 100.0 0.0 0.0 97.56 \n", "5 100.0 0.0 0.0 96.59 \n", "4 100.0 0.0 0.0 0.00 \n", "3 100.0 0.0 0.0 97.40 \n", "2 100.0 0.0 0.0 97.40 \n", "1 100.0 0.0 0.0 0.00 \n", "0 100.0 0.0 0.0 0.00 \n", "\n", " not_vegetated water cloud_medium_probability cloud_high_probability \\\n", "7 0.00 0.0 0.00 100.0 \n", "6 0.00 0.0 0.00 0.0 \n", "5 0.49 0.0 0.00 0.0 \n", "4 0.00 0.0 61.38 0.0 \n", "3 0.00 0.0 0.00 0.0 \n", "2 0.00 0.0 0.00 0.0 \n", "1 0.00 0.0 0.00 100.0 \n", "0 0.00 0.0 0.00 100.0 \n", "\n", " thin_cirrus snow \n", "7 0.00 0.0 \n", "6 0.00 0.0 \n", "5 0.00 0.0 \n", "4 38.62 0.0 \n", "3 0.00 0.0 \n", "2 0.00 0.0 \n", "1 0.00 0.0 \n", "0 0.00 0.0 " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Filter S2 on specific dates or date ranges\n", "res_S2.dataframe[res_S2.dataframe.date >= \"2021-01-13\"]" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
iddatetilevalid_pixel_percentageplatformrelative_orbit_numberproduct_iddatetimeswath_coverage_percentageno_datacloud_shadowsvegetationnot_vegetatedwatercloud_medium_probabilitycloud_high_probabilitythin_cirrussnow
9S2B_32TMK_20210108_0_L2A2021-01-0832TMK50.73sentinel-2b022S2B_MSIL2A_20210108T101319_N0214_R022_T32TMK_2...2021-01-08T10:19:47Z100.00.00.00.000.000.049.270.00.000.0
6S2A_32TMK_20210116_0_L2A2021-01-1632TMK100.00sentinel-2a065S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2...2021-01-16T10:29:44Z100.00.00.097.560.000.00.000.00.000.0
5S2B_32TMK_20210118_0_L2A2021-01-1832TMK100.00sentinel-2b022S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2...2021-01-18T10:19:47Z100.00.00.096.590.490.00.000.00.000.0
4S2B_32TMK_20210121_0_L2A2021-01-2132TMK0.00sentinel-2b065S2B_MSIL2A_20210121T102239_N0214_R065_T32TMK_2...2021-01-21T10:29:43Z100.00.00.00.000.000.061.380.038.620.0
3S2A_32TMK_20210123_0_L2A2021-01-2332TMK100.00sentinel-2a022S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2...2021-01-23T10:19:48Z100.00.00.097.400.000.00.000.00.000.0
2S2A_32TMK_20210126_0_L2A2021-01-2632TMK100.00sentinel-2a065S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2...2021-01-26T10:29:44Z100.00.00.097.400.000.00.000.00.000.0
\n", "
" ], "text/plain": [ " id date tile valid_pixel_percentage \\\n", "9 S2B_32TMK_20210108_0_L2A 2021-01-08 32TMK 50.73 \n", "6 S2A_32TMK_20210116_0_L2A 2021-01-16 32TMK 100.00 \n", "5 S2B_32TMK_20210118_0_L2A 2021-01-18 32TMK 100.00 \n", "4 S2B_32TMK_20210121_0_L2A 2021-01-21 32TMK 0.00 \n", "3 S2A_32TMK_20210123_0_L2A 2021-01-23 32TMK 100.00 \n", "2 S2A_32TMK_20210126_0_L2A 2021-01-26 32TMK 100.00 \n", "\n", " platform relative_orbit_number \\\n", "9 sentinel-2b 022 \n", "6 sentinel-2a 065 \n", "5 sentinel-2b 022 \n", "4 sentinel-2b 065 \n", "3 sentinel-2a 022 \n", "2 sentinel-2a 065 \n", "\n", " product_id datetime \\\n", "9 S2B_MSIL2A_20210108T101319_N0214_R022_T32TMK_2... 2021-01-08T10:19:47Z \n", "6 S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2... 2021-01-16T10:29:44Z \n", "5 S2B_MSIL2A_20210118T101249_N0214_R022_T32TMK_2... 2021-01-18T10:19:47Z \n", "4 S2B_MSIL2A_20210121T102239_N0214_R065_T32TMK_2... 2021-01-21T10:29:43Z \n", "3 S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2... 2021-01-23T10:19:48Z \n", "2 S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2... 2021-01-26T10:29:44Z \n", "\n", " swath_coverage_percentage no_data cloud_shadows vegetation \\\n", "9 100.0 0.0 0.0 0.00 \n", "6 100.0 0.0 0.0 97.56 \n", "5 100.0 0.0 0.0 96.59 \n", "4 100.0 0.0 0.0 0.00 \n", "3 100.0 0.0 0.0 97.40 \n", "2 100.0 0.0 0.0 97.40 \n", "\n", " not_vegetated water cloud_medium_probability cloud_high_probability \\\n", "9 0.00 0.0 49.27 0.0 \n", "6 0.00 0.0 0.00 0.0 \n", "5 0.49 0.0 0.00 0.0 \n", "4 0.00 0.0 61.38 0.0 \n", "3 0.00 0.0 0.00 0.0 \n", "2 0.00 0.0 0.00 0.0 \n", "\n", " thin_cirrus snow \n", "9 0.00 0.0 \n", "6 0.00 0.0 \n", "5 0.00 0.0 \n", "4 38.62 0.0 \n", "3 0.00 0.0 \n", "2 0.00 0.0 " ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Filter the Sentinel-2 search results by the \"cloud_high_probability\" column\n", "# This filter takes only those results with less than 5% of pixels classificed as \"cloud_high_probability\"\n", "res_S2.dataframe[res_S2.dataframe[\"cloud_high_probability\"] < 5]" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
titledateswath_coverage_percentagerelativeorbitnumberlastrelativeorbitnumberproducttypesensoroperationalmodeacquisitiontypepolarisationmodebeginpositionplatformnamemissiondatatakeidorbitdirectionorbitnumberinstrumentnamelastorbitnumberendpositioningestiondateslicenumberplatformidentifier
3S1B_IW_GRDH_1SDV_20210107T052818_20210107T0528...2021-01-07100.0168.0168.0GRDIWNOMINALVV VH2021-01-07T05:28:18.784000Sentinel-1195358.0DESCENDING25044.0Synthetic Aperture Radar (C-band)25044.02021-01-07T05:28:53.8390002021-01-07T10:54:44.85600011.02016-025A
\n", "
" ], "text/plain": [ " title date \\\n", "3 S1B_IW_GRDH_1SDV_20210107T052818_20210107T0528... 2021-01-07 \n", "\n", " swath_coverage_percentage relativeorbitnumber lastrelativeorbitnumber \\\n", "3 100.0 168.0 168.0 \n", "\n", " producttype sensoroperationalmode acquisitiontype polarisationmode \\\n", "3 GRD IW NOMINAL VV VH \n", "\n", " beginposition platformname missiondatatakeid orbitdirection \\\n", "3 2021-01-07T05:28:18.784000 Sentinel-1 195358.0 DESCENDING \n", "\n", " orbitnumber instrumentname lastorbitnumber \\\n", "3 25044.0 Synthetic Aperture Radar (C-band) 25044.0 \n", "\n", " endposition ingestiondate slicenumber \\\n", "3 2021-01-07T05:28:53.839000 2021-01-07T10:54:44.856000 11.0 \n", "\n", " platformidentifier \n", "3 2016-025A " ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Filter S1 on orbit number\n", "res_S1.dataframe[res_S1.dataframe.orbitnumber == 25044]" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
iddatetilevalid_pixel_percentageplatformrelative_orbit_numberproduct_iddatetimeswath_coverage_percentageno_datacloud_shadowsvegetationnot_vegetatedwatercloud_medium_probabilitycloud_high_probabilitythin_cirrussnow
11S2A_32TMK_20210103_0_L2A2021-01-0332TMK0.0sentinel-2a022S2A_MSIL2A_20210103T101411_N0214_R022_T32TMK_2...2021-01-03T10:19:48Z100.00.00.00.000.00.00.0100.00.00.0
10S2A_32TMK_20210106_0_L2A2021-01-0632TMK0.0sentinel-2a065S2A_MSIL2A_20210106T102411_N0214_R065_T32TMK_2...2021-01-06T10:29:44Z100.00.00.00.000.00.00.0100.00.00.0
7S2A_32TMK_20210113_0_L2A2021-01-1332TMK0.0sentinel-2a022S2A_MSIL2A_20210113T101401_N0214_R022_T32TMK_2...2021-01-13T10:19:48Z100.00.00.00.000.00.00.0100.00.00.0
6S2A_32TMK_20210116_0_L2A2021-01-1632TMK100.0sentinel-2a065S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2...2021-01-16T10:29:44Z100.00.00.097.560.00.00.00.00.00.0
3S2A_32TMK_20210123_0_L2A2021-01-2332TMK100.0sentinel-2a022S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2...2021-01-23T10:19:48Z100.00.00.097.400.00.00.00.00.00.0
2S2A_32TMK_20210126_0_L2A2021-01-2632TMK100.0sentinel-2a065S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2...2021-01-26T10:29:44Z100.00.00.097.400.00.00.00.00.00.0
\n", "
" ], "text/plain": [ " id date tile valid_pixel_percentage \\\n", "11 S2A_32TMK_20210103_0_L2A 2021-01-03 32TMK 0.0 \n", "10 S2A_32TMK_20210106_0_L2A 2021-01-06 32TMK 0.0 \n", "7 S2A_32TMK_20210113_0_L2A 2021-01-13 32TMK 0.0 \n", "6 S2A_32TMK_20210116_0_L2A 2021-01-16 32TMK 100.0 \n", "3 S2A_32TMK_20210123_0_L2A 2021-01-23 32TMK 100.0 \n", "2 S2A_32TMK_20210126_0_L2A 2021-01-26 32TMK 100.0 \n", "\n", " platform relative_orbit_number \\\n", "11 sentinel-2a 022 \n", "10 sentinel-2a 065 \n", "7 sentinel-2a 022 \n", "6 sentinel-2a 065 \n", "3 sentinel-2a 022 \n", "2 sentinel-2a 065 \n", "\n", " product_id datetime \\\n", "11 S2A_MSIL2A_20210103T101411_N0214_R022_T32TMK_2... 2021-01-03T10:19:48Z \n", "10 S2A_MSIL2A_20210106T102411_N0214_R065_T32TMK_2... 2021-01-06T10:29:44Z \n", "7 S2A_MSIL2A_20210113T101401_N0214_R022_T32TMK_2... 2021-01-13T10:19:48Z \n", "6 S2A_MSIL2A_20210116T102351_N0214_R065_T32TMK_2... 2021-01-16T10:29:44Z \n", "3 S2A_MSIL2A_20210123T101321_N0214_R022_T32TMK_2... 2021-01-23T10:19:48Z \n", "2 S2A_MSIL2A_20210126T102311_N0214_R065_T32TMK_2... 2021-01-26T10:29:44Z \n", "\n", " swath_coverage_percentage no_data cloud_shadows vegetation \\\n", "11 100.0 0.0 0.0 0.00 \n", "10 100.0 0.0 0.0 0.00 \n", "7 100.0 0.0 0.0 0.00 \n", "6 100.0 0.0 0.0 97.56 \n", "3 100.0 0.0 0.0 97.40 \n", "2 100.0 0.0 0.0 97.40 \n", "\n", " not_vegetated water cloud_medium_probability cloud_high_probability \\\n", "11 0.0 0.0 0.0 100.0 \n", "10 0.0 0.0 0.0 100.0 \n", "7 0.0 0.0 0.0 100.0 \n", "6 0.0 0.0 0.0 0.0 \n", "3 0.0 0.0 0.0 0.0 \n", "2 0.0 0.0 0.0 0.0 \n", "\n", " thin_cirrus snow \n", "11 0.0 0.0 \n", "10 0.0 0.0 \n", "7 0.0 0.0 \n", "6 0.0 0.0 \n", "3 0.0 0.0 \n", "2 0.0 0.0 " ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Filter S2 on satellite platform (S2A or S2B)\n", "res_S2.dataframe[res_S2.dataframe.platform == \"sentinel-2a\"]" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.7.5 ('venv': venv)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.5" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "e1ad9e0bf6960974dd8425f76aaa88b32de1b03d6f54bb6bf7fb6a0ca773e449" } } }, "nbformat": 4, "nbformat_minor": 2 }