Download notebook

Download and read Swot from AVISO

This notebook demonstrates how to browse and download SWOT LR data available on AVISO using the Altimetry Downloader Aviso tool.

Tutorial Objectives

  • Explore products from AVISO using the altimetry_downloader_aviso

  • Download a product using the altimetry_downloader_aviso

  • Subset L3 Usnmoothed product using the altimetry_downloader_aviso

  • Open data using altimetry.io

Note

Required environment to run this notebook:

  • altimetry_downloader_aviso: see documentation.

  • altimetry.io: available here.

  • xarray

Import + code

import logging
logging.basicConfig(level=logging.INFO)
from pathlib import Path
import altimetry_downloader_aviso as dl_aviso

Parameters

Define an output folder to save results

output_dir= Path.home() / "TMP_DATA"

Discover Aviso’s products

Use the summary and details commands to discover Aviso’s catalog products.

cat = dl_aviso.summary()
INFO:altimetry_downloader_aviso.catalog_client.client:Fetching products from Aviso's catalog...
for product in cat.products:
    print(f"{product.short_name} -> {product.title}")
SWOT_L2_LR_SSH_Basic -> Altimetry product SWOT Level-2 KaRIn Low Rate SSH - Basic
SWOT_L3_LR_SSH_Basic -> Altimetry product SWOT Level-3 Low Rate SSH - Basic
SWOT_L2_LR_SSH_Unsmoothed -> Altimetry product SWOT Level-2 KaRIn Low Rate SSH - Unsmoothed
L4_with_SWOT -> Experimental Product: Multimission Gridded (with SWOT, MIOST only) Level-4 Sea Surface Heights and Velocities
SWOT_L3_LR_SSH_Technical -> Altimetry product SWOT Level-3 Low Rate SSH - Technical
SWOT_L2_LR_SSH_WindWave -> Altimetry product SWOT Level-2 KaRIn Low Rate SSH - WindWave
SWOT_L3_LR_WIND_WAVE_Extended -> Wind & Wave product SWOT Level-3 WindWave - Extended
SWOT_L3_LR_SSH_Unsmoothed -> Altimetry product SWOT Level-3 Low Rate SSH - Unsmoothed
SWOT_L2_LR_SSH_Expert -> Altimetry product SWOT Level-2 KaRIn Low Rate SSH - Expert
SWOT_L3_LR_WIND_WAVE_Light -> Wind & Wave product SWOT Level-3 WindWave - Light
SWOT_L3_LR_SSH_Expert -> Altimetry product SWOT Level-3 Low Rate SSH - Expert
product = dl_aviso.details('SWOT_L3_LR_SSH_Unsmoothed')
product.last_version
'v3.0'

Download a product

The first time you download a product using the Altimetry Downloader Aviso, credentials will be asked for Aviso authentication. They will be stored in a ~/.netrc file.

List filter values

List the relevant filter values of the get function with filter_infos:

product = dl_aviso.get_product_from_short_name("SWOT_L3_LR_SSH_Basic")
temporal_coverage, half_orbit_range, versions = dl_aviso.filter_infos(product)
temporal_coverage
{'CALVAL': [2023-03-28T23:44:17.000000, 2023-07-10T09:12:05.000000],
 'SCIENCE': [2023-07-26T12:27:56.000000, 2026-09-15T20:38:36.000000]}
half_orbit_range
{'CALVAL': ((474, 3), (578, 4)), 'SCIENCE': ((1, 149), (56, 142))}
versions
{'2.0.1', '3.0'}

Download

Use get function to download half-orbit files.

dl_aviso.get(
    'SWOT_L2_LR_SSH_Basic', 
    cycle_number=37, 
    pass_number=2,
    version='PID0',
    output_dir=output_dir
)
['/home/atonneau/TMP_DATA/SWOT_L2_LR_SSH_Basic_037_002_20250810T092805_20250810T101933_PID0_01.nc']

To download several cycles and/or half-orbits:

