rs_workflows/adf_flow.md¶
Adf conversion flow implementation.
AdfConversionConfig
¶
Bases: NamedTuple
Configuration needed to run one ADF conversion type.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
S03StbAdfConfig
¶
Bases: NamedTuple
Configuration specific to one S03 ADF type converted with stb_convert_products.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
SafeDict
¶
Bases: dict
Dict subclass that returns {key} if key is missing or its value is None.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
adf_conversion(adf_input)
async
¶
Prefect flow for ADF conversion.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 | |
adf_conversion_task(*args, **kwargs)
async
¶
create_stac_item_from_zarr(zarr_path, generated_prod_type)
¶
Create a STAC Item from a generated ZARR directory or JSON file.
For ZARR directories, metadata is read from .zattrs or zarr.json. For JSON files, the file itself is the metadata and the item ID is taken from stac_discovery.id when present, otherwise it is derived from the filename (minus the .json extension).
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
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 | |
extract_datetimes_from_item_id(item_id)
¶
Extract start and end datetime ISO strings from an item_id.
The expected item_id format is
Returns a (start_datetime, end_datetime) tuple on success, or None when the pattern does not match.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
normalize_stac_datetime_value(value)
¶
Normalize a datetime string to an RFC 3339 UTC representation.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
normalize_stac_properties_datetimes(stac_props)
¶
Normalize STAC datetime-like property values to include an explicit timezone.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
resolve_collection_name(mappings, product_type)
¶
Resolve a collection name from mappings, preferring an exact match over '*'.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
resolve_required_types(adf_config, satellite)
¶
Return the legacy auxiliary product types to convert. For the mission-dependent ADF types, they depend on the mission of the satellite (e.g. 'sentinel-1' for 'sentinel-1a').
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
resolve_source_name(mappings, product_type)
¶
Resolve the source from mappings.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
run_adf_script(script_path, data_dir, working_dir, output_dir, legacy_product_type=None, generated_product_type=None)
¶
Run an ADF conversion tool with the given input and output directories.
When script_path is a Path, the corresponding Python script is executed
with the current interpreter. When it equals :data:STB_CONVERT_PRODUCTS,
the stb_convert_products executable is called instead.
Returns the list of generated ZARR product directories and JSON files.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
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 | |
substitute_values(obj, values)
¶
Recursively substitute values in a nested structure of dicts/lists/strings.
Source code in docs/rs-client-libraries/rs_workflows/adf_flow.py
upload_adf_product(product_path, stac_item, s3_dir)
async
¶
Upload a generated ADF product (ZARR directory or JSON file) under the given S3 directory, and update the href of the STAC item 'data' asset.