Downloader
The InSARHub Downloader module provides a streamlined interface for searching and downloading satellite data.
-
Import downloader
Import the Downloader class to access all downloader functionality
-
View available downloaders
List all registered downloader
Available Downloaders
ASF Base Downloader
InSARHub wrapped asf_search as one of its download backends. The ASF_Base_Downloader is implemented on top of a reusable base configuration class, which provides the full searching, filtering, and downloading logic of asf_search.
Source code in src/insarhub/downloader/asf_base.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 100 101 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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 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 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 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 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 | |
Usage
-
Create downloader with parameters
Initialize a downloader instance with search criteria
OR:s1 = Downloader.create('ASF_Base_Downloader', intersectsWith=[-113.05, 37.74, -112.68, 38.00], dataset='SENTINEL-1', instrument='C-SAR', beamMode='IW', polarization=['VV', 'VV+VH'], processingLevel='SLC' start='2020-01-01', end='2020-12-31', relativeOrbit=100, frame=466, workdir='path/to/dir')ORparams = { "intersectsWith": [-113.05, 37.74, -112.68, 38.00], "dataset": "SENTINEL-1", "instrument": "C-SAR", "beamMode": "IW", "polarization": ["VV", "VV+VH"], "processingLevel": "SLC", "start": "2020-01-01", "end": "2020-12-31", "relativeOrbit": 100, "frame": 466, "workdir": "path/to/dir" } dl = Downloader.create('ASF_Base_Downloader', **params)from insarhub.config import ASF_Base_Config cfg = ASF_Base_Config(intersectsWith=[-113.05, 37.74, -112.68, 38.00], dataset='SENTINEL-1', instrument='C-SAR', beamMode='IW', polarization=['VV', 'VV+VH'], processingLevel='SLC' start='2020-01-01', end='2020-12-31', relativeOrbit=100, frame=466, workdir='path/to/dir') dl = Downloader.create('ASF_Base_Downloader', config=cfg)The base configure
ASF_Base_Configcontains all parameters from asf_search keywords. For detailed descriptions and usage of each parameter, please refer to the official ASF Search documentation.Source code in
src/insarhub/config/defaultconfig.py10 11 12 13 14 15 16 17 18 19 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 100 101 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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
@dataclass class ASF_Base_Config: ''' Dataclass containing all configuration options for asf_search. This class provides a unified interface for configuring ASF (Alaska Satellite Facility) search parameters. ''' name: str = "ASF_Base_Config" dataset: str | list[str] | None = None platform: str | list[str] | None = None instrument: str | None = None absoluteBurstID: int | list[int] | None = None absoluteOrbit: int | list[int] | None = None asfFrame: int | list[int] | None = None beamMode: str | None = None beamSwath: str | list[str] | None = None campaign: str | None = None maxDoppler: float | None = None minDoppler: float | None = None maxFaradayRotation: float | None = None minFaradayRotation: float | None = None flightDirection: str | None = None flightLine: str | None = None frame: int | list[int] | None = None frameCoverage: str | None = None fullBurstID: str | list[str] | None = None groupID: str | None = None jointObservation: bool | None = None lookDirection: str | None = None offNadirAngle: float | list[float] | None = None operaBurstID: str | list[str] | None = None polarization: str | list[str] | None = None mainBandPolarization: str | list[str] | None = None sideBandPolarization: str | list[str] | None = None processingLevel: str | None = None productionConfiguration: str | list[str] | None = None rangeBandwidth: str | list[str] | None = None relativeBurstID: str | list[str] | None = None relativeOrbit: int | list[int] | None = None intersectsWith: str | None = None processingDate: str | None = None start: str | None = None end: str | None = None season: list[int] | None = None stack_from_id: str | None = None maxResults: int | None = None granule_names: str | list[str] | None = None workdir: Path | str = field(default_factory=lambda: Path.cwd()) # ── UI metadata consumed by the API / settings panel ───────────────────── _ui_groups: ClassVar[list] = [ {"label": "Dataset", "fields": ["dataset", "platform", "instrument"]}, {"label": "SAR Parameters", "fields": ["beamMode", "beamSwath", "processingLevel", "polarization", "mainBandPolarization", "sideBandPolarization", "lookDirection", "flightDirection", "flightLine"]}, {"label": "Orbit & Frame", "fields": ["relativeOrbit", "absoluteOrbit", "frame", "asfFrame", "frameCoverage"]}, {"label": "Burst IDs", "fields": ["absoluteBurstID", "relativeBurstID", "fullBurstID", "operaBurstID"]}, {"label": "Temporal & Location", "fields": ["start", "end", "processingDate", "season", "intersectsWith", "stack_from_id", "maxResults"]}, {"label": "By Granule Name", "fields": ["granule_names"]}, {"label": "Advanced", "fields": ["campaign", "groupID", "maxDoppler", "minDoppler", "maxFaradayRotation", "minFaradayRotation", "offNadirAngle", "jointObservation", "productionConfiguration", "rangeBandwidth"]}, ] _ui_fields: ClassVar[dict] = { # Dataset "dataset": {"type": "text", "hint": "Dataset to search (e.g. SENTINEL-1, ALOS, NISAR)"}, "platform": {"type": "text", "hint": "Platform name (e.g. S1A, ALOS)"}, "instrument": {"type": "text", "hint": "Instrument name (e.g. C-SAR)"}, # SAR Parameters "beamMode": {"type": "select", "options": ["", "IW", "EW", "SM", "WV"], "hint": "SAR acquisition mode"}, "beamSwath": {"type": "text", "hint": "Beam swath identifier"}, "processingLevel": {"type": "select", "options": ["", "SLC", "GRD", "GRD_HD", "GRD_MS", "BURST", "RTC_HI_RES", "RTC_LOW_RES"], "hint": "Processing level"}, "polarization": {"type": "text", "hint": "Polarization(s), e.g. VV or VV+VH"}, "mainBandPolarization": {"type": "text", "hint": "Main band polarization (NISAR dual-band)"}, "sideBandPolarization": {"type": "text", "hint": "Side band polarization (NISAR dual-band)"}, "lookDirection": {"type": "select", "options": ["", "LEFT", "RIGHT"], "hint": "Radar look direction"}, "flightDirection": {"type": "select", "options": ["", "ASCENDING", "DESCENDING"], "hint": "Orbit direction (empty = both)"}, "flightLine": {"type": "text", "hint": "Flight line identifier"}, # Orbit & Frame "relativeOrbit": {"type": "text", "hint": "Relative orbit (path) number(s), e.g. 64 or 64,65"}, "absoluteOrbit": {"type": "text", "hint": "Absolute orbit number(s)"}, "frame": {"type": "text", "hint": "Sensor native frame number(s)"}, "asfFrame": {"type": "text", "hint": "ASF internal frame number(s)"}, "frameCoverage": {"type": "text", "hint": "Frame coverage filter"}, # Burst IDs "absoluteBurstID": {"type": "text", "hint": "Absolute burst ID(s)"}, "relativeBurstID": {"type": "text", "hint": "Relative burst ID(s)"}, "fullBurstID": {"type": "text", "hint": "Full burst ID, e.g. T064_135524_IW1"}, "operaBurstID": {"type": "text", "hint": "OPERA burst ID(s)"}, # Temporal & Location "start": {"type": "text", "hint": "Default start date (ISO 8601, e.g. 2020-01-01)"}, "end": {"type": "text", "hint": "Default end date (ISO 8601, e.g. 2022-12-31)"}, "processingDate": {"type": "text", "hint": "Processing date filter (ISO 8601)"}, "season": {"type": "text", "hint": "Day-of-year range for seasonal filtering, e.g. 1,90"}, "intersectsWith": {"type": "text", "hint": "WKT geometry for spatial intersection"}, "stack_from_id": {"type": "text", "hint": "Build stack from a reference scene ID"}, "maxResults": {"type": "auto_number", "min": 1, "max": 50000, "step": 100, "hint": "Maximum number of search results returned"}, "granule_names": {"type": "text", "hint": "Granule/scene names (comma-separated), or a path to a CSV/XLSX/TXT file. " "When set, overrides normal parameter-based search."}, # Advanced "campaign": {"type": "text", "hint": "Campaign name filter (UAVSAR / airborne datasets)"}, "groupID": {"type": "text", "hint": "Group ID filter"}, "maxDoppler": {"type": "auto_number", "hint": "Maximum Doppler centroid frequency (Hz)"}, "minDoppler": {"type": "auto_number", "hint": "Minimum Doppler centroid frequency (Hz)"}, "maxFaradayRotation": {"type": "auto_number", "hint": "Maximum Faraday rotation angle (degrees)"}, "minFaradayRotation": {"type": "auto_number", "hint": "Minimum Faraday rotation angle (degrees)"}, "offNadirAngle": {"type": "text", "hint": "Off-nadir angle(s), e.g. 34.3 or 21.5,26.2"}, "jointObservation":{"type": "bool", "hint": "Filter for joint ALOS PALSAR/AVNIR-2 observations"}, "productionConfiguration": {"type": "text", "hint": "Production configuration identifier"}, "rangeBandwidth": {"type": "text", "hint": "Range bandwidth filter"}, } # ───────────────────────────────────────────────────────────────────────── def __post_init__(self): if isinstance(self.workdir, str): self.workdir = Path(self.workdir).expanduser().resolve() -
Search
Query the satellite archive and retrieve available scenes matching your criteria
-
Filter
Refine existing search results by applying additional constraints
Parameters:
Name Type Description Default path_frametuple | list[tuple]A single (path, frame) tuple or list of tuples. Defaults to None.
NonestartstrStart date string, e.g. '2021-01-01'. Defaults to None.
NoneendstrEnd date string, e.g. '2023-12-31'. Defaults to None.
Noneframeint | list[int]Sensor native frame number(s), e.g. 50. Defaults to None.
NoneasfFrameint | list[int]ASF internal frame number(s), e.g. 50. Defaults to None.
NoneflightDirectionstr'ASCENDING' or 'DESCENDING'. Defaults to None.
NonerelativeOrbitint | list[int]Relative orbit number(s) to keep. Defaults to None.
NoneabsoluteOrbitint | list[int]Absolute orbit number(s) to keep. Defaults to None.
NonelookDirectionstr'LEFT' or 'RIGHT'. Defaults to None.
Nonepolarizationstr | list[str]Polarization(s) to keep, e.g. 'VV' or ['VV', 'VH']. Defaults to None.
NoneprocessingLevelstrProcessing level to keep, e.g. 'SLC'. Defaults to None.
NonebeamModestrBeam mode to keep, e.g. 'IW'. Defaults to None.
Noneseasonlist[int]List of months (1-12) to keep, e.g. [6, 7, 8] for summer. Defaults to None.
Nonemin_coveragefloatMinimum fractional overlap (0-1) between scene and AOI. Defaults to None.
Nonemin_countintDrop stacks with fewer than this many scenes after filtering. Defaults to None.
Nonemax_countintKeep at most this many scenes per stack (from earliest). Defaults to None.
Nonelatest_nintKeep the N most recent scenes per stack. Defaults to None.
Noneearliest_nintKeep the N earliest scenes per stack. Defaults to None.
NoneRaises:
Type Description ValueErrorIf no search results are available.
-
Reset filter
Restore search results to the original unfiltered state
-
Summary
Display statistics and overview of current search results
-
View Footprint
Visualize geographic coverage of search results on an interactive map
-
Download
Download all scenes from current search results to local storage
Parameters:
Name Type Description Default save_pathstrDownload path. If None, uses config.workdir. Defaults to None.
Nonemax_workersintNumber of concurrent downloads. 3-5 recommended for ASF. Set to 1 to disable multithreading. Defaults to 3.
3Raises:
Type Description ValueErrorIf no search results are available.
-
DEM Download
Download DEM that covers all scenes from current search results to local storatge
-
Select Pairs
Compute interferogram pairs for all active stacks based on temporal and perpendicular baseline constraints
from insarhub.utils import plot_pair_network pairs, baselines, scene_bperp = dl.select_pairs( dt_targets=(6, 12, 24, 36, 48, 72, 96), dt_tol=3, dt_max=120, pb_max=150.0, min_degree=3, max_degree=5, force_connect=True, ) fig = plot_pair_network(pairs, baselines, scene_bperp) fig.show()Parameters:
Name Type Description Default dt_targetstupleTarget temporal spacings in days. Defaults to (6, 12, 24, 36, 48, 72, 96).
(6, 12, 24, 36, 48, 72, 96)dt_tolintTolerance in days around each target spacing. Defaults to 3.
3dt_maxintMaximum temporal baseline in days. Defaults to 120.
120pb_maxfloatMaximum perpendicular baseline in meters. Defaults to 150.0.
150.0min_degreeintMinimum number of connections per scene. Defaults to 3.
3max_degreeintMaximum number of connections per scene. Defaults to 999.
999force_connectboolForce connectivity for isolated scenes. Defaults to True.
Truemax_workersintThreads for API baseline fallback. Defaults to 4.
4
S1_SLC
S1_SLC is a specialized downloader that extends ASF_Base_Downloader, preconfigured specifically for downloading Sentinel-1 SLC data.
Source code in src/insarhub/downloader/s1_slc.py
12 13 14 15 16 17 18 19 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
Usage
-
Create downloader with parameters
Initialize a downloader instance with search criteria
ORs1 = Downloader.create('S1_SLC', intersectsWith=[-113.05, 37.74, -112.68, 38.00], start='2020-01-01', end='2020-12-31', relativeOrbit=100, frame=466, workdir='path/to/dir')ORparams = { "intersectsWith": [-113.05, 37.74, -112.68, 38.00], "start": "2020-01-01", "end": "2020-12-31", "relativeOrbit": 100, "frame": 466, "workdir": "path/to/dir" } dl = Downloader.create('S1_SLC', **params)from insarhub.config import S1_SLC_Config cfg = S1_SLC_Config(intersectsWith= [-113.05, 37.74, -112.68, 38.00], start= "2020-01-01", end= "2020-12-31", relativeOrbit= 100, frame= 466, workdir= "path/to/dir") dl = Downloader.create('S1_SLC', config=cfg)The configure
S1_SLC_configcontains pre-defined parameters specifically for Sentinel-1 data. For detailed descriptions and usage of each parameter, please refer to the official ASF Search documentation.Source code in
src/insarhub/config/defaultconfig.py -
Search
Query the satellite archive and retrieve available scenes matching your criteria
-
Filter
Refine existing search results by applying additional constraints
Parameters:
Name Type Description Default path_frametuple | list[tuple]A single (path, frame) tuple or list of tuples. Defaults to None.
NonestartstrStart date string, e.g. '2021-01-01'. Defaults to None.
NoneendstrEnd date string, e.g. '2023-12-31'. Defaults to None.
Noneframeint | list[int]Sensor native frame number(s), e.g. 50. Defaults to None.
NoneasfFrameint | list[int]ASF internal frame number(s), e.g. 50. Defaults to None.
NoneflightDirectionstr'ASCENDING' or 'DESCENDING'. Defaults to None.
NonerelativeOrbitint | list[int]Relative orbit number(s) to keep. Defaults to None.
NoneabsoluteOrbitint | list[int]Absolute orbit number(s) to keep. Defaults to None.
NonelookDirectionstr'LEFT' or 'RIGHT'. Defaults to None.
Nonepolarizationstr | list[str]Polarization(s) to keep, e.g. 'VV' or ['VV', 'VH']. Defaults to None.
NoneprocessingLevelstrProcessing level to keep, e.g. 'SLC'. Defaults to None.
NonebeamModestrBeam mode to keep, e.g. 'IW'. Defaults to None.
Noneseasonlist[int]List of months (1-12) to keep, e.g. [6, 7, 8] for summer. Defaults to None.
Nonemin_coveragefloatMinimum fractional overlap (0-1) between scene and AOI. Defaults to None.
Nonemin_countintDrop stacks with fewer than this many scenes after filtering. Defaults to None.
Nonemax_countintKeep at most this many scenes per stack (from earliest). Defaults to None.
Nonelatest_nintKeep the N most recent scenes per stack. Defaults to None.
Noneearliest_nintKeep the N earliest scenes per stack. Defaults to None.
NoneRaises:
Type Description ValueErrorIf no search results are available.
-
Reset filter
Restore search results to the original unfiltered state
-
Summary
Display statistics and overview of current search results
-
View Footprint
Visualize geographic coverage of search results on an interactive map
-
Download
Download all scenes from current search results to local storage
Parameters:
Name Type Description Default save_pathstr | NoneOptional path to save the downloaded files. Defaults to None.
Nonemax_workersintParallel download workers. Defaults to 3.
3force_asfboolIf True, forces downloading orbit files from ASF instead of CDSE. Defaults to False.
Falsedownload_orbitboolIf True, also downloads orbit files after scenes. Defaults to False.
Falsestop_eventOptional threading.Event to cancel the download.
Noneon_progressOptional callback(message, pct) called after each file completes.
None -
DEM Download
Download DEM that covers all scenes from current search results to local storatge
-
Select Pairs
Compute interferogram pairs for all active stacks based on temporal and perpendicular baseline constraints
from insarhub.utils import plot_pair_network pairs, baselines, scene_bperp = s1.select_pairs( dt_targets=(6, 12, 24, 36, 48, 72, 96), dt_tol=3, dt_max=120, pb_max=150.0, min_degree=3, max_degree=5, force_connect=True, ) fig = plot_pair_network(pairs, baselines, scene_bperp) fig.show()Parameters:
Name Type Description Default dt_targetstupleTarget temporal spacings in days. Defaults to (6, 12, 24, 36, 48, 72, 96).
(6, 12, 24, 36, 48, 72, 96)dt_tolintTolerance in days around each target spacing. Defaults to 3.
3dt_maxintMaximum temporal baseline in days. Defaults to 120.
120pb_maxfloatMaximum perpendicular baseline in meters. Defaults to 150.0.
150.0min_degreeintMinimum number of connections per scene. Defaults to 3.
3max_degreeintMaximum number of connections per scene. Defaults to 999.
999force_connectboolForce connectivity for isolated scenes. Defaults to True.
Truemax_workersintThreads for API baseline fallback. Defaults to 4.
4