Package: earth-extractor
Earth ExtractorEarth Extractor simplifies the workflow of data acquisition from multiple
satellite data providers. The library is designed to be used as a command line
tool, but can also be used as a library.Unlike other projects, Earth Extractor is designed to simplify the data
acquisition process for a select amount of satellite providers and is
deliberately written to provide a hands-off approach for simple data
collection. This is dissimilar to projects
such asEODagandgetSpatialDatawhich aim to
harmonise the process over many providers and satellite types.The library creates a framework around providers and satellites, allowing
a satellite to have separate providers for querying and downloading. This
provides the benefit of searching with an API allowing more comprehensive
filters than those that are available in the download provider. For example,
the Copernicus Open Access Hub allows cloud coverage filters, but the data is
better served by the Alaskan Satellite Facility which does not offer such
filters.ChangelogSemantic version changes are tracked in theCHANGELOG.Getting startedInstallationInstall from PyPIIn your local environment, install the package with:pipinstallearth-extractorThe package repository can be found atPyPI: earth-extractor.Install from git (development)If poetry is not installed locally, install it first with:pipinstallpoetryThen clone the repository and install the package dependencies with:gitclonehttps://github.com/eceo-epfl/earth-extractorcdearth-extractor
poetryinstallDefine user credentialsThere are two methods to store the provider secrets required to access the
data:System keyring (recommended).env fileOption 1: System keyring (recommended)This method requires that your operating system has a secret keyring installed.
This is usually the case, but if you're operating a server linux installation,
or using WSL on Windows, for example, one may not exist. In this case, you can
use the.envfile method.User credentials are managed by thekeyringlibrary which make use of your
operating system's secret keyring. The credentials are stored in the system
and are retrieved by the library when required.In order to define them, use the following command:earth-extractorcredentials--setOption 2: .env fileIn the folder you are working in, place an .env file with the keys and values
as follows (the necessary keys can be found in thecredential sourcessection underneath):COPERNICUS_USERNAME=COPERNICUS_PASSWORD=NASA_TOKEN=Credential sourcesCredentials can be obtained from the respective providers:Copernicus Data SpaceCOPERNICUS_USERNAMEandCOPERNICUS_PASSWORDAlaskan Satellite FacilityandNASA LAADS repositoryNASA_TOKENObtain the token by registering first atNASA EarthData, and then inMy Profile, selectGenerate Tokenfrom the top menu andGENERATE TOKENfrom the bottom of the page.Make sure to accept the Alaskan Satellite Facility EULA after registering
inNASA Earth Data: Accept New EULAsExample usage (CLI)Sentinel 1Search forSentinel-1 L1data for Switzerland between the dates2022-11-19and2022-11-29.earth-extractorbatch\--roi45.81,5.95,47.81,10.5\--start2022-11-19--end2022-11-29\--satelliteSENTINEL1:L1SwissImageSearch and downloadSwissImage0.1mand2.0mresolution data for a200 metrebuffered region around longitude:7.35999°and latitude:46.22457°between the dates2022-11-19and2022-11-29.Note: In this example the download will start without user intervention, by
using the--no-confirmationflag. We can also see the first use of multiple
satellites in the same query (although SwissImage is not technically a
"satellite" product).earth-extractorbatch\--start2020-10-06--end2023-01-01\--roi7.35999,46.22457--buffer200\--satelliteswissimage:cm200\--satelliteswissimage:cm10\--no-confirmationMODIS and VIIRSSearch for VIIRS (L1) and MODIS Terra (L1B) data with a2kmbuffered region
around longitude:7.35999°and latitude:46.22457°between the dates2022-10-06and2023-01-01.earth-extractorbatch\--start2022-10-06--end2022-10-07\--roi7.35999,46.22457--buffer2000\--satelliteVIIRS:L1\--satelliteMODIS_TERRA:L1B\--no-confirmationTechnical specificationsComponentsSatellites and providersThe following satellites and respective processing levels are
included in the design:SatelliteLevelsSearch providerDownload providerSentinel-11 (GRD)Copernicus Data SpaceAlaskan Satellite Facility2 (GRD_SIGMA0)Copernicus Data SpaceCopernicus Data SpaceSentinel-21CCopernicus Data SpaceCopernicus Data Space2ACopernicus Data SpaceCopernicus Data SpaceSentinel-31BCopernicus Data SpaceCopernicus Data Space2Copernicus Data SpaceCopernicus Data Space3 LFR Atmos (Land)Copernicus Data SpaceCopernicus Data Space3 WFR Atmos (Water)Copernicus Data SpaceCopernicus Data SpaceMODIS Terra1BNASA Common Metadata RepositoryNASA LAADSMODIS Aqua1BNASA Common Metadata RepositoryNASA LAADSVIIRS1NASA Common Metadata RepositoryNASA LAADS