bluemath_tk.downloaders.aviso package

Submodules

bluemath_tk.downloaders.aviso.aviso_downloader module

class bluemath_tk.downloaders.aviso.aviso_downloader.AvisoDownloader(product: str, base_path_to_download: str, username: str, password: str, debug: bool = True)[source]

Bases: BaseDownloader

Simple downloader for AVISO data.

Downloads all available files from the FTP base path specified in the config.

Examples

>>> downloader = AvisoDownloader(
...     product="SWOT",
...     base_path_to_download="./swot_data",
...     username="your_username",
...     password="your_password"
... )
>>> result = downloader.download_data(
...     dataset="swot-l3-expert",
...     cycles=["cycle_001"],
...     force=False,
...     dry_run=False
... )
property client: FTP

FTP client connection (initialized and logged in).

Returns:

FTP client instance.

Return type:

ftplib.FTP

download_data(dry_run: bool = True, *args, **kwargs) DownloadResult[source]

Download data for the product.

Routes to product-specific download methods based on the product type.

Parameters:
  • dry_run (bool, optional) – If True, only check what would be downloaded without actually downloading. Default is True.

  • *args – Arguments passed to product-specific download method.

  • **kwargs – Keyword arguments passed to product-specific download method.

Returns:

Result with information about downloaded, skipped, and error files.

Return type:

DownloadResult

Raises:

ValueError – If the product is not supported.

download_data_swot(dataset: str, cycles: List[str] | None = None, force: bool = False, dry_run: bool = True) DownloadResult[source]

Download SWOT data for a specific dataset.

Downloads all .nc files from specified cycles. Files are saved to: base_path_to_download/dataset/cycle/filename.nc

Parameters:
  • dataset (str) – The dataset to download (e.g., “swot-l3-expert”). Use list_datasets() to see available datasets.

  • cycles (List[str], optional) – List of cycle folder names to download (e.g., [“cycle_001”, “cycle_002”]). If None, uses cycles from dataset configuration. Default is None.

  • force (bool, optional) – Force re-download even if file exists. Default is False.

  • dry_run (bool, optional) – If True, only check what would be downloaded. Default is True.

Returns:

Result with all downloaded files and download statistics.

Return type:

DownloadResult

Raises:

ValueError – If dataset is not found or no cycles are available.

property product_config: dict

Product configuration dictionary loaded from config file.

Returns:

Product configuration dictionary.

Return type:

dict

products_configs = {'SWOT': {'datasets': {'swot-l2-expert': {'cycles': ['cycle_001', 'cycle_002', 'cycle_003', 'cycle_004', 'cycle_005', 'cycle_006', 'cycle_007', 'cycle_008', 'cycle_009'], 'description': 'SWOT L2 Expert Product', 'ftp_base_path': '/swot_products/l2_karin/l2_lr_ssh/PGC0/Expert/', 'url': 'https://tds-odatis.aviso.altimetry.fr/thredds/catalog/dataset-l2-swot-karin-lr-ssh-validated/PGC0/Expert/catalog.html'}, 'swot-l3-expert': {'cycles': ['cycle_001', 'cycle_002', 'cycle_003', 'cycle_004', 'cycle_005', 'cycle_006', 'cycle_007', 'cycle_008', 'cycle_009'], 'description': 'SWOT L3 Expert Product', 'ftp_base_path': '/swot_products/l3_karin_nadir/l3_lr_ssh/v1_0/Expert/', 'url': 'https://tds-odatis.aviso.altimetry.fr/thredds/catalog/dataset-l3-swot-karin-nadir-validated/l3_lr_ssh/v1_0/Expert/catalog.html'}}, 'ftp_server': 'ftp-access.aviso.altimetry.fr'}}

Module contents