Skip to content

Commit bec9c6a

Browse files
committed
updating the monitoring tasking orders juypter notebook to relfect the recent rrule changes
1 parent f05b97c commit bec9c6a

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

jupyter-notebooks/tasking-api/planet_tasking_api_monitoring_orders.ipynb

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
]
2828
},
2929
{
30-
"cell_type": "markdown",
31-
"metadata": {},
3230
"source": [
3331
"## Introduction\n",
3432
"\n",
@@ -37,7 +35,9 @@
3735
"This tutorial is an introduction on how to create monitoring tasking orders using [Planet](https://www.planet.com)'s Tasking API. It provides code samples on how to write simple Python code to do this.\n",
3836
"\n",
3937
"The API reference documentation can be found at https://developers.planet.com/docs/tasking"
40-
]
38+
],
39+
"cell_type": "markdown",
40+
"metadata": {}
4141
},
4242
{
4343
"cell_type": "markdown",
@@ -192,15 +192,17 @@
192192
]
193193
},
194194
{
195-
"cell_type": "markdown",
196-
"metadata": {},
197195
"source": [
198196
"## 1 | Compose the monitoring tasking order\n",
199197
"\n",
200-
"We want to create a monitoring tasking order that can be set up to take images of the same location at a defined cadence, in this example once per week. To keep things simple we are going to create a Point order, which takes a single latitude/longitude coordinate pair. Since this is your monitoring order, you need to provide the details of what the tasing order is called, the coordinates, the time period over which the order should be active and the cadence.\n",
198+
"We want to create a monitoring tasking order that can be set up to take images of the same location at a defined cadence, in this example once per week for a month. To keep things simple we are going to create a Point order, which takes a single latitude/longitude coordinate pair. Since this is your monitoring order, you need to provide the details of what the tasking order is called and the coordinates. \n",
201199
"\n",
202-
"To make things easier, we will default the start and end time to start tomorrow and end 28 days from now, with the aim of taking four images if we stick to the weekly cadence. Of course, feel free to change this to suit your needs, but if you do, take note that all times should be in UTC format. Unlike a standard flexible tasking order, a monitoring tasking order requires the end time to be defined."
203-
]
200+
"To make things easier, we will default the start time to start tomorrow with the aim of taking four images if we stick to the weekly cadence. Of course, feel free to change this to suit your needs, but if you do, take note that all times should be in UTC format.\n",
201+
"\n",
202+
"Monitoring Tasking Orders are composed slightly different than other types of Tasking Order in that they do not require an *end time* to be defined, in fact the end time is ignored even if it is provided. Instead it requires a **rrule** string to be defined that will set the frequency, the interval and the count, which, when taken together, define the overall cadence pattern for the monitoring order. The only required field in the rrule stirng is the **count**, although in this example we are also defining the frequency, the interval and the week start. More information on the rrule and how it is used for Tasking Orders can be found in the [Planet Developers Portal](https://developers.planet.com/docs/tasking/examples/monitoring)\n"
203+
],
204+
"cell_type": "markdown",
205+
"metadata": {}
204206
},
205207
{
206208
"cell_type": "code",
@@ -213,7 +215,8 @@
213215
"latitude=float(input(\"Provide the latitude\"))\n",
214216
"longitude=float(input(\"Provide the longitude\"))\n",
215217
"\n",
216-
"# Because the geometry is GeoJSON, the coordinates must be longitude,latitude\n",
218+
"# Because the geometry is GeoJSON, the coordinates must be longitude,latitude. \n",
219+
"# It is also necessary to set the scheduling_type to \"MONITORING\"\n",
217220
"order = {\n",
218221
" 'name': name,\n",
219222
" 'geometry': {\n",
@@ -222,20 +225,19 @@
222225
" longitude,\n",
223226
" latitude\n",
224227
" ]\n",
225-
" }\n",
228+
" },\n",
229+
" \"scheduling_type\": \"MONITORING\"\n",
226230
"}\n",
227231
"\n",
228-
"# Set a start and end time, giving the order a month to complete\n",
232+
"# Set a start time\n",
229233
"tomorrow = datetime.now(pytz.utc) + timedelta(days=1)\n",
230-
"twenty_eight_days_later = tomorrow + timedelta(days=28)\n",
231234
"\n",
232-
"# define the cadence\n",
233-
"cadence=7\n",
235+
"# define the rrule\n",
236+
"rrule=\"FREQ=WEEKLY;COUNT=4;INTERVAL=1;WKST=MO\"\n",
234237
"\n",
235238
"monitoring_parameters = {\n",
236239
" 'start_time': tomorrow.isoformat(),\n",
237-
" 'end_time': twenty_eight_days_later.isoformat(),\n",
238-
" 'monitoring_cadence': cadence\n",
240+
" 'rrule': rrule\n",
239241
"}\n",
240242
"\n",
241243
"# Add the monitoring parameters\n",

0 commit comments

Comments
 (0)