Skip to main content

DOI

Description

ASARapi is a simple Python command-line program that allows you to search the ESA Online Catalogue for SAR images produced by the ERS-1 (1991-2000), ERS-2 (1995-2011), or Envisat (2002-2012) satellites and to download them.

The following collections are supported:

  • ASA_IMP_1P: Level 1 products for ENVISAT ASAR Image Mode Precision Image.
  • ASA_IMS_1P: Level 1 products for ENVISAT ASAR Image Mode Single-Look Complex.
  • SAR_IMP_1P: Level 1 products for ERS SAR Precision Image.
  • SAR_IMS_1P: Level 1 products for ERS SAR Single-Look Complex.

Installation

ASARapi can be installed using pip.

pip install asarapi

Usage

Sync database

ASARapi is designed to work with a local SQLite dump of the ESA Online Catalogue in order to speed up spatial queries. Therefore, the database must be downloaded before using the program by running the sync subcommand.

asarapi sync

The file will be stored in your user data directory, e.g. ~/.local/share/asarapi on Linux, /Users/<user>/Library/Application Support/asarapi on OSX, or C:\Users\<user>\AppData\Local\asarapi on Windows.

Please see yannforget/esa-online-catalogue for further details regarding the scraping of the ESA Online Catalogue.

Search the catalog

Usage

Usage: asarapi search [OPTIONS]

  Search for ERS and Envisat products.

Options:
  --geojson PATH                  GeoJSON footprint.
  --start TEXT                    Start date (YYYY-MM-DD).
  --stop TEXT                     Stop date (YYYY-MM-DD).
  --latlon FLOAT...               Decimal lat/lon.
  --bounds FLOAT...               (max_lat, max_lon, min_lat, min_lon).
  --platform TEXT                 Platform of interest (ERS or ENVISAT, default = all)
  --product TEXT                  Product type (Precision (default) or Single-Look).
  --polarisation TEXT             Polarisation channels (default = all).
  --orbit [ascending|descending]  Orbit direction (default = all).
  --contains                      Footprint contained by input geom (default = False).
  --limit INTEGER                 Max. number of results (default = 500).
  --output PATH                   Output CSV file.
  --help                          Show this message and exit.

By default, asarapi search will output the product IDs that satisfy the query. A CSV file containing the metadata and the footprint of each scene can be generated with the --output option.

Examples

# All available products between 1995 and 1999 according to an area of interest
# defined in a GeoJSON file.
asarapi search --start 1995-01-01 --stop 1999-12-31 --geojson aoi.geojson

# All available products between 1995 and 1999 that intersect the given location
asarapi search --start 1995-01-01 --stop 1999-12-31 --latlon 16.27 -0.04

# Envisat Single-Look Complex images for a given AOI
asarapi search --start 2002-01-01 --stop 2005-01-01 --geojson aoi.geojson \
        --platform envisat --product single-look --orbit descending

# Write the result of a query in a .CSV file
asarapi search --start 1995-01-01 --stop 1999-12-31 --geojson aoi.geojson \
        --output products.csv

Download a product

Usage

To download products, you will need ESA SSO credentials. Register for free here.

Usage: asarapi download [OPTIONS] PRODUCT

  Download an ERS or Envisat product.

Options:
  -u, --username TEXT   ESA SSO username.
  -p, --password TEXT   ESA SSO password.
  -o, --outputdir PATH  Output directory.
  --help                Show this message and exit.

Example

asarapi download -u <esa_sso_username> -p <esa_sso_password> \
        "SAR_IMP_1PNESA20030215_091621_00000015A081_00465_40900_0000"

API

ASARapi can also be used in custom Python scripts:

from datetime import datetime
from shapely.geometry import Point
from asarapi.catalog import query
from asarapi.download import log_in, log_out, request_download

username = esa_sso_username
password = esa_sso_password
output_dir = '../data'
location = Point(16.84, -0.04)

results = query(
    area=location.wkt,
    start=datetime(1999, 1, 1),
    stop=datetime(2002, 1, 1),
    orbit='ascending'
)

session = log_in(username, password)
for product_id in results.index:
    request_download(session, product_id, output_dir)
log_out(session)

Metadata

Release files for asarapi 0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asarapi 0.6
File Size Uploaded
asarapi-0.6.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for asarapi 0.6
File Interpreter ABI Platform
asarapi-0.6-py3-none-any.whl Python 3 none any Details

Total release size: 31.6 kB

Release files / asarapi-0.6.tar.gz

Download URL asarapi-0.6.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ad3190cbed949dfec4df0f2974789a071ad2dd1b5c5e6b6d349d4c3b8a120a00
BLAKE2b-256 checksum
How to use checksums
a454064a216afc556fabcedd1573b99c68540a0bf67f5084612330597b49bfbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.21.0 CPython/2.7.13

Release files / asarapi-0.6-py3-none-any.whl

Download URL asarapi-0.6-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52a38267e4eecace16b7b74d031c0ecbe249de8fd6dfe67289d6867b80e0641f
BLAKE2b-256 checksum
How to use checksums
93cd0310de7d54f5180f5f1c89cbe78a63d6b681bf332564e96b4ff0b18b6fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.21.0 CPython/2.7.13

Release history Release notifications | RSS feed

This release

0.6 This release

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page