Package: asarapi
DescriptionASARapiis a simple Python command-line program that allows you to search theESA Online Cataloguefor SAR images produced by theERS-1(1991-2000),ERS-2(1995-2011), orEnvisat(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.InstallationASARapican be installed usingpip.pipinstallasarapiUsageSync databaseASARapiis 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 thesyncsubcommand.asarapisyncThe file will be stored in your user data directory, e.g.~/.local/share/asarapion Linux,/Users/<user>/Library/Application Support/asarapion OSX, orC:\Users\<user>\AppData\Local\asarapion Windows.Please seeyannforget/esa-online-cataloguefor further details regarding the scraping of the ESA Online Catalogue.Search the catalogUsageUsage: 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 searchwill 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--outputoption.Examples# All available products between 1995 and 1999 according to an area of interest# defined in a GeoJSON file.asarapisearch--start1995-01-01--stop1999-12-31--geojsonaoi.geojson# All available products between 1995 and 1999 that intersect the given locationasarapisearch--start1995-01-01--stop1999-12-31--latlon16.27-0.04# Envisat Single-Look Complex images for a given AOIasarapisearch--start2002-01-01--stop2005-01-01--geojsonaoi.geojson\--platformenvisat--productsingle-look--orbitdescending# Write the result of a query in a .CSV fileasarapisearch--start1995-01-01--stop1999-12-31--geojsonaoi.geojson\--outputproducts.csvDownload a productUsageTo download products, you will needESA SSOcredentials. Register for freehere.Usage:asarapidownload[OPTIONS]PRODUCTDownloadanERSorEnvisatproduct.

Options:-u,--usernameTEXTESASSOusername.-p,--passwordTEXTESASSOpassword.-o,--outputdirPATHOutputdirectory.--helpShowthismessageandexit.Exampleasarapidownload-u<esa_sso_username>-p<esa_sso_password>\"SAR_IMP_1PNESA20030215_091621_00000015A081_00465_40900_0000"APIASARapican also be used in custom Python scripts:fromdatetimeimportdatetimefromshapely.geometryimportPointfromasarapi.catalogimportqueryfromasarapi.downloadimportlog_in,log_out,request_downloadusername=esa_sso_usernamepassword=esa_sso_passwordoutput_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)forproduct_idinresults.index:request_download(session,product_id,output_dir)log_out(session)