Skip to content

Commit 559c395

Browse files
author
Christoph Rieke
authored
New guide examples - up5104 (#176)
* new example in readme * new 30sec example in docs * adjust detailed example * adjust 30sec notebook * use detailed example notebook directly in docs * adjust reflinks * adjust 30sec example * hide airport monitoring * example sentence
1 parent 9ffd1aa commit 559c395

10 files changed

+121
-361
lines changed

README.md

+20-19
Original file line numberDiff line numberDiff line change
@@ -48,46 +48,47 @@ The UP42 Python package uses six objects, representing the **hierarchical struct
4848
![](docs/assets/vizualisations.jpg)
4949

5050

51-
In this example a **new workflow** consisting of [**Sentinel-2 data**](https://marketplace.up42.com/block/3a381e6b-acb7-4cec-ae65-50798ce80e64)
52-
and [**Image Sharpening**](https://marketplace.up42.com/block/e374ea64-dc3b-4500-bb4b-974260fb203e) is created.
51+
In this example a **new workflow** consisting of [**Sentinel-2 data**](https://marketplace.up42.com/block/018dfb34-fc19-4334-8125-14fd7535f979)
52+
and [**Land-Surface-Temperature**](https://marketplace.up42.com/block/34767300-5caf-472b-a684-a351212b5c14) is created.
5353
The area of interest and workflow parameters are defined. After **running the job**,
5454
the results are **downloaded** and visualized.
5555

5656
Try this example without installation! [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/up42/up42-py/master?filepath=examples%2Fguides%2F30-seconds-example.ipynb)
5757

5858
```python
5959
import up42
60-
up42.authenticate(project_id="12345", project_api_key="12345")
61-
# up42.authenticate(cfg_file="config.json")
62-
60+
up42.authenticate(project_id="12345", project_api_key="67890")
6361
project = up42.initialize_project()
64-
workflow = project.create_workflow(name="30-seconds-workflow", use_existing=True)
6562

66-
# Add data and processing blocks to the workflow.
67-
print(up42.get_blocks(basic=True))
68-
input_tasks = ['sobloo-s2-l1c-aoiclipped', 'sharpening']
69-
workflow.add_workflow_tasks(input_tasks=input_tasks)
63+
# Construct workflow
64+
workflow = project.create_workflow(name="30-seconds-workflow", use_existing=True)
65+
#print(up42.get_blocks(basic=True))
66+
input_tasks = ["Sentinel-2 Level 2 (BOA) AOI clipped",
67+
"Land Surface Temperature Estimation"]
68+
workflow.add_workflow_tasks(input_tasks)
7069

71-
# Define the aoi and input parameters of the workflow.
70+
# Define the aoi and input parameters of the workflow to run it.
7271
aoi = up42.get_example_aoi(as_dataframe=True)
73-
#aoi = up42.read_vector_file("data/aoi_berlin.geojson", as_dataframe=True)
72+
# Or use up42.draw_aoi(), up42.read_vector_file(), FeatureCollection, GeoDataFrame etc.
7473
input_parameters = workflow.construct_parameters(geometry=aoi,
7574
geometry_operation="bbox",
7675
start_date="2018-01-01",
7776
end_date="2020-12-31",
7877
limit=1)
79-
input_parameters["sobloo-s2-l1c-aoiclipped:1"].update({"max_cloud_cover":60})
78+
input_parameters["sentinelhub-s2-aoiclipped:1"].update({"max_cloud_cover":5})
79+
80+
# Price estimation
81+
workflow.estimate_job(input_parameters)
8082

81-
# Run a test job to check data availability and configuration.
82-
test_job = workflow.test_job(input_parameters=input_parameters, track_status=True)
83-
test_results = test_job.get_results_json()
84-
print(test_results)
83+
# Run a test job to query data availability and check the configuration.
84+
test_job = workflow.test_job(input_parameters, track_status=True)
8585

8686
# Run the actual job.
87-
job = workflow.run_job(input_parameters=input_parameters, track_status=True)
87+
job = workflow.run_job(input_parameters, track_status=True)
8888

8989
job.download_results()
90-
job.plot_results()
90+
job.plot_results(figsize=(6,6), bands=[1], cmap="YlOrBr")
91+
#job.map_results(bands=[1])
9192
```
9293

9394
## Support

coverage.svg

+2-2
Loading

docs/30-second-example.md

+20-23
Original file line numberDiff line numberDiff line change
@@ -6,50 +6,47 @@ The UP42 Python package uses six objects, representing the **hierarchical struct
66

77
------------------------
88

9-
In this example a **new workflow** consisting of [**Sentinel-2 data**](https://marketplace.up42.com/block/3a381e6b-acb7-4cec-ae65-50798ce80e64)
10-
and [**Image Sharpening**](https://marketplace.up42.com/block/e374ea64-dc3b-4500-bb4b-974260fb203e) is created.
9+
In this example a **new workflow** consisting of [**Sentinel-2 data**](https://marketplace.up42.com/block/018dfb34-fc19-4334-8125-14fd7535f979)
10+
and [**Land-Surface-Temperature**](https://marketplace.up42.com/block/34767300-5caf-472b-a684-a351212b5c14) is created.
1111
The area of interest and workflow parameters are defined. After **running the job**,
1212
the results are **downloaded** and visualized.
1313

1414
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/up42/up42-py/master?filepath=examples%2Fguides%2F30-seconds-example.ipynb)
1515

1616
```python
1717
import up42
18-
up42.authenticate(project_id="123", project_api_key="456")
19-
# up42.authenticate(cfg_file="config.json")
20-
18+
up42.authenticate(project_id="12345", project_api_key="67890")
2119
project = up42.initialize_project()
22-
workflow = project.create_workflow(name="30-seconds-workflow",
23-
use_existing=True)
2420

25-
# Add data and processing blocks to the workflow.
26-
print(up42.get_blocks(basic=True))
27-
input_tasks = ['sobloo-s2-l1c-aoiclipped', 'sharpening']
28-
workflow.add_workflow_tasks(input_tasks=input_tasks)
21+
# Construct workflow
22+
workflow = project.create_workflow(name="30-seconds-workflow", use_existing=True)
23+
#print(up42.get_blocks(basic=True))
24+
input_tasks = ["Sentinel-2 Level 2 (BOA) AOI clipped",
25+
"Land Surface Temperature Estimation"]
26+
workflow.add_workflow_tasks(input_tasks)
2927

30-
# Define the aoi and input parameters of the workflow.
28+
# Define the aoi and input parameters of the workflow to run it.
3129
aoi = up42.get_example_aoi(as_dataframe=True)
32-
#aoi = workflow.read_vector_file("data/aoi_berlin.geojson", as_dataframe=True)
30+
# Or use up42.draw_aoi(), up42.read_vector_file(), FeatureCollection, GeoDataFrame etc.
3331
input_parameters = workflow.construct_parameters(geometry=aoi,
3432
geometry_operation="bbox",
3533
start_date="2018-01-01",
3634
end_date="2020-12-31",
3735
limit=1)
38-
input_parameters["sobloo-s2-l1c-aoiclipped:1"].update({"max_cloud_cover":60})
39-
print(input_parameters)
36+
input_parameters["sentinelhub-s2-aoiclipped:1"].update({"max_cloud_cover":5})
37+
38+
# Price estimation
39+
workflow.estimate_job(input_parameters)
4040

41-
# Run a test job to check data availability and configuration.
42-
test_job = workflow.test_job(input_parameters=input_parameters,
43-
track_status=True)
44-
test_results = test_job.get_results_json()
45-
print(test_results)
41+
# Run a test job to query data availability and check the configuration.
42+
test_job = workflow.test_job(input_parameters, track_status=True)
4643

4744
# Run the actual job.
48-
job = workflow.run_job(input_parameters=input_parameters,
49-
track_status=True)
45+
job = workflow.run_job(input_parameters, track_status=True)
5046

5147
job.download_results()
52-
job.plot_results()
48+
job.plot_results(figsize=(6,6), bands=[1], cmap="YlOrBr")
49+
#job.map_results(bands=[1])
5350
```
5451

5552
<br>

docs/catalog.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ catalog.map_quicklooks(scenes=search_results, aoi=aoi)
6060
<br>
6161

6262
!!! Success "Success!"
63-
Continue with the [Detailed Example](detailed-example.md)!
63+
Continue with the [Detailed Example](/guides/detailed-example/)!

docs/cli.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ After running the command to persist the workflow you can get the workflow tasks
8484
up42 workflow get-workflow-tasks
8585
```
8686

87-
You can also add workflow tasks to the workflow via a json file (see [typical usage](detailed-example.md) for an example):
87+
You can also add workflow tasks to the workflow via a json file (see [detailed-example](/guides/detailed-example/) for an example):
8888
```bash
8989
up42 workflow add-workflow-tasks new_workflow_tasks.json
9090
```
@@ -94,7 +94,7 @@ up42 workflow add-workflow-tasks new_workflow_tasks.json
9494
up42 job -h
9595
```
9696

97-
First create and run a new test job with parameters defined in a json file (see [typical usage](detailed-example.md) for an example):
97+
First create and run a new test job with parameters defined in a json file (see [detailed-example](/guides/detailed-example/) for an example):
9898
```bash
9999
up42 workflow test-job input_parameters.json --track
100100
```

docs/detailed-example.md

-198
This file was deleted.

docs/examples-intro.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ interactively with Binder [![Binder](https://mybinder.org/badge_logo.svg)](https
77

88
<br>
99

10-
:satellite: [Radar Processing](https://sdk.up42.com/examples/radar_processing_1/)
11-
:airplane: [Airport Monitoring with parallel jobs](https://sdk.up42.com/examples/airports-parallel/)
1210
:airplane: [Aircraft Detection](https://sdk.up42.com/examples/aircraft-detection)
11+
:satellite: [Radar Processing](https://sdk.up42.com/examples/radar_processing_1/)
1312
:droplet: [Flood Mapping](https://sdk.up42.com/examples/flood_mapping/)
1413
🖼️ [Image mosaicking](https://github.com/up42/mosaicking)
1514
:eye: [Catalog Quicklooks](https://sdk.up42.com/examples/catalog-quicklooks/)
1615
:ship: [Ship Identification](https://sdk.up42.com/examples/ship-identification)
17-

0 commit comments

Comments
 (0)