{ "cells": [ { "cell_type": "markdown", "id": "e20fc857", "metadata": {}, "source": [ "# Working With Time Series\n", "\n", "In this example notebook, we'll introduce the `TimeSeries` class, which is the basis of most of the functionality in `wxee`. Any `ImageCollection` can be turned into a `TimeSeries`, allowing you to access additional time series-specific methods and properties." ] }, { "cell_type": "markdown", "id": "bb4ec543", "metadata": {}, "source": [ "## Setup" ] }, { "cell_type": "code", "execution_count": null, "id": "e3967cd3", "metadata": {}, "outputs": [], "source": [ "!pip install wxee" ] }, { "cell_type": "code", "execution_count": 1, "id": "74e107b7", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:23.978651Z", "start_time": "2021-11-21T06:03:23.502531Z" } }, "outputs": [], "source": [ "import ee\n", "import wxee" ] }, { "cell_type": "code", "execution_count": 2, "id": "ed6c82c7", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:27.757386Z", "start_time": "2021-11-21T06:03:25.729961Z" } }, "outputs": [], "source": [ "ee.Authenticate()\n", "wxee.Initialize()" ] }, { "cell_type": "markdown", "id": "f1dc9555", "metadata": {}, "source": [ "## Creating a Time Series\n", "\n", "There are two ways to create a `TimeSeries`." ] }, { "cell_type": "markdown", "id": "4b36156a", "metadata": {}, "source": [ "### From an ID\n", "\n", "You can create a `TimeSeries` the same way you create an `ImageCollection`, by using an ID from the Earth Engine catalog. Let's create a `TimeSeries` from the Sentinel-2 dataset." ] }, { "cell_type": "code", "execution_count": 3, "id": "77c7f8ff", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:28.697209Z", "start_time": "2021-11-21T06:03:28.695074Z" } }, "outputs": [], "source": [ "ts = wxee.TimeSeries(\"COPERNICUS/S2_SR\")" ] }, { "cell_type": "markdown", "id": "fcf287cf", "metadata": {}, "source": [ "### From an Existing Collection\n", "\n", "You can also turn an existing `ImageCollection` into a `TimeSeries`, which may be helpful if you decide you want time series functionality after doing other processing. Just use the `wx` accessor and the `to_time_series` method." ] }, { "cell_type": "code", "execution_count": 4, "id": "e1e57451", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:29.891431Z", "start_time": "2021-11-21T06:03:29.889398Z" } }, "outputs": [], "source": [ "col = ee.ImageCollection(\"COPERNICUS/S2_SR\")\n", "ts = col.wx.to_time_series()" ] }, { "cell_type": "markdown", "id": "9275fefb", "metadata": {}, "source": [ "## Earth Engine Methods\n", "\n", "A `TimeSeries` has all the methods of an Earth Engine `ImageCollection`. For example, we can use `filterMetadata`, `filterBounds`, and `size` to see how many cloudless (or at least mostly cloudless) images there are over a given location (Svalbard, Norway)." ] }, { "cell_type": "code", "execution_count": 5, "id": "031e8adc", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:31.045515Z", "start_time": "2021-11-21T06:03:31.043047Z" } }, "outputs": [], "source": [ "svalbard = ee.Geometry.Point([15.5861, 78.1969])" ] }, { "cell_type": "code", "execution_count": 6, "id": "79bbd408", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:32.372611Z", "start_time": "2021-11-21T06:03:31.954378Z" } }, "outputs": [ { "data": { "text/plain": [ "80" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cloudless = ts.filterBounds(svalbard).filterMetadata(\"CLOUDY_PIXEL_PERCENTAGE\", \"less_than\", 5)\n", "cloudless.size().getInfo()" ] }, { "cell_type": "markdown", "id": "b8795ab6", "metadata": {}, "source": [ "## wxee Methods\n", "\n", "A time series also has additional methods added by `wxee` to help describe and process time series data. Let's start by looking at the `describe`, `dataframe`, and `timeline` methods that provide info on how many images are in the time series and when they were acquired." ] }, { "cell_type": "markdown", "id": "2af95088", "metadata": {}, "source": [ "### `describe`" ] }, { "cell_type": "markdown", "id": "68905d0f", "metadata": {}, "source": [ "First, `describe` provides a brief summary of the time series including the number of images, the `system:start_time` of the first and last chronological image, and the mean interval between images." ] }, { "cell_type": "code", "execution_count": 7, "id": "bbd65f3b", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:37.114647Z", "start_time": "2021-11-21T06:03:34.266089Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\u001b[1mCOPERNICUS/S2_SR\u001b[0m\n", "\tImages: 80\n", "\tStart date: 2018-03-27 12:27:55 UTC\n", "\tEnd date: 2021-09-03 11:59:18 UTC\n", "\tMean interval: 15.90 days\n" ] } ], "source": [ "cloudless.describe()" ] }, { "cell_type": "markdown", "id": "adb10543", "metadata": {}, "source": [ "As you can see, there have been 80 mostly cloudless images captured over this area--on average, about one every 16 days." ] }, { "cell_type": "markdown", "id": "0ab529c2", "metadata": {}, "source": [ "### `dataframe`" ] }, { "cell_type": "markdown", "id": "bc475eaf", "metadata": {}, "source": [ "We can summarize the ID and start and end dates of those 80 images as a `pandas.DataFrame` using `dataframe`." ] }, { "cell_type": "code", "execution_count": 8, "id": "06b7cdf6", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:45.511506Z", "start_time": "2021-11-21T06:03:37.119701Z" } }, "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", "
idtime_starttime_end
0COPERNICUS/S2_SR/20180327T122729_20180327T1227...2018-03-27 12:27:552018-03-27 12:27:55
1COPERNICUS/S2_SR/20180405T120651_20180405T1206...2018-04-05 12:06:452018-04-05 12:06:45
2COPERNICUS/S2_SR/20180405T125659_20180405T1257...2018-04-05 12:57:022018-04-05 12:57:02
3COPERNICUS/S2_SR/20180406T122649_20180406T1226...2018-04-06 12:26:492018-04-06 12:26:49
4COPERNICUS/S2_SR/20180407T115639_20180407T1156...2018-04-07 11:56:392018-04-07 11:56:39
\n", "
" ], "text/plain": [ " id time_start \\\n", "0 COPERNICUS/S2_SR/20180327T122729_20180327T1227... 2018-03-27 12:27:55 \n", "1 COPERNICUS/S2_SR/20180405T120651_20180405T1206... 2018-04-05 12:06:45 \n", "2 COPERNICUS/S2_SR/20180405T125659_20180405T1257... 2018-04-05 12:57:02 \n", "3 COPERNICUS/S2_SR/20180406T122649_20180406T1226... 2018-04-06 12:26:49 \n", "4 COPERNICUS/S2_SR/20180407T115639_20180407T1156... 2018-04-07 11:56:39 \n", "\n", " time_end \n", "0 2018-03-27 12:27:55 \n", "1 2018-04-05 12:06:45 \n", "2 2018-04-05 12:57:02 \n", "3 2018-04-06 12:26:49 \n", "4 2018-04-07 11:56:39 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = cloudless.dataframe()\n", "df.head()" ] }, { "cell_type": "markdown", "id": "0ef31c3e", "metadata": {}, "source": [ "### `timeline`" ] }, { "cell_type": "markdown", "id": "847a7393", "metadata": {}, "source": [ "Finally, we can visualize when those cloudless images were collected with an interactive plot using `timeline`." ] }, { "cell_type": "code", "execution_count": 9, "id": "37c9df4b", "metadata": { "ExecuteTime": { "end_time": "2021-11-21T06:03:47.813281Z", "start_time": "2021-11-21T06:03:45.512812Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "customdata": [ [ "COPERNICUS/S2_SR/20180327T122729_20180327T122755_T33XWG", "2018-03-27T12:27:55" ], [ "COPERNICUS/S2_SR/20180405T120651_20180405T120645_T33XWG", "2018-04-05T12:06:45" ], [ "COPERNICUS/S2_SR/20180405T125659_20180405T125702_T33XWG", "2018-04-05T12:57:02" ], [ "COPERNICUS/S2_SR/20180406T122649_20180406T122649_T33XWG", "2018-04-06T12:26:49" ], [ "COPERNICUS/S2_SR/20180407T115639_20180407T115639_T33XWG", "2018-04-07T11:56:39" ], [ "COPERNICUS/S2_SR/20180407T124701_20180407T124701_T33XWG", "2018-04-07T12:47:01" ], [ "COPERNICUS/S2_SR/20180417T124701_20180417T124702_T33XWG", "2018-04-17T12:47:02" ], [ "COPERNICUS/S2_SR/20180424T123701_20180424T123659_T33XWG", "2018-04-24T12:36:59.460000" ], [ "COPERNICUS/S2_SR/20180425T125709_20180425T125820_T33XWG", "2018-04-25T12:58:20" ], [ "COPERNICUS/S2_SR/20180427T115639_20180427T115641_T33XWG", "2018-04-27T11:56:41" ], [ "COPERNICUS/S2_SR/20180427T124701_20180427T124703_T33XWG", "2018-04-27T12:47:03" ], [ "COPERNICUS/S2_SR/20180607T130709_20180607T130707_T33XWG", "2018-06-07T13:07:07.461000" ], [ "COPERNICUS/S2_SR/20180622T130711_20180622T130710_T33XWG", "2018-06-22T13:07:10.464000" ], [ "COPERNICUS/S2_SR/20190316T120839_20190316T120838_T33XWG", "2019-03-16T12:09:14" ], [ "COPERNICUS/S2_SR/20190316T125901_20190316T125857_T33XWG", "2019-03-16T12:59:03.692000" ], [ "COPERNICUS/S2_SR/20190331T120701_20190331T120655_T33XWG", "2019-03-31T12:09:16" ], [ "COPERNICUS/S2_SR/20190331T125719_20190331T125717_T33XWG", "2019-03-31T12:59:04" ], [ "COPERNICUS/S2_SR/20190401T122659_20190401T122658_T33XWG", "2019-04-01T12:29:14" ], [ "COPERNICUS/S2_SR/20190407T115641_20190407T115644_T33XWG", "2019-04-07T11:59:19" ], [ "COPERNICUS/S2_SR/20190407T124709_20190407T124705_T33XWG", "2019-04-07T12:49:10" ], [ "COPERNICUS/S2_SR/20190408T121659_20190408T121653_T33XWG", "2019-04-08T12:19:18" ], [ "COPERNICUS/S2_SR/20190408T130711_20190408T130711_T33XWG", "2019-04-08T13:09:01" ], [ "COPERNICUS/S2_SR/20190430T120651_20190430T120649_T33XWG", "2019-04-30T12:09:19" ], [ "COPERNICUS/S2_SR/20190430T125719_20190430T125713_T33XWG", "2019-04-30T12:59:10" ], [ "COPERNICUS/S2_SR/20190505T120659_20190505T120653_T33XWG", "2019-05-05T12:09:24" ], [ "COPERNICUS/S2_SR/20190505T125711_20190505T125709_T33XWG", "2019-05-05T12:59:06" ], [ "COPERNICUS/S2_SR/20190510T120651_20190510T120649_T33XWG", "2019-05-10T12:09:20" ], [ "COPERNICUS/S2_SR/20190510T125719_20190510T125713_T33XWG", "2019-05-10T12:59:11" ], [ "COPERNICUS/S2_SR/20190523T130719_20190523T130718_T33XWG", "2019-05-23T13:09:08" ], [ "COPERNICUS/S2_SR/20190527T115651_20190527T115645_T33XWG", "2019-05-27T11:59:20" ], [ "COPERNICUS/S2_SR/20190527T124709_20190527T124710_T33XWG", "2019-05-27T12:49:14" ], [ "COPERNICUS/S2_SR/20190614T120649_20190614T120652_T33XWG", "2019-06-14T12:09:23" ], [ "COPERNICUS/S2_SR/20190614T125711_20190614T125708_T33XWG", "2019-06-14T12:59:05" ], [ "COPERNICUS/S2_SR/20190618T123701_20190618T123701_T33XWG", "2019-06-18T12:39:12" ], [ "COPERNICUS/S2_SR/20200329T123659_20200329T123655_T33XWG", "2020-03-29T12:39:06.813000" ], [ "COPERNICUS/S2_SR/20200330T120639_20200330T120642_T33XWG", "2020-03-30T12:09:13.776000" ], [ "COPERNICUS/S2_SR/20200330T125711_20200330T125841_T33XWG", "2020-03-30T12:58:58.666000" ], [ "COPERNICUS/S2_SR/20200331T122651_20200331T122654_T33XWG", "2020-03-31T12:29:07.846000" ], [ "COPERNICUS/S2_SR/20200403T123651_20200403T123653_T33XWG", "2020-04-03T12:39:05.275000" ], [ "COPERNICUS/S2_SR/20200404T125659_20200404T125702_T33XWG", "2020-04-04T12:58:59.769000" ], [ "COPERNICUS/S2_SR/20200410T122651_20200410T122651_T33XWG", "2020-04-10T12:29:10.140000" ], [ "COPERNICUS/S2_SR/20200411T115641_20200411T115641_T33XWG", "2020-04-11T11:59:16.367000" ], [ "COPERNICUS/S2_SR/20200411T124659_20200411T124657_T33XWG", "2020-04-11T12:49:02.545000" ], [ "COPERNICUS/S2_SR/20200421T115641_20200421T115644_T33XWG", "2020-04-21T11:59:18.923000" ], [ "COPERNICUS/S2_SR/20200421T124659_20200421T124655_T33XWG", "2020-04-21T12:49:00.891000" ], [ "COPERNICUS/S2_SR/20200422T121649_20200422T121643_T33XWG", "2020-04-22T12:19:08.691000" ], [ "COPERNICUS/S2_SR/20200422T130711_20200422T130711_T33XWG", "2020-04-22T13:09:01.324000" ], [ "COPERNICUS/S2_SR/20200423T123701_20200423T123659_T33XWG", "2020-04-23T12:39:10.735000" ], [ "COPERNICUS/S2_SR/20200424T120651_20200424T120647_T33XWG", "2020-04-24T12:09:17.983000" ], [ "COPERNICUS/S2_SR/20200426T115639_20200426T115635_T33XWG", "2020-04-26T11:59:12.853000" ], [ "COPERNICUS/S2_SR/20200426T124701_20200426T124703_T33XWG", "2020-04-26T12:49:08.446000" ], [ "COPERNICUS/S2_SR/20200427T121651_20200427T121728_T33XWG", "2020-04-27T12:19:16.631000" ], [ "COPERNICUS/S2_SR/20200427T130709_20200427T130705_T33XWG", "2020-04-27T13:08:55.311000" ], [ "COPERNICUS/S2_SR/20200504T125659_20200504T125702_T33XWG", "2020-05-04T12:58:59.696000" ], [ "COPERNICUS/S2_SR/20200517T130709_20200517T130709_T33XWG", "2020-05-17T13:08:59.645000" ], [ "COPERNICUS/S2_SR/20200617T123659_20200617T123700_T33XWG", "2020-06-17T12:39:11.711000" ], [ "COPERNICUS/S2_SR/20200622T123701_20200622T123703_T33XWG", "2020-06-22T12:39:14.981000" ], [ "COPERNICUS/S2_SR/20200726T130709_20200726T130817_T33XWG", "2020-07-26T13:09:02.429000" ], [ "COPERNICUS/S2_SR/20200807T125711_20200807T125711_T33XWG", "2020-08-07T12:59:08.638000" ], [ "COPERNICUS/S2_SR/20200823T122659_20200823T122656_T33XWG", "2020-08-23T12:29:15.373000" ], [ "COPERNICUS/S2_SR/20200825T130719_20200825T130753_T33XWG", "2020-08-25T13:09:03.427000" ], [ "COPERNICUS/S2_SR/20210307T124859_20210307T124901_T33XWG", "2021-03-07T12:49:09.514000" ], [ "COPERNICUS/S2_SR/20210312T115809_20210312T115851_T33XWG", "2021-03-12T11:59:17.246000" ], [ "COPERNICUS/S2_SR/20210502T130709_20210502T130706_T33XWG", "2021-05-02T13:08:56.375000" ], [ "COPERNICUS/S2_SR/20210503T123659_20210503T123658_T33XWG", "2021-05-03T12:39:05.912000" ], [ "COPERNICUS/S2_SR/20210507T130711_20210507T130709_T33XWG", "2021-05-07T13:08:58.827000" ], [ "COPERNICUS/S2_SR/20210516T115641_20210516T115642_T33XWG", "2021-05-16T11:59:17.878000" ], [ "COPERNICUS/S2_SR/20210516T124659_20210516T124816_T33XWG", "2021-05-16T12:49:05.517000" ], [ "COPERNICUS/S2_SR/20210517T121649_20210517T121647_T33XWG", "2021-05-17T12:19:13.649000" ], [ "COPERNICUS/S2_SR/20210517T130711_20210517T130710_T33XWG", "2021-05-17T13:09:00.147000" ], [ "COPERNICUS/S2_SR/20210523T123659_20210523T123708_T33XWG", "2021-05-23T12:39:09.337000" ], [ "COPERNICUS/S2_SR/20210524T120649_20210524T120645_T33XWG", "2021-05-24T12:09:16.478000" ], [ "COPERNICUS/S2_SR/20210529T120651_20210529T120646_T33XWG", "2021-05-29T12:09:17.062000" ], [ "COPERNICUS/S2_SR/20210606T121649_20210606T121707_T33XWG", "2021-06-06T12:19:15.286000" ], [ "COPERNICUS/S2_SR/20210606T130711_20210606T130711_T33XWG", "2021-06-06T13:09:00.787000" ], [ "COPERNICUS/S2_SR/20210626T130711_20210626T130711_T33XWG", "2021-06-26T13:09:01.542000" ], [ "COPERNICUS/S2_SR/20210706T121649_20210706T121708_T33XWG", "2021-07-06T12:19:15.934000" ], [ "COPERNICUS/S2_SR/20210706T130711_20210706T130712_T33XWG", "2021-07-06T13:09:02.603000" ], [ "COPERNICUS/S2_SR/20210808T122659_20210808T122653_T33XWG", "2021-08-08T12:29:12.861000" ], [ "COPERNICUS/S2_SR/20210903T115641_20210903T115643_T33XWG", "2021-09-03T11:59:18.793000" ] ], "hovertemplate": "%{customdata[0]}
%{customdata[1]|%Y-%m-%d %H:%M:%S}", "hovertext": [ "COPERNICUS/S2_SR/20180327T122729_20180327T122755_T33XWG", "COPERNICUS/S2_SR/20180405T120651_20180405T120645_T33XWG", "COPERNICUS/S2_SR/20180405T125659_20180405T125702_T33XWG", "COPERNICUS/S2_SR/20180406T122649_20180406T122649_T33XWG", "COPERNICUS/S2_SR/20180407T115639_20180407T115639_T33XWG", "COPERNICUS/S2_SR/20180407T124701_20180407T124701_T33XWG", "COPERNICUS/S2_SR/20180417T124701_20180417T124702_T33XWG", "COPERNICUS/S2_SR/20180424T123701_20180424T123659_T33XWG", "COPERNICUS/S2_SR/20180425T125709_20180425T125820_T33XWG", "COPERNICUS/S2_SR/20180427T115639_20180427T115641_T33XWG", "COPERNICUS/S2_SR/20180427T124701_20180427T124703_T33XWG", "COPERNICUS/S2_SR/20180607T130709_20180607T130707_T33XWG", "COPERNICUS/S2_SR/20180622T130711_20180622T130710_T33XWG", "COPERNICUS/S2_SR/20190316T120839_20190316T120838_T33XWG", "COPERNICUS/S2_SR/20190316T125901_20190316T125857_T33XWG", "COPERNICUS/S2_SR/20190331T120701_20190331T120655_T33XWG", "COPERNICUS/S2_SR/20190331T125719_20190331T125717_T33XWG", "COPERNICUS/S2_SR/20190401T122659_20190401T122658_T33XWG", "COPERNICUS/S2_SR/20190407T115641_20190407T115644_T33XWG", "COPERNICUS/S2_SR/20190407T124709_20190407T124705_T33XWG", "COPERNICUS/S2_SR/20190408T121659_20190408T121653_T33XWG", "COPERNICUS/S2_SR/20190408T130711_20190408T130711_T33XWG", "COPERNICUS/S2_SR/20190430T120651_20190430T120649_T33XWG", "COPERNICUS/S2_SR/20190430T125719_20190430T125713_T33XWG", "COPERNICUS/S2_SR/20190505T120659_20190505T120653_T33XWG", "COPERNICUS/S2_SR/20190505T125711_20190505T125709_T33XWG", "COPERNICUS/S2_SR/20190510T120651_20190510T120649_T33XWG", "COPERNICUS/S2_SR/20190510T125719_20190510T125713_T33XWG", "COPERNICUS/S2_SR/20190523T130719_20190523T130718_T33XWG", "COPERNICUS/S2_SR/20190527T115651_20190527T115645_T33XWG", "COPERNICUS/S2_SR/20190527T124709_20190527T124710_T33XWG", "COPERNICUS/S2_SR/20190614T120649_20190614T120652_T33XWG", "COPERNICUS/S2_SR/20190614T125711_20190614T125708_T33XWG", "COPERNICUS/S2_SR/20190618T123701_20190618T123701_T33XWG", "COPERNICUS/S2_SR/20200329T123659_20200329T123655_T33XWG", "COPERNICUS/S2_SR/20200330T120639_20200330T120642_T33XWG", "COPERNICUS/S2_SR/20200330T125711_20200330T125841_T33XWG", "COPERNICUS/S2_SR/20200331T122651_20200331T122654_T33XWG", "COPERNICUS/S2_SR/20200403T123651_20200403T123653_T33XWG", "COPERNICUS/S2_SR/20200404T125659_20200404T125702_T33XWG", "COPERNICUS/S2_SR/20200410T122651_20200410T122651_T33XWG", "COPERNICUS/S2_SR/20200411T115641_20200411T115641_T33XWG", "COPERNICUS/S2_SR/20200411T124659_20200411T124657_T33XWG", "COPERNICUS/S2_SR/20200421T115641_20200421T115644_T33XWG", "COPERNICUS/S2_SR/20200421T124659_20200421T124655_T33XWG", "COPERNICUS/S2_SR/20200422T121649_20200422T121643_T33XWG", "COPERNICUS/S2_SR/20200422T130711_20200422T130711_T33XWG", "COPERNICUS/S2_SR/20200423T123701_20200423T123659_T33XWG", "COPERNICUS/S2_SR/20200424T120651_20200424T120647_T33XWG", "COPERNICUS/S2_SR/20200426T115639_20200426T115635_T33XWG", "COPERNICUS/S2_SR/20200426T124701_20200426T124703_T33XWG", "COPERNICUS/S2_SR/20200427T121651_20200427T121728_T33XWG", "COPERNICUS/S2_SR/20200427T130709_20200427T130705_T33XWG", "COPERNICUS/S2_SR/20200504T125659_20200504T125702_T33XWG", "COPERNICUS/S2_SR/20200517T130709_20200517T130709_T33XWG", "COPERNICUS/S2_SR/20200617T123659_20200617T123700_T33XWG", "COPERNICUS/S2_SR/20200622T123701_20200622T123703_T33XWG", "COPERNICUS/S2_SR/20200726T130709_20200726T130817_T33XWG", "COPERNICUS/S2_SR/20200807T125711_20200807T125711_T33XWG", "COPERNICUS/S2_SR/20200823T122659_20200823T122656_T33XWG", "COPERNICUS/S2_SR/20200825T130719_20200825T130753_T33XWG", "COPERNICUS/S2_SR/20210307T124859_20210307T124901_T33XWG", "COPERNICUS/S2_SR/20210312T115809_20210312T115851_T33XWG", "COPERNICUS/S2_SR/20210502T130709_20210502T130706_T33XWG", "COPERNICUS/S2_SR/20210503T123659_20210503T123658_T33XWG", "COPERNICUS/S2_SR/20210507T130711_20210507T130709_T33XWG", "COPERNICUS/S2_SR/20210516T115641_20210516T115642_T33XWG", "COPERNICUS/S2_SR/20210516T124659_20210516T124816_T33XWG", "COPERNICUS/S2_SR/20210517T121649_20210517T121647_T33XWG", "COPERNICUS/S2_SR/20210517T130711_20210517T130710_T33XWG", "COPERNICUS/S2_SR/20210523T123659_20210523T123708_T33XWG", "COPERNICUS/S2_SR/20210524T120649_20210524T120645_T33XWG", "COPERNICUS/S2_SR/20210529T120651_20210529T120646_T33XWG", "COPERNICUS/S2_SR/20210606T121649_20210606T121707_T33XWG", "COPERNICUS/S2_SR/20210606T130711_20210606T130711_T33XWG", "COPERNICUS/S2_SR/20210626T130711_20210626T130711_T33XWG", "COPERNICUS/S2_SR/20210706T121649_20210706T121708_T33XWG", "COPERNICUS/S2_SR/20210706T130711_20210706T130712_T33XWG", "COPERNICUS/S2_SR/20210808T122659_20210808T122653_T33XWG", "COPERNICUS/S2_SR/20210903T115641_20210903T115643_T33XWG" ], "legendgroup": "", "line": { "color": "black", "dash": "solid", "width": 2 }, "marker": { "color": "grey", "line": { "color": "black", "width": 1 }, "size": 12, "symbol": "line-ns-open" }, "mode": "markers+lines", "name": "", "orientation": "v", "showlegend": false, "type": "scatter", "x": [ "2018-03-27T12:27:55", "2018-04-05T12:06:45", "2018-04-05T12:57:02", "2018-04-06T12:26:49", "2018-04-07T11:56:39", "2018-04-07T12:47:01", "2018-04-17T12:47:02", "2018-04-24T12:36:59.460000", "2018-04-25T12:58:20", "2018-04-27T11:56:41", "2018-04-27T12:47:03", "2018-06-07T13:07:07.461000", "2018-06-22T13:07:10.464000", "2019-03-16T12:09:14", "2019-03-16T12:59:03.692000", "2019-03-31T12:09:16", "2019-03-31T12:59:04", "2019-04-01T12:29:14", "2019-04-07T11:59:19", "2019-04-07T12:49:10", "2019-04-08T12:19:18", "2019-04-08T13:09:01", "2019-04-30T12:09:19", "2019-04-30T12:59:10", "2019-05-05T12:09:24", "2019-05-05T12:59:06", "2019-05-10T12:09:20", "2019-05-10T12:59:11", "2019-05-23T13:09:08", "2019-05-27T11:59:20", "2019-05-27T12:49:14", "2019-06-14T12:09:23", "2019-06-14T12:59:05", "2019-06-18T12:39:12", "2020-03-29T12:39:06.813000", "2020-03-30T12:09:13.776000", "2020-03-30T12:58:58.666000", "2020-03-31T12:29:07.846000", "2020-04-03T12:39:05.275000", "2020-04-04T12:58:59.769000", "2020-04-10T12:29:10.140000", "2020-04-11T11:59:16.367000", "2020-04-11T12:49:02.545000", "2020-04-21T11:59:18.923000", "2020-04-21T12:49:00.891000", "2020-04-22T12:19:08.691000", "2020-04-22T13:09:01.324000", "2020-04-23T12:39:10.735000", "2020-04-24T12:09:17.983000", "2020-04-26T11:59:12.853000", "2020-04-26T12:49:08.446000", "2020-04-27T12:19:16.631000", "2020-04-27T13:08:55.311000", "2020-05-04T12:58:59.696000", "2020-05-17T13:08:59.645000", "2020-06-17T12:39:11.711000", "2020-06-22T12:39:14.981000", "2020-07-26T13:09:02.429000", "2020-08-07T12:59:08.638000", "2020-08-23T12:29:15.373000", "2020-08-25T13:09:03.427000", "2021-03-07T12:49:09.514000", "2021-03-12T11:59:17.246000", "2021-05-02T13:08:56.375000", "2021-05-03T12:39:05.912000", "2021-05-07T13:08:58.827000", "2021-05-16T11:59:17.878000", "2021-05-16T12:49:05.517000", "2021-05-17T12:19:13.649000", "2021-05-17T13:09:00.147000", "2021-05-23T12:39:09.337000", "2021-05-24T12:09:16.478000", "2021-05-29T12:09:17.062000", "2021-06-06T12:19:15.286000", "2021-06-06T13:09:00.787000", "2021-06-26T13:09:01.542000", "2021-07-06T12:19:15.934000", "2021-07-06T13:09:02.603000", "2021-08-08T12:29:12.861000", "2021-09-03T11:59:18.793000" ], "xaxis": "x", "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "yaxis": "y" }, { "hoverinfo": "skip", "marker": { "color": "white", "line": { "color": "black", "width": 1 }, "size": 6, "symbol": "circle" }, "mode": "markers", "type": "scatter", "x": [ "2018-03-27T12:27:55", "2018-04-05T12:06:45", "2018-04-05T12:57:02", "2018-04-06T12:26:49", "2018-04-07T11:56:39", "2018-04-07T12:47:01", "2018-04-17T12:47:02", "2018-04-24T12:36:59.460000", "2018-04-25T12:58:20", "2018-04-27T11:56:41", "2018-04-27T12:47:03", "2018-06-07T13:07:07.461000", "2018-06-22T13:07:10.464000", "2019-03-16T12:09:14", "2019-03-16T12:59:03.692000", "2019-03-31T12:09:16", "2019-03-31T12:59:04", "2019-04-01T12:29:14", "2019-04-07T11:59:19", "2019-04-07T12:49:10", "2019-04-08T12:19:18", "2019-04-08T13:09:01", "2019-04-30T12:09:19", "2019-04-30T12:59:10", "2019-05-05T12:09:24", "2019-05-05T12:59:06", "2019-05-10T12:09:20", "2019-05-10T12:59:11", "2019-05-23T13:09:08", "2019-05-27T11:59:20", "2019-05-27T12:49:14", "2019-06-14T12:09:23", "2019-06-14T12:59:05", "2019-06-18T12:39:12", "2020-03-29T12:39:06.813000", "2020-03-30T12:09:13.776000", "2020-03-30T12:58:58.666000", "2020-03-31T12:29:07.846000", "2020-04-03T12:39:05.275000", "2020-04-04T12:58:59.769000", "2020-04-10T12:29:10.140000", "2020-04-11T11:59:16.367000", "2020-04-11T12:49:02.545000", "2020-04-21T11:59:18.923000", "2020-04-21T12:49:00.891000", "2020-04-22T12:19:08.691000", "2020-04-22T13:09:01.324000", "2020-04-23T12:39:10.735000", "2020-04-24T12:09:17.983000", "2020-04-26T11:59:12.853000", "2020-04-26T12:49:08.446000", "2020-04-27T12:19:16.631000", "2020-04-27T13:08:55.311000", "2020-05-04T12:58:59.696000", "2020-05-17T13:08:59.645000", "2020-06-17T12:39:11.711000", "2020-06-22T12:39:14.981000", "2020-07-26T13:09:02.429000", "2020-08-07T12:59:08.638000", "2020-08-23T12:29:15.373000", "2020-08-25T13:09:03.427000", "2021-03-07T12:49:09.514000", "2021-03-12T11:59:17.246000", "2021-05-02T13:08:56.375000", "2021-05-03T12:39:05.912000", "2021-05-07T13:08:58.827000", "2021-05-16T11:59:17.878000", "2021-05-16T12:49:05.517000", "2021-05-17T12:19:13.649000", "2021-05-17T13:09:00.147000", "2021-05-23T12:39:09.337000", "2021-05-24T12:09:16.478000", "2021-05-29T12:09:17.062000", "2021-06-06T12:19:15.286000", "2021-06-06T13:09:00.787000", "2021-06-26T13:09:01.542000", "2021-07-06T12:19:15.934000", "2021-07-06T13:09:02.603000", "2021-08-08T12:29:12.861000", "2021-09-03T11:59:18.793000" ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] } ], "layout": { "height": 200, "hoverlabel": { "bgcolor": "white" }, "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "plot_bgcolor": "white", "showlegend": false, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "linecolor": "black", "ticks": "outside", "title": { "text": "" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "y" }, "visible": false } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "cloudless.timeline()" ] }, { "cell_type": "markdown", "id": "74dd043b", "metadata": {}, "source": [ "Now we can see that most of the cloudless days occur between spring and summer!" ] }, { "cell_type": "markdown", "id": "0fa03b97", "metadata": {}, "source": [ "### Other Methods" ] }, { "cell_type": "markdown", "id": "b2cfef00", "metadata": {}, "source": [ "The `TimeSeries` class contains many other methods for processing such as `interpolate_time`, `aggregate_time`, `climatology_anomaly`, and others. Detailed example notebooks can be found [here](https://wxee.readthedocs.io/en/latest/examples.html)." ] } ], "metadata": { "kernelspec": { "display_name": "Python [conda env:wxee]", "language": "python", "name": "conda-env-wxee-py" }, "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.9.6" }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 5 }