Catalog¶
Bases: CatalogBase
, VizTools
The Catalog class enables access to the UP42 catalog functionality (data archive search & ordering).
Use catalog:
catalog = up42.initialize_catalog()
This class also inherits functions from the CatalogBase class.
Source code in up42/catalog.py
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
|
construct_order_parameters(data_product_id, image_id, aoi=None, tags=None)
¶
Helps constructing the parameters dictionary required for the catalog order. Some collections have
additional parameters that are added to the output dictionary with value None. The potential values to
select from are given in the logs, for more detail on the parameter use catalog.get_data_product_schema()
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_product_id |
str
|
Id of the desired UP42 data product, see |
required |
image_id |
str
|
The id of the desired image (from search results) |
required |
aoi |
Union[dict, Feature, FeatureCollection, list, GeoDataFrame, Polygon]
|
The geometry of the order, one of dict, Feature, FeatureCollection, list, GeoDataFrame, Polygon. Optional for "full-image products". |
None
|
tags |
Optional[List[str]]
|
A list of tags that categorize the order. |
None
|
Example
order_parameters = catalog.construct_order_parameters(
data_product_id='647780db-5a06-4b61-b525-577a8b68bb54',
image_id='6434e7af-2d41-4ded-a789-fb1b2447ac92',
aoi={'type': 'Polygon',
'coordinates': (((13.375966, 52.515068),
(13.375966, 52.516639),
(13.378314, 52.516639),
(13.378314, 52.515068),
(13.375966, 52.515068)),)})
Source code in up42/catalog.py
370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 |
|
construct_parameters(**kwargs)
¶
Deprecated, see construct_search_parameters
Source code in up42/catalog.py
202 203 204 205 |
|
construct_search_parameters(geometry, collections, start_date='2020-01-01', end_date='2020-01-30', usage_type=None, limit=10, max_cloudcover=None, sortby=None, ascending=None)
staticmethod
¶
Helps constructing the parameters dictionary required for the search.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
geometry |
Union[FeatureCollection, Feature, dict, list, GeoDataFrame, Polygon]
|
The search geometry, default a Polygon. One of FeatureCollection, Feature, dict (geojson geometry), list (bounds coordinates), GeoDataFrame, shapely.Polygon, shapely.Point. All assume EPSG 4326! |
required |
collections |
List[str]
|
The satellite sensor collections to search for, e.g. ["phr"] or ["phr", "spot"]. Also see catalog.get_collections(). |
required |
start_date |
str
|
Query period starting day, format "2020-01-01". |
'2020-01-01'
|
end_date |
str
|
Query period ending day, format "2020-01-01". |
'2020-01-30'
|
usage_type |
List[str]
|
Optional. Filter for imagery that can be purchased & downloaded or also processed. ["DATA"] (can only be downloaded), ["ANALYTICS"] (can be downloaded or used directly with a processing algorithm), ["DATA", "ANALYTICS"] (can be any combination). The filter is inclusive, using ["DATA"] can also result in results with ["DATA", "ANALYTICS"]. |
None
|
limit |
int
|
The maximum number of search results to return (1-max.500). |
10
|
max_cloudcover |
Optional[int]
|
Optional. Maximum cloud coverage percent - e.g. 100 will return all scenes, 8.4 will return all scenes with 8.4 or less cloud coverage. |
None
|
sortby |
str
|
(deprecated) |
None
|
ascending |
bool
|
(deprecated) |
None
|
Source code in up42/catalog.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
download_quicklooks(image_ids, collection, output_directory=None)
¶
Gets the quicklooks of scenes from a single sensor. After download, can be plotted via catalog.map_quicklooks() or catalog.plot_quicklooks().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_ids |
List[str]
|
List of provider image_ids e.g. ["6dffb8be-c2ab-46e3-9c1c-6958a54e4527"].
Access the search results id column via |
required |
collection |
str
|
The data collection corresponding to the image ids. |
required |
output_directory |
Union[str, Path, None]
|
The file output directory, defaults to the current working directory. |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
List of quicklook image output file paths. |
Source code in up42/catalog.py
432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 |
|
estimate_order(order_parameters, **kwargs)
¶
Estimate the cost of an order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order_parameters |
Union[dict, None]
|
A dictionary like {dataProduct: ..., "params": {"id": ..., "aoi": ...}} |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
An estimated cost for the order in UP42 credits. |
Warning "Deprecated order parameters" The use of the 'scene' and 'geometry' parameters for the data estimation is deprecated. Please use the new order_parameters parameter as described above.
Source code in up42/catalog.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
search(search_parameters, as_dataframe=True)
¶
Searches the catalog for the the search parameters and returns the metadata of the matching scenes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
search_parameters |
dict
|
The catalog search parameters, see example. |
required |
as_dataframe |
bool
|
return type, GeoDataFrame if True (default), FeatureCollection if False. |
True
|
Returns:
Type | Description |
---|---|
Union[GeoDataFrame, dict]
|
The search results as a GeoDataFrame, optionally as JSON dict. |
Example
search_parameters={
"datetime": "2019-01-01T00:00:00Z/2019-01-15T23:59:59Z",
"collections": ["phr"],
"intersects": {
"type": "Polygon",
"coordinates": [[[13.32113746,52.73971768],[13.15981158,52.2092959],
[13.62204483,52.15632025],[13.78859517,52.68655119],[13.32113746,
52.73971768]]]},
"limit": 10,
"sortby": [{"field" : "properties.acquisitionDate", "direction" : "asc"}]
}
Source code in up42/catalog.py
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
|