phidown.search
Attributes
Classes
Functions
|
Escape a value for an OData string literal or date inside a URL. |
|
Compute retry delay with exponential backoff and jitter. |
|
|
|
Split comma-separated WKT components while respecting nested parentheses. |
|
Return the normalized WKT geometry type and body. |
|
Return the contents of a single balanced parenthesized WKT group. |
|
Parse and validate a 2D WKT coordinate pair. |
|
Check that a coordinate pair is a valid EPSG:4326 longitude and latitude. |
|
Validate a 2D WKT coordinate pair. |
|
Parse a comma-separated sequence of coordinate pairs. |
|
Validate a WKT line: at least two distinct coordinate pairs in range. |
|
|
|
|
|
|
|
|
|
Return the z component of |
|
|
|
Return whether two segments share at least one point. |
|
Reject closed rings that are degenerate or that touch or cross themselves. |
|
Return whether a point is inside a closed ring or on its outline. |
|
|
|
|
|
|
|
Validate AOI WKT syntax for the supported CDSE geometry allowlist. |
|
Check the integrity of an EPSG:4326 WKT geometry and return it normalized. |
|
|
|
|
|
Extract an acquisition start datetime-like value from various representations. |
|
Module Contents
- phidown.search._SUPPORTED_AOI_WKT_TYPES = ('POINT', 'MULTIPOINT', 'LINESTRING', 'MULTILINESTRING', 'POLYGON', 'MULTIPOLYGON')[source]
- phidown.search._odata_text(value: Any) str[source]
Escape a value for an OData string literal or date inside a URL.
- phidown.search._compute_backoff_delay(attempt_index: int, backoff_base: float, backoff_max: float) float[source]
Compute retry delay with exponential backoff and jitter.
- phidown.search._resolve_product_download_mode(mode: str = 'fast', *, resume_mode: str | None = None) str[source]
- phidown.search._split_wkt_components(text: str) List[str][source]
Split comma-separated WKT components while respecting nested parentheses.
- phidown.search._parse_wkt_geometry(aoi_wkt: str) Tuple[str, str][source]
Return the normalized WKT geometry type and body.
- phidown.search._unwrap_wkt_group(text: str) str[source]
Return the contents of a single balanced parenthesized WKT group.
- phidown.search._parse_coordinate(text: str) Tuple[float, float][source]
Parse and validate a 2D WKT coordinate pair.
- phidown.search._validate_coordinate_range(coord: Tuple[float, float]) None[source]
Check that a coordinate pair is a valid EPSG:4326 longitude and latitude.
- phidown.search._coordinates_from_sequence(text: str) List[Tuple[float, float]][source]
Parse a comma-separated sequence of coordinate pairs.
- phidown.search._validate_coordinate_sequence(text: str) None[source]
Validate a WKT line: at least two distinct coordinate pairs in range.
- phidown.search._cross(origin: Tuple[float, float], first: Tuple[float, float], second: Tuple[float, float]) float[source]
Return the z component of
(first - origin) x (second - origin).
- phidown.search._in_segment_box(start: Tuple[float, float], end: Tuple[float, float], point: Tuple[float, float]) bool[source]
- phidown.search._segments_touch(first: Tuple[Tuple[float, float], Tuple[float, float]], second: Tuple[Tuple[float, float], Tuple[float, float]]) bool[source]
Return whether two segments share at least one point.
- phidown.search._validate_ring_is_simple(coords: List[Tuple[float, float]]) None[source]
Reject closed rings that are degenerate or that touch or cross themselves.
- phidown.search._point_in_ring(point: Tuple[float, float], ring: List[Tuple[float, float]]) bool[source]
Return whether a point is inside a closed ring or on its outline.
- phidown.search._validate_supported_aoi_wkt(aoi_wkt: str) None[source]
Validate AOI WKT syntax for the supported CDSE geometry allowlist.
- phidown.search.validate_wkt(aoi_wkt: str) str[source]
Check the integrity of an EPSG:4326 WKT geometry and return it normalized.
The check covers the syntax, the supported geometry types, the longitude and latitude ranges, lines without two distinct points, and polygon rings that are open, degenerate, or that touch or cross themselves, and polygon holes with a corner outside the outer ring. Overlaps between holes or between the parts of a MULTIPOLYGON are not checked.
- Parameters:
aoi_wkt (str) – WKT geometry, for example
POINT(12.4 41.9).- Returns:
The WKT string with redundant whitespace removed and the geometry type in upper case.
- Return type:
- Raises:
TypeError – If
aoi_wktis not a string.ValueError – If the geometry is not valid.
- phidown.search._strip_closing_coordinate(coords: List[Tuple[float, float]]) List[Tuple[float, float]][source]
- phidown.search._centroid_coordinates_from_body(geometry_type: str, body: str) List[Tuple[float, float]][source]
- phidown.search._extract_date_start(value: Any) Any[source]
Extract an acquisition start datetime-like value from various representations.
- class phidown.search.CopernicusDataSearcher(config_path: str | None = None, **query_kwargs: Any)[source]
-
- _phisat2_searcher: phidown.phisat2.PhiSat2Searcher | None = None[source]
- query_by_filter(base_url: str = 'https://catalogue.dataspace.copernicus.eu/odata/v1/Products', collection_name: str | None = 'SENTINEL-1', product_type: str | None = None, orbit_direction: str | None = None, cloud_cover_threshold: float | None = None, attributes: Dict[str, str | int | float] | None = None, aoi_wkt: str | None = None, start_date: str | None = None, end_date: str | None = None, top: int = 1000, count: bool = False, skip: int | None = None, order_by: str = 'ContentDate/Start desc', burst_mode: bool = False, burst_id: int | None = None, absolute_burst_id: int | None = None, swath_identifier: str | None = None, parent_product_name: str | None = None, parent_product_type: str | None = None, parent_product_id: str | None = None, datatake_id: int | None = None, relative_orbit_number: int | None = None, operational_mode: str | None = None, polarisation_channels: str | None = None, platform_serial_identifier: str | None = None, filter_text: str | None = None, config_file: str = '.s5cfg') None[source]
Set and validate search parameters for the Copernicus data query.
- Parameters:
base_url (str) – The base URL for the OData API.
collection_name (str, optional) – Name of the collection to search. Defaults to ‘SENTINEL-1’.
product_type (str, optional) – Type of product to filter. Defaults to None.
orbit_direction (str, optional) – Orbit direction to filter (e.g., ‘ASCENDING’, ‘DESCENDING’). Defaults to None.
cloud_cover_threshold (float, optional) – Maximum cloud cover percentage to filter. Defaults to None.
attributes (Dict[str, Union[str, int, float]], optional) – Additional attributes for filtering. Defaults to None.
aoi_wkt (str, optional) – Area of Interest in WKT format. Supported types are POINT, MULTIPOINT, LINESTRING, MULTILINESTRING, POLYGON, and MULTIPOLYGON. The query builder serializes the AOI as SRID 4326 for CDSE. Defaults to None.
start_date (str, optional) – Start date for filtering (ISO 8601 format). Defaults to None.
end_date (str, optional) – End date for filtering (ISO 8601 format). Defaults to None.
top (int, optional) – Maximum number of results to retrieve. Defaults to 1000.
count (bool, optional) – Request result count and auto-fetch all pages when needed. Defaults to False.
skip (int, optional) – Number of matching results to skip for manual pagination. Defaults to None.
order_by (str, optional) – Field and direction to order results by. Defaults to “ContentDate/Start desc”.
burst_mode (bool, optional) – Enable Sentinel-1 SLC Burst mode searching. Defaults to False.
burst_id (int, optional) – Burst ID to filter (burst mode only). Defaults to None.
absolute_burst_id (int, optional) – Absolute Burst ID to filter (burst mode only). Defaults to None.
swath_identifier (str, optional) – Swath identifier (e.g., ‘IW1’, ‘IW2’) (burst mode only). Defaults to None.
parent_product_name (str, optional) – Parent product name (burst mode only). Defaults to None.
parent_product_type (str, optional) – Parent product type (burst mode only). Defaults to None.
parent_product_id (str, optional) – Parent product ID (burst mode only). Defaults to None.
datatake_id (int, optional) – Datatake ID (burst mode only). Defaults to None.
relative_orbit_number (int, optional) – Relative orbit number (burst mode only). Defaults to None.
operational_mode (str, optional) – Operational mode (e.g., ‘IW’, ‘EW’) (burst mode only). Defaults to None.
polarisation_channels (str, optional) – Polarisation channels (e.g., ‘VV’, ‘VH’) (burst mode only). Defaults to None.
platform_serial_identifier (str, optional) – Platform serial identifier (e.g., ‘A’, ‘B’) (burst mode only). Defaults to None.
filter_text (str, optional) – Free-text search filter for PhiSat-2 INSULA products.
config_file (str, optional) – Shared credential file used for PhiSat-2 searches.
- _load_config(config_path=None)[source]
Load the configuration file.
- Parameters:
config_path (str, optional) – Path to the configuration file. Defaults to None.
- Raises:
FileNotFoundError – If the configuration file is not found.
ValueError – If the configuration file is not a valid JSON file.
- _normalize_attributes(attributes: Dict[str, str | int | float] | None) Dict[str, str | int | float] | None[source]
- _phisat2_filter_from_inputs(*, product_type: str | None, attributes: Dict[str, str | int | float] | None, filter_text: str | None) str | None[source]
- _configure_phisat2_query(*, product_type: str | None, attributes: Dict[str, str | int | float] | None, filter_text: str | None, config_file: str, burst_mode: bool, aoi_wkt: str | None, start_date: str | None, end_date: str | None) None[source]
- _validate_collection(collection_name)[source]
Validate the collection name against the available collections in the configuration.
- _get_valid_product_types(collection_name)[source]
Extracts and filters valid product types from a configuration dictionary based on the given collection name.
- _validate_product_type()[source]
Validates the provided product type against a list of valid product types. If the product type is None, the validation is skipped.
- Raises:
ValueError – If the product type is not in the list of valid product types.
TypeError – If the product type is not a string.
- _validate_order_by()[source]
Validate the ‘order_by’ parameter against valid fields and directions.
- Raises:
ValueError – If the ‘order_by’ parameter is invalid.
- _validate_top()[source]
Validate the ‘top’ parameter to ensure it is within the allowed range.
- Raises:
ValueError – If the ‘top’ parameter is not between 1 and 1000.
- _validate_skip()[source]
Validate the ‘skip’ parameter to ensure it is a non-negative integer.
- Raises:
TypeError – If the ‘skip’ parameter is not an integer.
ValueError – If the ‘skip’ parameter is negative.
- _validate_cloud_cover_threshold()[source]
Validate the ‘cloud_cover_threshold’ parameter to ensure it is between 0 and 100.
- Raises:
ValueError – If the ‘cloud_cover_threshold’ parameter is not between 0 and 100.
- _validate_orbit_direction()[source]
Validate the ‘orbit_direction’ parameter to ensure it is one of the allowed values.
- Raises:
ValueError – If the ‘orbit_direction’ parameter is not ‘ASCENDING’, ‘DESCENDING’, or None.
- _validate_aoi_wkt() None[source]
Validate and normalize the ‘aoi_wkt’ parameter as supported WKT geometry.
- Raises:
ValueError – If the ‘aoi_wkt’ parameter is malformed WKT or uses an unsupported geometry type.
TypeError – If the ‘aoi_wkt’ parameter is not a string.
- _validate_time()[source]
Validate the ‘start_date’ and ‘end_date’ parameters to ensure they are in ISO 8601 format and that the start date is earlier than the end date.
- Raises:
ValueError – If the dates are not in ISO 8601 format or if the start date is not earlier than the end date.
- _validate_attributes()[source]
Validate the ‘attributes’ parameter to ensure it is a dictionary with valid key-value pairs.
- Raises:
TypeError – If ‘attributes’ is not a dictionary, or if its keys are not strings, or if its values are not strings, integers, or floats.
- _validate_burst_parameters()[source]
Validate burst-specific parameters.
- Raises:
ValueError – If any burst parameter is invalid.
TypeError – If any burst parameter has the wrong type.
- _initialize_placeholders()[source]
Initializes placeholder attributes for the class instance.
This method sets up several attributes with default values of None to serve as placeholders. These attributes include:
filter_condition (Optional[str]): A string representing a filter condition.
query (Optional[str]): A string representing the query.
url (Optional[str]): A string representing the URL.
response (Optional[requests.Response]): A requests.Response object for HTTP responses.
json_data (Optional[dict]): A dictionary to store JSON data from the response.
df (Optional[pd.DataFrame]): A pandas DataFrame to store tabular data.
- _parent_product_date_filters() List[str][source]
Limit a parent product query to the dates in the product name.
Without a date range this query can exceed the request timeout on CDSE; with one it takes well under a second.
- execute_query()[source]
Execute the query and retrieve data.
If count=True and the total number of results exceeds the ‘top’ limit, this method will automatically paginate through all results using multiple requests with the $skip parameter, combining all results into a single DataFrame.
The returned DataFrame includes a ‘coverage’ column showing the percentage (0-100) of the AOI covered by each product’s footprint, if aoi_wkt is set and shapely is available.
- Returns:
DataFrame containing all retrieved products with coverage column.
- Return type:
pd.DataFrame
- _stac_can_answer() bool[source]
Return whether the STAC catalogue can answer the current query fully.
- _stac_collections(collection_name: str | None, product_type: str | None = None) Tuple[List[str] | None, bool][source]
Return the STAC collection ids for an OData collection name.
The second value is True when the product type is already expressed by the collection (for example SLC ->
sentinel-1-slc).
- _stac_available_collections() List[str][source]
Return (and cache) the collection ids that the STAC API serves.
- _build_stac_search(limit: int) Dict[str, Any][source]
Build the STAC search body from the current query parameters.
- _execute_stac_query() pandas.DataFrame[source]
Run the product search on the STAC API.
toplimits the result count unlesscountis True, which fetches every page. STAC has no offset parameter, soskipis applied by fetchingskip + topitems and dropping the first ones.
- _execute_paginated_query()[source]
Execute paginated queries when results exceed top limit using asyncio
- _calculate_aoi_coverage(footprint: Any) float | None[source]
Calculate the coverage percentage of AOI by a product footprint.
- Parameters:
footprint – Product footprint as GeoJSON dict, GeoJSON string, or WKT string.
- Returns:
Coverage percentage (0-100) or None if calculation fails.
- Return type:
- _add_coverage_column() None[source]
Add coverage column to the results DataFrame.
The coverage column shows the percentage (0-100) of the AOI covered by each product’s footprint. Requires shapely to be installed.
- query_by_name(product_name: str) pandas.DataFrame[source]
Query Copernicus data by a specific product name. The results (DataFrame) are stored in self.df.
- Parameters:
product_name (str) – The exact name of the product to search for.
- Returns:
- A DataFrame containing the product details.
Returns an empty DataFrame if the product is not found or an error occurs.
- Return type:
pd.DataFrame
- Raises:
ValueError – If product_name is empty or not a string.
- search_products_by_name_pattern(name_pattern: str, match_type: str, collection_name_filter: str | None = None, top: int | None = None, order_by: str | None = None) pandas.DataFrame[source]
Searches for Copernicus products by a name pattern using ‘exact’, ‘contains’, ‘startswith’, or ‘endswith’. Optionally filters by a specific collection name or uses the instance’s current collection if set. The results (DataFrame) are stored in self.df.
- Parameters:
name_pattern (str) – The pattern to search for in the product name.
match_type (str) – The type of match. Must be one of ‘exact’, ‘contains’, ‘startswith’, ‘endswith’.
collection_name_filter (str, optional) – Specific collection to filter this search by. If None, and self.collection_name (instance attribute) is set, self.collection_name will be used. If both are None, no collection filter based on collection name is applied for this specific search.
top (int, optional) – Maximum number of results. If None, uses self.top (instance default). Must be between 1 and 1000.
order_by (str, optional) – Field and direction to order results (e.g., ‘ContentDate/Start desc’). If None, uses self.order_by (instance default).
- Returns:
DataFrame with product details. Empty if no match or error.
- Return type:
pd.DataFrame
- Raises:
ValueError – If name_pattern is empty, match_type is invalid, or effective ‘top’ is out of range. Also if ‘collection_name_filter’ is provided and is invalid.
- _search_cop_dem_by_name_pattern(name_pattern: str, match_type: str, top: int, order_by: str) pandas.DataFrame[source]
STAC version of
search_products_by_name_pattern()for Copernicus DEM tiles.
- download_product(eo_product_name: str, output_dir: str, config_file='.s5cfg', mode: str = 'fast', verbose=True, show_progress=True, retry_count: int = 1, connect_timeout: float = 30.0, read_timeout: float | None = None, state_file: str | None = None, s5cmd_retry_count: int | None = None, max_workers: int | None = None, backoff_base: float = 2.0, backoff_max: float = 60.0, reset_config: bool = False)[source]
Download the EO product using the downloader module.
- Parameters:
eo_product_name – Name of the EO product to download
output_dir – Local output directory for downloaded files
config_file – Path to s5cmd configuration file
mode – Download mode (‘fast’ for s5cmd, ‘safe’ for resumable native downloads)
verbose – Whether to print download information
show_progress – Whether to show tqdm progress bar during download
retry_count – Number of command-level retry attempts
connect_timeout – Network connection timeout in seconds for native transfers
read_timeout – Network read timeout in seconds for native transfers
state_file – Optional JSON state file path for resumable runs
s5cmd_retry_count – Optional internal retry count for s5cmd
max_workers – Optional worker count for s5cmd
backoff_base – Base delay in seconds for retry backoff
backoff_max – Max delay in seconds for retry backoff
reset_config – Whether to reset configuration and prompt for credentials
- Returns:
True if download was successful, False otherwise
- Return type:
- _get_aoi_centroid(aoi_wkt: str | None = None) Tuple[float, float][source]
Calculate the centroid of the AOI.
- Parameters:
aoi_wkt – Supported AOI WKT geometry used for centroid-based orbit heuristics. Uses self.aoi_wkt if None.
- Returns:
(longitude, latitude) of the centroid.
- Return type:
- Raises:
ValueError – If AOI is not set or cannot be parsed.
- _get_recommended_orbit_direction(aoi_wkt: str | None = None) str[source]
Determine recommended orbit direction based on AOI location.
For Europe/America (longitude -180 to 60): Descending preferred For Asia/Australia (longitude 60 to 180): Ascending preferred
- Parameters:
aoi_wkt – Supported AOI WKT geometry used for centroid-based orbit heuristics. Uses self.aoi_wkt if None.
- Returns:
Recommended orbit direction (‘ASCENDING’ or ‘DESCENDING’).
- Return type:
- find_optimal_orbit(aoi_wkt: str | None = None, start_date: str | None = None, end_date: str | None = None, product_type: str = 'SLC', top: int = 100) Dict[str, Any][source]
Find the optimal orbit direction and relative orbit for maximum AOI coverage.
This method searches both ascending and descending orbits and compares coverage to find the best configuration.
- Parameters:
aoi_wkt – Area of Interest in WKT format. Uses self.aoi_wkt if None.
start_date – Start date in ISO 8601 format. Uses self.start_date if None.
end_date – End date in ISO 8601 format. Uses self.end_date if None.
product_type – Product type to search (‘SLC’, ‘GRD’, etc.). Default ‘SLC’.
top – Maximum results fetched per direction during orbit analysis.
- Returns:
ascending: dict with orbits analysis for ascending
descending: dict with orbits analysis for descending
recommended: dict with optimal orbit_direction, relative_orbit, expected_coverage
- Return type:
Dict containing
Example
>>> searcher = CopernicusDataSearcher() >>> result = searcher.find_optimal_orbit( ... aoi_wkt='POLYGON((10 45, 12 45, 12 46, 10 46, 10 45))', ... start_date='2024-08-01T00:00:00Z', ... end_date='2024-08-31T00:00:00Z' ... ) >>> print(f"Best: {result['recommended']['orbit_direction']} orbit {result['recommended']['relative_orbit']}")
- find_optimal_bursts(aoi_wkt: str | None = None, start_date: str | None = None, end_date: str | None = None, polarisation: str = 'VV', orbit_direction: str | None = None, relative_orbit_number: int | None = None, preferred_subswath: List[str] | None = None) pandas.DataFrame[source]
Find optimal bursts covering the AOI with subswath preferences.
Preferences: - IW1 preferred over IW2, IW3 preferred last (lower incident angle) - If orbit_direction not specified: Descending for EU/America, Ascending for Asia/Australia
- Parameters:
aoi_wkt – Area of Interest in WKT format. Uses self.aoi_wkt if None.
start_date – Start date in ISO 8601 format. Uses self.start_date if None.
end_date – End date in ISO 8601 format. Uses self.end_date if None.
polarisation – Polarisation channel (‘VV’, ‘VH’, ‘HH’, ‘HV’). Default ‘VV’.
orbit_direction – Orbit direction (‘ASCENDING’ or ‘DESCENDING’). Auto-detected if None.
relative_orbit_number – Specific relative orbit to filter. None for all.
preferred_subswath – List of subswaths in preference order. Default [‘IW1’, ‘IW2’, ‘IW3’].
- Returns:
Optimized burst selection sorted by preference.
- Return type:
pd.DataFrame
Example
>>> searcher = CopernicusDataSearcher() >>> bursts = searcher.find_optimal_bursts( ... aoi_wkt='POLYGON((10 45, 12 45, 12 46, 10 46, 10 45))', ... start_date='2024-08-02T00:00:00Z', ... end_date='2024-08-15T00:00:00Z', ... polarisation='VV' ... )
- compute_temporal_statistics(df: pandas.DataFrame | None = None) Dict[str, Any][source]
Compute temporal statistics for search results.
- Parameters:
df – DataFrame with search results. Uses self.df if None.
- Returns:
total_acquisitions: int
date_range: dict with start, end, span_days
temporal_gaps: dict with min_days, max_days, mean_days, median_days, std_days
acquisitions_by_month: dict
acquisitions_by_year: dict
- Return type:
Dict containing
Example
>>> searcher = CopernicusDataSearcher() >>> searcher.query_by_filter(...) >>> searcher.execute_query() >>> stats = searcher.compute_temporal_statistics() >>> print(f"Mean revisit: {stats['temporal_gaps']['mean_days']:.1f} days")
- plot_temporal_distribution(df: pandas.DataFrame | None = None, output_path: str | None = None, show: bool = True, figsize: Tuple[int, int] = (14, 10)) str | None[source]
Create and save a plot of temporal distribution of acquisitions.
The plot includes: - Acquisition timeline scatter plot - Gap distribution histogram - Monthly acquisition counts - Cumulative acquisitions over time
- Parameters:
df – DataFrame with search results. Uses self.df if None.
output_path – Path to save the plot. Auto-generated if None.
show – Whether to display the plot interactively.
figsize – Figure size as (width, height) tuple.
- Returns:
Path to the saved plot file, or None if not saved.
- Return type:
- Raises:
ImportError – If matplotlib is not installed.
Example
>>> searcher = CopernicusDataSearcher() >>> searcher.query_by_filter(...) >>> searcher.execute_query() >>> searcher.plot_temporal_distribution(output_path='./temporal_plot.png')
- download_bursts(df: pandas.DataFrame | None = None, output_dir: str = '.', username: str | None = None, password: str | None = None, retry_count: int = 3, verbose: bool = True, connect_timeout: float = REQUEST_TIMEOUT_SECONDS, read_timeout: float | None = None, state_file: str | None = None, resume_mode: str = 'off', backoff_base: float = 2.0, backoff_max: float = 60.0) Dict[str, Any][source]
Download burst products from a DataFrame.
This method handles CDSE authentication and downloads burst products via the on-demand processing API.
- Parameters:
df – DataFrame with burst products to download. Uses self.df if None.
output_dir – Directory to save downloaded bursts.
username – CDSE username. Required for burst downloads.
password – CDSE password. Required for burst downloads.
retry_count – Number of retry attempts for failed downloads.
verbose – Whether to print progress information.
connect_timeout – HTTP connection timeout in seconds.
read_timeout – HTTP read timeout in seconds (None => same as connect timeout).
state_file – Optional JSON state file path for resumable runs.
resume_mode – Resume mode (‘off’ or ‘product’).
backoff_base – Base delay in seconds for retry backoff.
backoff_max – Max delay in seconds for retry backoff.
- Returns:
downloaded: int count of successful downloads
failed: int count of failed downloads
details: list of dicts with download status per product
- Return type:
Dict containing
Example
>>> searcher = CopernicusDataSearcher() >>> searcher.query_by_filter(burst_mode=True, ...) >>> df = searcher.execute_query() >>> result = searcher.download_bursts( ... df=df, ... output_dir='./bursts', ... username='your_cdse_username', ... password='your_cdse_password' ... )
- download_products(df: pandas.DataFrame | None = None, output_dir: str = '.', config_file: str = '.s5cfg', mode: str = 'fast', retry_count: int = 3, validate: bool = True, verbose: bool = True, show_progress: bool = True, state_file: str | None = None, resume_mode: str | None = None, s5cmd_retry_count: int | None = None, max_workers: int | None = None, backoff_base: float = 2.0, backoff_max: float = 60.0) Dict[str, Any][source]
Download multiple SLC/GRD products from a DataFrame.
This method downloads products via S3 using s5cmd with retry logic and optional validation.
- Parameters:
df – DataFrame with products to download. Uses self.df if None.
output_dir – Directory to save downloaded products.
config_file – Path to s5cmd configuration file.
mode – Download mode (‘fast’ for s5cmd, ‘safe’ for resumable native downloads).
retry_count – Number of retry attempts for failed downloads.
validate – Whether to validate downloaded files (see
is_product_complete).verbose – Whether to print progress information.
show_progress – Whether to show tqdm progress bar.
state_file – Optional JSON state file path for resumable runs.
resume_mode – Deprecated legacy resume selector. Prefer
mode.s5cmd_retry_count – Optional internal retry count for s5cmd.
max_workers – Optional worker count for s5cmd.
backoff_base – Base delay in seconds for retry backoff.
backoff_max – Max delay in seconds for retry backoff.
- Returns:
downloaded: int count of successful downloads
failed: int count of failed downloads
details: list of dicts with download status per product
- Return type:
Dict containing
Example
>>> searcher = CopernicusDataSearcher() >>> searcher.query_by_filter(collection_name='SENTINEL-1', product_type='SLC', ...) >>> df = searcher.execute_query() >>> result = searcher.download_products(df=df, output_dir='./data')