Because using satellite data shouldn't require rocket science, neither in code nor in hardware.
Project description
AgriGEE.lite
AgriGEE.lite is an Earth Engine wrapper that allows easy download of Analysis Ready Multimodal Data (ARD), focused on downloading time series of agricultural and native vegetation data.
For example, to download and view a time series of cloud-free Sentinel 2 imagery cropped to a specific field and date range, only a few lines of code are required. Here’s an example:
import agrigee_lite as agl
import ee
ee.Initialize()
gdf = gpd.read_parquet("data/sample.parquet")
row = gdf.iloc[0]
satellite = agl.sat.Sentinel2(bands=["red", "green", "blue"])
agl.vis.images(row.geometry, row.start_date, row.end_date, satellite)
Through this example, it is already possible to understand the basic functioning of the lib. The entire lib was designed to be used in conjunction with GeoPandas, and a basic knowledge of it is necessary.
You can also download aggregations, such as spatial median aggregations of indices. Here's an example with median from multiple satellites:
For more examples, see the examples folder.
Finally, the library features multithreaded downloading, which allows downloading on average 16-22 time series per second (assuming 1-year series, cloud-free for Sentinel 2 Surface Reflectance).
The lib has 3 types of elements, which are divided into modules:
-
agl.sat = Data sources, usually coming from satellites/sensors. When defining a sensor, it is possible to choose which bands you want to view/download, or whether you want to use atmospheric corrections or not. By default, all bands are downloaded, and all atmospheric corrections and harmonizations are used.
-
agl.vis = Module that allows you to view data, either through time series or images.
-
agl.get = Module that allows you to download data on a large scale.
Available data sources (satellites, sensors, models and so on)
| Name | Bands | Start Date | End Date | Regionality | Pixel Size | Revisit Time | Variations |
|---|---|---|---|---|---|---|---|
| Sentinel 2 | Blue, Green, Red, Re1, Re2, Re3, Nir, Re4, Swir1, Swir2 | 2016-01-01 | Worldwide | 10 -- 60 | 5 days (with clouds), 8 days (wo) | Surface Reflectance, Top of Atmosphere | |
| Landsat 5 | Blue, Green, Red, Nir, Swir1, Swir2 | Worldwide | 15 -- 30 | 16 days | Surface Reflectance, Top of Atmosphere; Tier 1 and Tier 2; | ||
| Landsat 7 | Blue, Green, Red, Nir, Swir1, Swir2 | Worldwide* | 15 -- 30 | 16 days | Surface Reflectance, Top of Atmosphere; Tier 1 and Tier 2; | ||
| Landsat 8 | Blue, Green, Red, Nir, Swir1, Swir2 | Worldwide | 15 -- 30 | 16 days | Surface Reflectance, Top of Atmosphere; Tier 1 and Tier 2; | ||
| Landsat 9 | Blue, Green, Red, Nir, Swir1, Swir2 | Worldwide | 15 -- 30 | 16 days | Surface Reflectance, Top of Atmosphere; Tier 1 and Tier 2; | ||
| MODIS Terra/Acqua | Red, Nir | Worldwide | 15 -- 30 | daily (with clouds) | |||
| Sentinel 1 | VV, VH | Worldwide* | 10** | 5 days**** | GRD, ARD*** | ||
| Mapbiomas Brazil | 37 Land Usage Land Cover Classes | 1985-01-01 | 2023-12-31 | Brazil | 30 | 1 year |
Motivations: what an average data scientist - me - thought when I started learning GEE
My journey with GEE started two and a half years ago. GEE is excellent, it allows you to use several different satellite data, but it is very complex to code. In addition to using A LOT of boilerplate code, the errors are extremely confusing, since the tool is executed server-side, most likely with a pure functional language (like Haskell). During my master's degree, I struggled a lot writing codes for GEE. Furthermore, harmonizing all satellites at the same time is difficult. Typically, each satellite has a different range of values and cloud masks. Tired of having to rewrite similar codes, I decided to create a lib with a simple goal: using satellite data should be as simple as reading a CSV in Pandas, and you shouldn't need to be a Remote Sensing expert to achieve it.
Objectives and target audience
The main objective of the lib is to be a simple, direct and high-performance way to download satellite data, both for academic and commercial use. Did you like it? Give it a star. Want to contribute? Open your Pull Request, I will be happy to include it.
Questions possibly asked
But isn't it just a case of using STAC? Why pay Google?
This is a tempting proposition, and it actually makes sense for large scale projects. However, processing satellite data locally can easily escalate to hell, especially for countries with huge agricultural areas like Australia, the United States or Brazil. So, you have to do the math to figure out whether it is cheaper or not to use GEE than to have your own processing infrastructure than STAC. However, GEE is completely free for students and non-commercial projects.
"Hello, I am a Remote Sensing expert, and I believe that the term satellite is not the most appropriate, radars do not have bands and.... "
Yes, I was told that. The use of the term "satellite" instead of sensor, data source or something else is intended to simplify things, even though it is not the most correct term. Note that even Mapbiomas, a WONDERFUL project that is made using models and AMAZING PEOPLE (❤️) is called a satellite, and is treated exactly the same as Sentinel 2 or any Landsat. The same goes for the idea of "bands" in a radar like Sentinel 1. The more standardized it is, the easier it is to keep the library code working. However, note that your help to the project is VERY WELCOME.
The library mascot is cute! Did you make it?
Absolutely not, I'm terrible at drawings and anything. I made it using GPT4, and all the rights belong to God knows who. The base art is from the Odd-Eyes Venom Dragon card from the Yu-Gi-Oh card game. The inspiration has nothing to do with venom, but rather because it is a plant dragon (agriculture), it is a fusion card (multimodal data) and it has odd-eyes (like satellites, seeing the world through different eyes). If you're a cartoonist and want to design a new mascot, I'd be more than happy to make it official.
TO-DO
- Add Sentinel 2 as a satellite;
- Add Landsats 5, 7, 8, 9 as a satellite;
- Add Sentinel 1 GRD as a satellite;
- Add Mapbiomas Brazil as a satellite (data source);
- Add MODIS Terra/Acqua;
- Add Satellite Image Time Series Aggregations online download;
- Add Satellite Image Time Series Aggregations task download;
- Add Images online download/visualization with matplotlib;
- Add single/multiple SITS visualization
- Add Images online visualization with plotly;
- Add smart_open[gcs] for autorecovery SITS from GCS;
- Make cloud mask removable;
- Add all other Mapbiomas;
- Add Sentinel 1 ARD;
- Add Sentinel 3;
- Add ALOS-2 PALSAR-2 radar;
- Add jurassic Landsats (1-4);
- Add Landsat Pansharpening for image download;
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agrigee_lite-1.0.4.tar.gz.
File metadata
- Download URL: agrigee_lite-1.0.4.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f9e04d5c0a1e5873555784a495b3983d78502be603e1c153bea09b8b130227b
|
|
| MD5 |
0a72dd44f349cb687c84a5f37dc3e663
|
|
| BLAKE2b-256 |
26f434b541f52fa8334367242b88b229475085dc8599a24aa1a7ec75509a84fb
|
File details
Details for the file agrigee_lite-1.0.4-py3-none-any.whl.
File metadata
- Download URL: agrigee_lite-1.0.4-py3-none-any.whl
- Upload date:
- Size: 44.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
309cfb393917da73f770478d740424d3f071eb09e512e371b44ba659439da38b
|
|
| MD5 |
61b95d1096879211caaf9c09dfed8628
|
|
| BLAKE2b-256 |
fdbff2cec7f934810c3faf8d0cdcb2cee44e975f60274b31ecb519e9270cd576
|