Fetch rasters
Methods to fetch raster data from copernicus archive.Requires sentinelHub API creds Additional method to fetch bathymetry data from Cam Center for Environmental Data Analysis.
Note that this is an EXAMPLE SCRIPT. The CLC daat works with type identifiers which sre not yet integrated into the workflow.
authenticate()
Authenticae with the copernicus API
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
the access token dict |
Source code in workflow/scripts/fetch_rasters.py
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
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
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 |