Fetch rasters
Methods to fetch raster data from copernicus archive. Requires sentinelHub API.
EXAMPLE SCRIPT
authenticate()
authenticae with the copernicus API
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
the access token dict |
Source code in workflow/scripts/fetch_rasters.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
find_dataset_ids(name='global-dynamic-land-cover')
find the catalogue ID of the dataset
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
dataset product name. Defaults to "global-dynamic-land-cover". |
'global-dynamic-land-cover'
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[str]
|
the results (download_info_id, download_id) |
Source code in workflow/scripts/fetch_rasters.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
post_data_request(token, download_info_id, download_id)
post the request to the copernicus API
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
token
|
dict
|
the access token |
required |
download_info_id
|
str
|
output of find_dataset_ids |
required |
download_id
|
str
|
output of find_dataset_ids |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[dict, str]
|
the data request (json dict) and task id (string?) |
Source code in workflow/scripts/fetch_rasters.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | |
search_items(json_items, target_name='global-dynamic-land-cover')
filter items for target name
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
json_items
|
dict
|
the json response to the seach query |
required |
target_name
|
str
|
The items to find. Defaults to "global-dynamic-land-cover". |
'global-dynamic-land-cover'
|
Returns:
| Name | Type | Description |
|---|---|---|
list |
list
|
the items list |
Source code in workflow/scripts/fetch_rasters.py
54 55 56 57 58 59 60 61 62 63 64 65 | |