dl_aviso.get(
    'SWOT_L3_LR_SSH_Basic', 
    cycle_number=[40, 41], 
    pass_number=list(range(10, 16)),
    output_dir=output_dir, 
    overwrite=True
)
About to download 12 file(s), estimated total size: 44.6 MB
['/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_040_010_20251012T063453_20251012T072620_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_040_011_20251012T072620_20251012T081747_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_040_012_20251012T081747_20251012T090913_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_040_013_20251012T090914_20251012T100040_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_040_014_20251012T100041_20251012T105207_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_040_015_20251012T105207_20251012T114334_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_041_010_20251102T031959_20251102T041126_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_041_011_20251102T041126_20251102T050253_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_041_012_20251102T050253_20251102T055419_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_041_013_20251102T055420_20251102T064546_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_041_014_20251102T064547_20251102T073713_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Basic_041_015_20251102T073714_20251102T082840_v3.0.nc']

Subset a product

Use subset function to download subsets of a product using filters.

Note

Use show_progress=True on get or subset functions to display a download progress bar

local_files = dl_aviso.subset(
    "SWOT_L3_LR_SSH_Unsmoothed",
    box=(-10, 10, 10, 40),
    selected_variables=["ssha_unfiltered", "time"],
    cycle_number=10,
    pass_number=[223, 238, 251],
    version="3.0",
    output_dir=output_dir,
    overwrite=True
)
INFO:altimetry_downloader_aviso.catalog_client.client:Fetching products from Aviso's catalog...
INFO:altimetry_downloader_aviso.catalog_client.granule_discoverer:Filtering SWOT_L3_LR_SSH_Unsmoothed product with filters {'cycle_number': [10], 'pass_number': [223, 238, 251], 'version': '3.0'}...
INFO:altimetry_downloader_aviso.core:Subsetting 3 file(s)...
local_files
['/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Unsmoothed_010_223_20240201T224047_20240201T233213_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Unsmoothed_010_238_20240202T113229_20240202T122356_v3.0.nc',
 '/home/atonneau/TMP_DATA/SWOT_L3_LR_SSH_Unsmoothed_010_251_20240202T224118_20240202T233244_v3.0.nc']

Open data using altimetry.io

from altimetry.io import AltimetryData, FileCollectionSource

Open data source

alti_data = AltimetryData(
    source=FileCollectionSource(
        path=output_dir,
        ftype="SWOT_L3_LR_SSH",
        subset="Unsmoothed",
    ),
)

Query data

ds = alti_data.query_orbit(
    cycle_number=10,
    pass_number=[223, 238, 251]
)
ds
INFO:fcollections.core._filesdb:Picked subset {'version': '3.0', 'subset': <ProductSubset.Unsmoothed: 4>}
INFO:fcollections.core._readers:Files to read: 3
<xarray.Dataset>
Dimensions:          (num_lines: 24867, num_pixels: 519)
Coordinates:
    time             (num_lines) datetime64[ns] dask.array<chunksize=(7882,), meta=np.ndarray>
    latitude         (num_lines, num_pixels) float64 dask.array<chunksize=(7882, 519), meta=np.ndarray>
    longitude        (num_lines, num_pixels) float64 dask.array<chunksize=(7882, 519), meta=np.ndarray>
Dimensions without coordinates: num_lines, num_pixels
Data variables:
    ssha_unfiltered  (num_lines, num_pixels) float64 dask.array<chunksize=(7882, 519), meta=np.ndarray>
    cycle_number     (num_lines) uint8 10 10 10 10 10 10 ... 10 10 10 10 10 10
    pass_number      (num_lines) uint8 223 223 223 223 223 ... 251 251 251 251
Attributes: (12/43)
    Conventions:                     CF-1.9
    Metadata_Conventions:            Unidata Dataset Discovery v1.0
    cdm_data_type:                   Swath
    comment:                         Sea Surface Height measured by Altimetry
    geospatial_lat_units:            degrees_north
    geospatial_lon_units:            degrees_east
    ...                              ...
    geospatial_lon_max:              359.999999
    date_modified:                   2026-08-13T20:12:18Z
    history:                         2026-08-13T20:12:18Z: Created by DUACS K...
    date_created:                    2026-08-13T20:12:18Z
    date_issued:                     2026-08-13T20:12:18Z
    temporality:                     reproc

Download notebook