Modules
ee_quick_start()
¶
Quick start function to initialize Earth Engine with automatic credential detection.
Automatically detects and uses Earth Engine credentials from the GEE_KEY environment variable. Supports both service account JSON files and project tokens, providing informative feedback about the initialization process.
Environment Variables
GEE_KEY : str Earth Engine authentication key. Can be either: - Path to service account JSON file (ends with .json) - Project token string for standard authentication
Returns:
| Type | Description |
|---|---|
None
|
Prints initialization status messages but doesn't return values. |
Examples:
>>> import os
>>> os.environ['GEE_KEY'] = '/path/to/service-account.json'
>>> ee_quick_start()
Earth Engine initialized successfully using AgriGEE.lite...
Notes
For service account authentication, the function also sets the GOOGLE_APPLICATION_CREDENTIALS environment variable for use Google Cloud Storage.
Source code in agrigee_lite/ee_utils.py
651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 | |
get_all_tasks()
¶
Retrieve status information for all Earth Engine tasks.
Fetches comprehensive information about all Earth Engine operations/tasks associated with the authenticated account, including metadata, timing, resource usage, and cost estimates.
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame containing task information with the following columns: - attempt: Task attempt number - create_time: Task creation timestamp - description: Task description/name - destination_uris: Output destination URIs - done: Boolean indicating completion status - end_time: Task completion timestamp - name: Internal task name - priority: Task priority level - progress: Completion progress (0.0 to 1.0) - script_uri: Source script URI - start_time: Task start timestamp - state: Current task state (RUNNING, COMPLETED, FAILED, etc.) - total_batch_eecu_usage_seconds: Total EECU usage in seconds - type: Task type (EXPORT_IMAGE, EXPORT_TABLE, etc.) - update_time: Last update timestamp - estimated_cost_usd_tier_1: Estimated cost in US Dollars for Tier 1 pricing - estimated_cost_usd_tier_2: Estimated cost in US Dollars for Tier 2 pricing - estimated_cost_usd_tier_3: Estimated cost in US Dollars for Tier 3 pricing |
Notes
Cost estimates are based on EECU usage and standard pricing tiers. If no tasks exist, returns an empty DataFrame with the same column structure.
Source code in agrigee_lite/ee_utils.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | |
quadtree_clustering(gdf, max_size=1000)
¶
Cluster geometries in a GeoDataFrame using a quadtree and simplify clusters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdf
|
GeoDataFrame
|
GeoDataFrame containing geometries (Polygon, MultiPolygon, or Point). |
required |
max_size
|
int
|
Maximum number of geometries per cluster (default is 1000). |
1000
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with cluster labels and simplified geometries. |
Source code in agrigee_lite/misc.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
random_points_from_gdf(gdf, num_points_per_geometry=10, buffer=-10)
¶
Generate random points from geometries in a GeoDataFrame, with optional buffering.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdf
|
GeoDataFrame
|
GeoDataFrame containing geometries (Polygon, MultiPolygon, or Point). |
required |
num_points_per_geometry
|
int
|
Number of points to generate per geometry (default is 10). |
10
|
buffer
|
int
|
Buffer distance to apply to geometries before generating points (default is -10). |
-10
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame of generated points merged with original attributes. |
Source code in agrigee_lite/misc.py
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 | |
images(geometry, start_date, end_date, satellite, invalid_images_threshold=0.5, max_parallel_downloads=40, force_redownload=False, image_indices=None)
¶
Download multiple satellite images for a given geometry and date range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
Polygon or MultiPolygon
|
The area of interest as a shapely Polygon or MultiPolygon. |
required |
start_date
|
Timestamp or str
|
Start date for image collection. |
required |
end_date
|
Timestamp or str
|
End date for image collection. |
required |
satellite
|
AbstractSatellite
|
The satellite configuration to use for image collection. |
required |
invalid_images_threshold
|
float
|
Threshold for filtering images based on valid pixels (0.0-1.0), by default 0.5. |
0.5
|
max_parallel_downloads
|
int
|
Maximum number of parallel downloads, by default 40. |
40
|
force_redownload
|
bool
|
Whether to force re-download of existing files, by default False. |
False
|
image_indices
|
list[int] or None
|
List of specific image indices to download (e.g., [0, 1] for first two images). If None, all images in the date range will be downloaded, by default None. |
None
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of image names (dates in YYYY-MM-DD format) that were downloaded. |
Source code in agrigee_lite/get/image.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | |
multiple_sits(gdf, satellite, reducers=None, original_index_column_name='original_index', start_date_column_name='start_date', end_date_column_name='end_date', subsampling_max_pixels=1000, chunksize=10, max_parallel_downloads=40, force_redownload=False)
¶
Download satellite time series for multiple geometries using parallel processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdf
|
GeoDataFrame
|
GeoDataFrame containing geometries and temporal information. |
required |
satellite
|
AbstractSatellite
|
Satellite configuration object. |
required |
reducers
|
set[str] or None
|
Set of reducer names to apply, by default None. |
None
|
original_index_column_name
|
str
|
Name of the column to store original indices, by default "original_index". |
'original_index'
|
start_date_column_name
|
str
|
Name of the start date column, by default "start_date". |
'start_date'
|
end_date_column_name
|
str
|
Name of the end date column, by default "end_date". |
'end_date'
|
subsampling_max_pixels
|
float
|
Maximum pixels for sampling: >1 = absolute count, ≤1 = fraction of area (e.g., 0.5 = 50% sampling), by default 1_000. |
1000
|
chunksize
|
int
|
Number of features to process per chunk, by default 10. |
10
|
max_parallel_downloads
|
int
|
Maximum number of parallel downloads, by default 40. |
40
|
force_redownload
|
bool
|
Whether to force re-download of existing data, by default False. |
False
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Combined DataFrame containing satellite time series for all geometries. |
Source code in agrigee_lite/get/sits.py
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
multiple_sits_gcs(gdf, satellite, bucket_name, reducers=None, original_index_column_name='original_index', start_date_column_name='start_date', end_date_column_name='end_date', subsampling_max_pixels=1000, cluster_size=500, force_redownload=False, wait=True)
¶
Download satellite time series using Google Earth Engine tasks to Google Cloud Storage.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdf
|
GeoDataFrame
|
GeoDataFrame containing geometries and temporal information. |
required |
satellite
|
AbstractSatellite
|
Satellite configuration object. |
required |
bucket_name
|
str
|
Google Cloud Storage bucket name for exports. |
required |
reducers
|
set[str] or None
|
Set of reducer names to apply, by default None. |
None
|
original_index_column_name
|
str
|
Name of the column to store original indices, by default "original_index". |
'original_index'
|
start_date_column_name
|
str
|
Name of the start date column, by default "start_date". |
'start_date'
|
end_date_column_name
|
str
|
Name of the end date column, by default "end_date". |
'end_date'
|
subsampling_max_pixels
|
float
|
Maximum pixels for sampling: >1 = absolute count, ≤1 = fraction of area (e.g., 0.5 = 50% sampling), by default 1_000. |
1000
|
cluster_size
|
int
|
Maximum cluster size for spatial grouping, by default 500. |
500
|
force_redownload
|
bool
|
Whether to force re-download of existing data, by default False. |
False
|
wait
|
bool
|
Whether to wait for task completion, by default True. |
True
|
Returns:
| Type | Description |
|---|---|
None or DataFrame
|
If wait is True, returns DataFrame with combined results. If wait is False, returns None. |
Source code in agrigee_lite/get/sits.py
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 | |
multiple_sits_gdrive(gdf, satellite, reducers=None, original_index_column_name='original_index', start_date_column_name='start_date', end_date_column_name='end_date', subsampling_max_pixels=1000, cluster_size=500, gee_save_folder='AGL_EXPORTS', force_redownload=False, wait=True)
¶
Download satellite time series using Google Earth Engine tasks to Google Drive.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdf
|
GeoDataFrame
|
GeoDataFrame containing geometries and temporal information. |
required |
satellite
|
AbstractSatellite
|
Satellite configuration object. |
required |
reducers
|
set[str] or None
|
Set of reducer names to apply, by default None. |
None
|
original_index_column_name
|
str
|
Name of the column to store original indices, by default "original_index". |
'original_index'
|
start_date_column_name
|
str
|
Name of the start date column, by default "start_date". |
'start_date'
|
end_date_column_name
|
str
|
Name of the end date column, by default "end_date". |
'end_date'
|
subsampling_max_pixels
|
float
|
Maximum pixels for sampling: >1 = absolute count, ≤1 = fraction of area (e.g., 0.5 = 50% sampling), by default 1_000. |
1000
|
cluster_size
|
int
|
Maximum cluster size for spatial grouping, by default 500. |
500
|
gee_save_folder
|
str
|
Google Drive folder name for saving exports, by default "AGL_EXPORTS". |
'AGL_EXPORTS'
|
force_redownload
|
bool
|
Whether to force re-download of existing data, by default False. |
False
|
wait
|
bool
|
Whether to wait for task completion, by default True. |
True
|
Source code in agrigee_lite/get/sits.py
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | |
ANADEM
¶
Bases: SingleImageSatellite
Satellite abstraction for ANADEM (Altimetric and Topographic Attributes of the Brazilian Territory).
ANADEM is a DEM-derived (Digital Elevation Model) product designed to support land analysis based on elevation, slope, and aspect characteristics across the Brazilian territory. It is particularly useful for ecological zoning, terrain classification, hydrological modeling, and environmental risk assessment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
list of str
|
List of bands to select. Defaults to ['elevation', 'slope', 'aspect']. - 'elevation': Ground elevation in meters. - 'slope': Degree of inclination derived from elevation. - 'aspect': Direction of slope (0-360°), where 0 = North. |
None
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border to reduce edge artifacts. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
50_000
|
Satellite Information
+------------------------------------+-----------------------------+ | Field | Value | +------------------------------------+-----------------------------+ | Name | ANADEM | | Resolution | 30 meters | | Source | FURGS, ANA | | Coverage | Brazil | | Derived From | SRTM + auxiliary DEMs | +------------------------------------+-----------------------------+
Band Information
+-----------+----------------------------+---------------------------+ | Band Name | Description | Unit / Range | +-----------+----------------------------+---------------------------+ | elevation | Ground elevation | meters above sea level | | slope | Terrain slope | degrees (0°-90°) | | aspect | Orientation of slope | degrees (0°-360° from N) | +-----------+----------------------------+---------------------------+
Notes
- The slope and aspect bands are computed from the elevation layer using the
ee.Terrain.products()utility. - The
compute()method calculates:- Mean elevation over the region.
- Percentage breakdown of slope classes:
- Flat (0-3°), Gentle (3-8°), Undulating (8-20°), Strong (20-45°), Mountainous (45-75°), and Steep (>75°).
- Percentage breakdown of aspect classes:
- North, NE, East, SE, South, SW, West, NW.
- These statistics are returned as a
FeatureCollectionwith a single feature containing the computed values. - Reference paper: https://www.mdpi.com/2072-4292/16/13/2321
- Data source: https://hge-iph.github.io/anadem/
Source code in agrigee_lite/sat/dem.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | |
Landsat5
¶
Bases: AbstractLandsat
Satellite abstraction for Landsat 5 (TM sensor, Collection 2).
Landsat 5 was launched in 1984 and provided more than 29 years of Earth observation data. This class supports both TOA and SR products, with optional cloud masking using the QA_PIXEL band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
set of str
|
Set of bands to select. Defaults to ['blue', 'green', 'red', 'nir', 'swir1', 'swir2']. |
None
|
indices
|
set of str
|
Spectral indices to compute from the selected bands. |
None
|
use_sr
|
bool
|
Whether to use surface reflectance products ('SR_B' bands). If False, uses top-of-atmosphere reflectance ('B' bands). |
True
|
tier
|
int
|
Landsat collection tier to use (1 or 2). Tier 1 has highest geometric accuracy. |
1
|
use_cloud_mask
|
bool
|
Whether to apply QA_PIXEL-based cloud masking. If False, no cloud mask is applied. |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
12
|
toa_cloud_filter_strength
|
int
|
Strength of the additional cloud filter applied to TOA imagery (if use_sr=False).
Used in the |
15
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
50_000
|
Cloud Masking
Cloud masking is based on the QA_PIXEL band, using bit flags defined by USGS:
- Applied to both TOA and SR products when use_cloud_mask=True
- For TOA collections, an additional filter (remove_l_toa_tough_clouds) is applied
to remove low-quality observations based on a simple cloud scoring method.
Satellite Information
+----------------------------+------------------------+ | Field | Value | +----------------------------+------------------------+ | Name | Landsat 5 TM | | Sensor | TM (Thematic Mapper) | | Platform | Landsat 5 | | Temporal Resolution | 16 days | | Pixel Size | 30 meters | | Coverage | Global | +----------------------------+------------------------+
Collection Dates
+-------------+------------+------------+ | Product | Start Date | End Date | +-------------+------------+------------+ | TOA | 1984-03-01 | 2013-05-05 | | SR | 1984-03-01 | 2012-05-05 | +-------------+------------+------------+
Band Information
+-----------+----------+-----------+------------------------+ | Band Name | TOA Name | SR Name | Spectral Wavelength | +-----------+----------+-----------+------------------------+ | blue | B1 | SR_B1 | 450-520 nm | | green | B2 | SR_B2 | 520-600 nm | | red | B3 | SR_B3 | 630-690 nm | | nir | B4 | SR_B4 | 770-900 nm | | swir1 | B5 | SR_B5 | 1550-1750 nm | | swir2 | B7 | SR_B7 | 2090-2350 nm | +-----------+----------+-----------+------------------------+
Notes
-
Landsat 5 TOA Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT05_C02_T1_TOA
-
Landsat 5 TOA Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT05_C02_T2_TOA
-
Landsat 5 SR Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT05_C02_T1_L2
-
Landsat 5 SR Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LT05_C02_T2_L2
-
Cloud mask reference (QA_PIXEL flags): https://www.usgs.gov/media/files/landsat-collection-2-pixel-quality-assessment
-
TOA cloud filtering (Simple Cloud Score): https://developers.google.com/earth-engine/guides/landsat?hl=pt-br#simple-cloud-score
Source code in agrigee_lite/sat/landsat.py
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
Landsat7
¶
Bases: AbstractLandsat
Satellite abstraction for Landsat 7 (ETM+ sensor, Collection 2).
Landsat 7 was launched in 1999 and provided over two decades of data. This class supports both TOA and SR products, with optional cloud masking using the QA_PIXEL band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
set of str
|
Set of bands to select. Defaults to ['blue', 'green', 'red', 'nir', 'swir1', 'swir2']. |
None
|
indices
|
set of str
|
Spectral indices to compute from the selected bands. |
None
|
use_sr
|
bool
|
Whether to use surface reflectance products ('SR_B' bands). If False, uses top-of-atmosphere reflectance ('B' bands). |
True
|
tier
|
int
|
Landsat collection tier to use (1 or 2). Tier 1 has highest geometric accuracy. |
1
|
use_cloud_mask
|
bool
|
Whether to apply QA_PIXEL-based cloud masking. If False, no cloud mask is applied. |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
12
|
toa_cloud_filter_strength
|
int
|
Strength of the additional cloud filter applied to TOA imagery (if use_sr=False).
Used in the |
15
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
50_000
|
use_pan_sharpening
|
bool
|
If True, applies pan sharpening to the RGB bands using the 15m-resolution panchromatic band (B8).
Only applicable when |
False
|
Cloud Masking
Cloud masking is based on the QA_PIXEL band, using bit flags defined by USGS:
- Applied to both TOA and SR products when use_cloud_mask=True
- For TOA collections, an additional filter (remove_l_toa_tough_clouds) is applied
to remove low-quality observations based on a simple cloud scoring method.
Satellite Information
+----------------------------+------------------------+ | Field | Value | +----------------------------+------------------------+ | Name | Landsat 7 ETM+ | | Sensor | ETM+ (Enhanced TM Plus)| | Platform | Landsat 7 | | Temporal Resolution | 16 days | | Pixel Size | 30 meters | | Coverage | Global | +----------------------------+------------------------+
Collection Dates
+-------------+------------+------------+ | Product | Start Date | End Date | +-------------+------------+------------+ | TOA | 1999-04-15 | 2022-04-06 | | SR | 1999-04-15 | 2022-04-06 | +-------------+------------+------------+
Band Information
+-----------+----------+-----------+------------------------+ | Band Name | TOA Name | SR Name | Spectral Wavelength | +-----------+----------+-----------+------------------------+ | blue | B1 | SR_B1 | 450-520 nm | | green | B2 | SR_B2 | 520-600 nm | | red | B3 | SR_B3 | 630-690 nm | | nir | B4 | SR_B4 | 770-900 nm | | swir1 | B5 | SR_B5 | 1550-1750 nm | | swir2 | B7 | SR_B7 | 2090-2350 nm | | pan | B8 | — | 520-900 nm (panchromatic) | +-----------+----------+-----------+------------------------+
Notes
-
Landsat 7 TOA Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LE07_C02_T1_TOA
-
Landsat 7 TOA Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LE07_C02_T2_TOA
-
Landsat 7 SR Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LE07_C02_T1_L2
-
Landsat 7 SR Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LE07_C02_T2_L2
-
Cloud mask reference (QA_PIXEL flags): https://www.usgs.gov/media/files/landsat-collection-2-pixel-quality-assessment
-
TOA cloud filtering (Simple Cloud Score): https://developers.google.com/earth-engine/guides/landsat?hl=pt-br#simple-cloud-score
Source code in agrigee_lite/sat/landsat.py
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 | |
Landsat8
¶
Bases: AbstractLandsat
Satellite abstraction for Landsat 8 (OLI/TIRS sensor, Collection 2).
Landsat 8 was launched in 2013 and remains in operation, delivering high-quality Earth observation data. This class supports both TOA and SR products, with optional cloud masking using the QA_PIXEL band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
set of str
|
Set of bands to select. Defaults to ['blue', 'green', 'red', 'nir', 'swir1', 'swir2']. |
None
|
indices
|
set of str
|
Spectral indices to compute from the selected bands. |
None
|
use_sr
|
bool
|
Whether to use surface reflectance products ('SR_B' bands). If False, uses top-of-atmosphere reflectance ('B' bands). |
True
|
tier
|
int
|
Landsat collection tier to use (1 or 2). Tier 1 has highest geometric accuracy. |
1
|
use_cloud_mask
|
bool
|
Whether to apply QA_PIXEL-based cloud masking. If False, no cloud mask is applied. |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
12
|
toa_cloud_filter_strength
|
int
|
Strength of the additional cloud filter applied to TOA imagery (if use_sr=False).
Used in the |
15
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
50_000
|
use_pan_sharpening
|
bool
|
If True, applies pan sharpening to the RGB bands using the 15m-resolution panchromatic band (B8).
Only applicable when |
False
|
Cloud Masking
Cloud masking is based on the QA_PIXEL band, using bit flags defined by USGS:
- Applied to both TOA and SR products when use_cloud_mask=True
- For TOA collections, an additional filter (remove_l_toa_tough_clouds) is applied
to remove low-quality observations based on a simple cloud scoring method.
Satellite Information
+----------------------------+------------------------+ | Field | Value | +----------------------------+------------------------+ | Name | Landsat 8 OLI/TIRS | | Sensor | OLI + TIRS | | Platform | Landsat 8 | | Temporal Resolution | 16 days | | Pixel Size | 30 meters | | Coverage | Global | +----------------------------+------------------------+
Collection Dates
+-------------+------------+------------+ | Product | Start Date | End Date | +-------------+------------+------------+ | TOA | 2013-04-11 | present | | SR | 2013-04-11 | present | +-------------+------------+------------+
Band Information
+-----------+----------+-----------+------------------------+ | Band Name | TOA Name | SR Name | Spectral Wavelength | +-----------+----------+-----------+------------------------+ | blue | B2 | SR_B2 | 450-515 nm | | green | B3 | SR_B3 | 525-600 nm | | red | B4 | SR_B4 | 630-680 nm | | nir | B5 | SR_B5 | 845-885 nm | | swir1 | B6 | SR_B6 | 1560-1660 nm | | swir2 | B7 | SR_B7 | 2100-2300 nm | | pan | B8 | — | 520-900 nm (panchromatic) | +-----------+----------+-----------+------------------------+
Notes
-
Landsat 8 TOA Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C02_T1_TOA
-
Landsat 8 TOA Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C02_T2_TOA
-
Landsat 8 SR Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C02_T1_L2
-
Landsat 8 SR Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C02_T2_L2
-
Cloud mask reference (QA_PIXEL flags): https://www.usgs.gov/media/files/landsat-collection-2-pixel-quality-assessment
-
TOA cloud filtering (Simple Cloud Score): https://developers.google.com/earth-engine/guides/landsat?hl=pt-br#simple-cloud-score
Source code in agrigee_lite/sat/landsat.py
486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 | |
Landsat9
¶
Bases: AbstractLandsat
Satellite abstraction for Landsat 9 (OLI-2/TIRS-2 sensor, Collection 2).
Landsat 9 is the latest mission in the Landsat program, launched in 2021. It is nearly identical to Landsat 8 and provides continuity for high-quality multispectral Earth observation. This class supports both TOA and SR products, with optional cloud masking using the QA_PIXEL band.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
set of str
|
Set of bands to select. Defaults to ['blue', 'green', 'red', 'nir', 'swir1', 'swir2']. |
None
|
indices
|
set of str
|
Spectral indices to compute from the selected bands. |
None
|
use_sr
|
bool
|
Whether to use surface reflectance products ('SR_B' bands). If False, uses top-of-atmosphere reflectance ('B' bands). |
True
|
tier
|
int
|
Landsat collection tier to use (1 or 2). Tier 1 has highest geometric accuracy. |
1
|
use_cloud_mask
|
bool
|
Whether to apply QA_PIXEL-based cloud masking. If False, no cloud mask is applied. |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
12
|
toa_cloud_filter_strength
|
int
|
Strength of the additional cloud filter applied to TOA imagery (if use_sr=False).
Used in the |
15
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
50_000
|
use_pan_sharpening
|
bool
|
If True, applies pan sharpening to the RGB bands using the 15m-resolution panchromatic band (B8).
Only applicable when |
False
|
Cloud Masking
Cloud masking is based on the QA_PIXEL band, using bit flags defined by USGS:
- Applied to both TOA and SR products when use_cloud_mask=True
- For TOA collections, an additional filter (remove_l_toa_tough_clouds) is applied
to remove low-quality observations based on a simple cloud scoring method.
Satellite Information
+----------------------------+------------------------+ | Field | Value | +----------------------------+------------------------+ | Name | Landsat 9 OLI-2/TIRS-2 | | Sensor | OLI-2 + TIRS-2 | | Platform | Landsat 9 | | Temporal Resolution | 16 days | | Pixel Size | 30 meters | | Coverage | Global | +----------------------------+------------------------+
Collection Dates
+-------------+------------+------------+ | Product | Start Date | End Date | +-------------+------------+------------+ | TOA | 2021-11-01 | present | | SR | 2021-11-01 | present | +-------------+------------+------------+
Band Information
+-----------+----------+-----------+------------------------+ | Band Name | TOA Name | SR Name | Spectral Wavelength | +-----------+----------+-----------+------------------------+ | blue | B2 | SR_B2 | 450-515 nm | | green | B3 | SR_B3 | 525-600 nm | | red | B4 | SR_B4 | 630-680 nm | | nir | B5 | SR_B5 | 845-885 nm | | swir1 | B6 | SR_B6 | 1560-1660 nm | | swir2 | B7 | SR_B7 | 2100-2300 nm | | pan | B8 | — | 520-900 nm (panchromatic) | +-----------+----------+-----------+------------------------+
Notes
-
Landsat 9 TOA Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC09_C02_T1_TOA
-
Landsat 9 TOA Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC09_C02_T2_TOA
-
Landsat 9 SR Collection (Tier 1): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC09_C02_T1_L2
-
Landsat 9 SR Collection (Tier 2): https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC09_C02_T2_L2
-
Cloud mask reference (QA_PIXEL flags): https://www.usgs.gov/media/files/landsat-collection-2-pixel-quality-assessment
-
TOA cloud filtering (Simple Cloud Score): https://developers.google.com/earth-engine/guides/landsat?hl=pt-br#simple-cloud-score
Source code in agrigee_lite/sat/landsat.py
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 | |
MapBiomas
¶
Bases: DataSourceSatellite
Satellite abstraction for MapBiomas Brazil Collection 10 Land Use and Land Cover (LULC) data.
This class wraps the official MapBiomas Collection 10 LULC classification product for Brazil.
The dataset provides annual land use and land cover classifications from 1985 to 2023 at 30-meter resolution,
with majority class (10_class) and percent agreement (11_percent) bands.
It is suitable for long-term land cover trend analysis, ecosystem monitoring, and environmental assessments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
border_pixels_to_erode
|
float
|
Number of border pixels (in pixels) to erode from the input geometry before analysis. Helps remove classification noise from edges. Use 0 to disable. |
1
|
min_area_to_keep_border
|
int
|
Minimum area in square meters to retain the eroded region. Used to avoid discarding small geometries entirely. |
50000
|
Bands
+-------------+------------------------+-------------------------------------------------------------+ | Band Name | Type | Description | +-------------+------------------------+-------------------------------------------------------------+ | 10_class | Categorical (int) | Most frequent land use/cover class for the pixel/year | | 11_percent | Float (0-1) | Proportion of classification votes for the majority class | +-------------+------------------------+-------------------------------------------------------------+
Classes:
| Name | Description |
|---|---|
Each integer value in the `10_class` band corresponds to a LULC class defined by MapBiomas. |
|
Refer to `self.classes` for full label and color mapping. Examples include: |
|
- 3: Forest Formation |
|
- 14: Farming |
|
- 24: Urban Area |
|
- 26: Water |
|
- 39: Soybean |
|
- 46: Coffee |
|
Processing Overview
- The MapBiomas classification image (
mapbiomas_brazil_collection10_coverage_v2) is loaded. - For each year between the start and end date of the input feature:
- The modal (most frequent) class is computed (
10_class) - Its pixel agreement (% of pixels matching that class) is calculated (
11_percent) - Optionally, the geometry is eroded to avoid edge noise.
- Final features are returned as an annual time series of LULC summaries.
Dataset Information
+-------------------------+------------------------------------------------------+ | Field | Value | +-------------------------+------------------------------------------------------+ | Dataset | MapBiomas Brazil Collection 10 | | Temporal Coverage | 1985 - 2023 | | Spatial Resolution | 30 meters | | Projection | EPSG: 4674 (SIRGAS 2000) | | Source Imagery | Landsat (TM, ETM+, OLI) | | Classification Method | Random Forest + Temporal Filtering | +-------------------------+------------------------------------------------------+
Notes
-
Official MapBiomas dataset (Earth Engine): https://developers.google.com/earth-engine/datasets/catalog/projects_mapbiomas-public_assets_brazil_lulc_collection10_mapbiomas_brazil_collection10_coverage_v2
-
ATBD (Algorithm Theoretical Basis Document) Collection 10: https://mapbiomas.org/downloads?cama_set_language=en
-
Only the majority class (
classification_YEAR) is used here — secondary confidence or transitions are not included.
Source code in agrigee_lite/sat/mapbiomas.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
Modis8Days
¶
Bases: OpticalSatellite
Satellite abstraction for MODIS Terra and Aqua (8-day composites).
MODIS (Moderate Resolution Imaging Spectroradiometer) is a key instrument aboard NASA's Terra and Aqua satellites, providing global coverage for land, ocean, and atmospheric monitoring at frequent intervals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
list of str
|
List of bands to select. Defaults to ['red', 'nir']. |
None
|
indices
|
list of str
|
List of spectral indices to compute from selected bands. |
None
|
use_cloud_mask
|
bool
|
Whether to apply a cloud mask based on the QA 'State' band (bits 0-1). If True, only pixels with cloud state == 0 (clear) are retained. |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
2
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
0.5
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
190_000
|
Cloud Masking
Cloudy pixels are masked using bits 0-1 of the 'State' QA band, which encode cloud state: - 00: clear - 01: cloudy - 10: mixed - 11: not set
The masking keeps only pixels with value 00 (clear) if use_cloud_mask=True.
Satellite Information
+----------------------------+------------------------+ | Field | Value | +----------------------------+------------------------+ | Name | MODIS (8-day) | | Platforms | Terra, Aqua | | Temporal Resolution | 8 days | | Pixel Size | 250 meters | | Coverage | Global | +----------------------------+------------------------+
Collection Dates
+--------+------------+------------+ | Source | Start Date | End Date | +--------+------------+------------+ | Terra | 2000-02-18 | present | | Aqua | 2002-07-04 | present | +--------+------------+------------+
Band Information
+-----------+----------------+----------------+------------------------+ | Band Name | Original Band | Resolution | Spectral Wavelength | +-----------+----------------+----------------+------------------------+ | red | sur_refl_b01 | 250 meters | 620-670 nm | | nir | sur_refl_b02 | 250 meters | 841-876 nm | +-----------+----------------+----------------+------------------------+
Notes
Cloud Mask Reference (QA 'State' band documentation): https://lpdaac.usgs.gov/documents/925/MOD09_User_Guide_V61.pdf
MODIS Collections on Google Earth Engine: - Terra (MOD09Q1): https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD09Q1 - Aqua (MYD09Q1): https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MYD09Q1
Source code in agrigee_lite/sat/modis.py
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | |
_mask_modis8days_clouds(img)
staticmethod
¶
Mask cloudy pixels based on bits 0-1 of 'State' QA band.
Source code in agrigee_lite/sat/modis.py
337 338 339 340 341 342 | |
ModisDaily
¶
Bases: OpticalSatellite
⚠️⚠️⚠️ Note: Despite this cloud mask, daily MODIS imagery tends to have a high presence of residual clouds. It is recommended to use Modis8Days for cleaner data. ⚠️⚠️⚠️
Satellite abstraction for MODIS Terra and Aqua (Daily composites).
MODIS (Moderate Resolution Imaging Spectroradiometer) is a key instrument aboard NASA's Terra and Aqua satellites, offering daily global coverage for environmental and land surface monitoring.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
set of str
|
Set of bands to select. Defaults to ['red', 'nir']. |
None
|
indices
|
set of str
|
List of spectral indices to compute from selected bands. |
None
|
use_cloud_mask
|
bool
|
Whether to apply cloud masking using bit 10 of the 'state_1km' QA band. When set to False, no cloud filtering is applied (results may be ULTRA NOISY). |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
2
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
0.5
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
190_000
|
Cloud Masking
Cloudy pixels are masked using bit 10 of the 'state_1km' QA band: - 0: clear - 1: cloudy
Only pixels with bit 10 equal to 0 (clear) are retained.
Satellite Information
+----------------------------+------------------------+ | Field | Value | +----------------------------+------------------------+ | Name | MODIS (Daily) | | Platforms | Terra, Aqua | | Temporal Resolution | 1 day | | Pixel Size | 250 meters | | Coverage | Global | +----------------------------+------------------------+
Collection Dates
+--------+------------+------------+ | Source | Start Date | End Date | +--------+------------+------------+ | Terra | 2000-02-24 | present | | Aqua | 2002-07-04 | present | +--------+------------+------------+
Band Information
+-----------+----------------+----------------+------------------------+ | Band Name | Original Band | Resolution | Spectral Wavelength | +-----------+----------------+----------------+------------------------+ | red | sur_refl_b01 | 250 meters | 620-670 nm | | nir | sur_refl_b02 | 250 meters | 841-876 nm | +-----------+----------------+----------------+------------------------+
Notes
Cloud Mask Reference (QA 'state_1km' band documentation): https://lpdaac.usgs.gov/documents/925/MOD09_User_Guide_V61.pdf
MODIS Collections on Google Earth Engine: - Terra (MOD09GQ - reflectance): https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD09GQ - Terra (MOD09GA - QA band): https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD09GA - Aqua (MYD09GQ - reflectance): https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MYD09GQ - Aqua (MYD09GA - QA band): https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MYD09GA
Source code in agrigee_lite/sat/modis.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
_mask_modis_clouds(img)
staticmethod
¶
Bit-test bit 10 of state_1km (value 0 = clear).
Source code in agrigee_lite/sat/modis.py
137 138 139 140 141 142 | |
imageCollection(ee_feature)
¶
Build the merged, cloud-masked Terra + Aqua collection exactly like the stand-alone helper did.
Source code in agrigee_lite/sat/modis.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
PALSAR2ScanSAR
¶
Bases: RadarSatellite
Satellite abstraction for ALOS PALSAR-2 ScanSAR (Level 2.2).
PALSAR-2 is an L-band Synthetic Aperture Radar (SAR) sensor onboard the ALOS-2 satellite, operated by JAXA. This class provides preprocessing and abstraction for the Level 2.2 ScanSAR data product with 25-meter resolution. Optionally applies the MSK quality mask.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
set of str
|
Set of bands to select. Defaults to ['hh', 'hv']. |
None
|
indices
|
set of str
|
Radar indices to compute (e.g., polarization ratios). Defaults to []. |
None
|
use_quality_mask
|
bool
|
Whether to apply the MSK bitmask quality filter. If False, all pixels are retained, including those marked as low-quality or invalid. |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
20
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
35_000
|
Quality Masking
When use_quality_mask=True, the MSK band is used to filter out invalid pixels.
The first 3 bits of the MSK band indicate data quality:
- 1 → Valid
- 5 → Invalid
Only pixels with value 1 are retained.
Satellite Information
+----------------------------+-------------------------------+ | Field | Value | +----------------------------+-------------------------------+ | Name | ALOS PALSAR-2 ScanSAR | | Sensor | PALSAR-2 (L-band SAR) | | Platform | ALOS-2 | | Revisit Time | ~14 days | | Pixel Size | ~25 meters | | Coverage | Japan + selected global areas | +----------------------------+-------------------------------+
Collection Dates
+----------------+-------------+------------+ | Collection | Start Date | End Date | +----------------+-------------+------------+ | Level 2.2 | 2014-08-04 | present | +----------------+-------------+------------+
Band Information
+-----------+---------+------------+-------------------------------------------+ | Band Name | Type | Resolution | Description | +-----------+---------+------------+-------------------------------------------+ | hh | L-band | ~25 m | Horizontal transmit and receive | | hv | L-band | ~25 m | Horizontal transmit, vertical receive | | msk | Bitmask | ~25 m | MSK quality band (used only if enabled) | +-----------+---------+------------+-------------------------------------------+
Notes
-
Earth Engine Dataset: https://developers.google.com/earth-engine/datasets/catalog/JAXA_ALOS_PALSAR-2_Level2_2_ScanSAR
-
MSK Quality Mask Details (bit pattern): https://www.eorc.jaxa.jp/ALOS/en/palsar_fnf/data/Format_PALSAR-2.html
Source code in agrigee_lite/sat/palsar.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | |
_mask_quality(img)
staticmethod
¶
Apply MSK quality mask to exclude invalid data.
MSK bits 0-2 indicate data quality: 1 = valid data 5 = invalid
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
Image
|
|
required |
Returns:
| Type | Description |
|---|---|
Image
|
|
Source code in agrigee_lite/sat/palsar.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
SatelliteEmbedding
¶
Bases: DataSourceSatellite
Satellite abstraction for the Google Satellite Embedding collection.
This collection contains annual, manually curated embeddings derived from multi-sensor satellite data.
IMPORTANT: It always returns the center point value as the median (in order to maintain z-sphere normalization) and the standard deviation of the geometry without the borders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
list of str
|
List of bands to select. Defaults to all 64 embeddings. |
None
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-eroded) pixels required to retain an image. |
1
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
35_000
|
Satellite Information
+-----------------------------+-----------------------+ | Field | Value | +-----------------------------+-----------------------+ | Name | Satellite Embedding | | Embedding Dimensions | 64 (A0 to A63) | | Pixel Size | ~10 meters | | Temporal Resolution | Annual | | Coverage | Global | +-----------------------------+-----------------------+
Collection Dates
+------------+------------+ | Start Date | End Date | +------------+------------+ | 2017-01-01 | 2024-01-02 | +------------+------------+
Notes
Satellite Embedding V1: - Dataset: https://developers.google.com/earth-engine/datasets/catalog/GOOGLE_SATELLITE_EMBEDDING_V1_ANNUAL?hl=pt-br#bands
Source code in agrigee_lite/sat/embeddings.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
Sentinel1GRD
¶
Bases: RadarSatellite
⚠️⚠️⚠️ Sentinel-1 Availability Warning
Due to the failure of the Sentinel-1B satellite in December 2021, the constellation has been operating solely with Sentinel-1A. This has led to reduced data availability in many regions — particularly in the Southern Hemisphere — with revisit times increasing from ~6 days to ~12 days or more. Some areas may experience significant temporal gaps, especially after early 2022. ⚠️⚠️⚠️
Satellite abstraction for Sentinel-1 Ground Range Detected (GRD) product.
Sentinel-1 is a constellation of two polar-orbiting satellites (Sentinel-1A and 1B) operated by ESA, equipped with C-band Synthetic Aperture Radar (SAR). It provides all-weather, day-and-night imaging of Earth's surface.
This class wraps the Sentinel-1 GRD product and allows users to select polarizations, filter by orbit pass, and apply edge masks to remove low-backscatter areas (e.g., layover).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
set of str
|
Set of polarizations to select. Defaults to {'vv', 'vh'}. |
None
|
indices
|
set of str
|
Set of radar indices (e.g. ratios). Defaults to []. |
None
|
ascending
|
bool
|
If True, selects ASCENDING orbit passes. If False, selects DESCENDING. |
True
|
use_edge_mask
|
bool
|
Whether to apply an edge mask to remove extreme low-backscatter areas (commonly occurring near the edges of acquisitions or in layover/shadow zones). Default is True. |
True
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
20
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
35_000
|
Edge Masking
Sentinel-1 radar images often contain low-backscatter areas near image borders or over layover zones.
This class applies a threshold-based edge mask (< -30 dB) to reduce artifacts.
Satellite Information
+-------------------------------+-------------------------------+ | Field | Value | +-------------------------------+-------------------------------+ | Name | Sentinel-1 | | Agency | ESA (Copernicus) | | Instrument | C-band Synthetic Aperture Radar (SAR) | | Revisit Time (full mission) | ~6 days (1A + 1B constellation)| | Revisit Time (post-2021) | ~12 days (only 1A active) | | Orbit Type | Sun-synchronous (polar) | | Pixel Size | ~10 meters | | Coverage | Global | +-------------------------------+-------------------------------+
Collection Dates
+------------------+-------------+-----------+ | Product | Start Date | End Date | +------------------+-------------+-----------+ | GRD | 2014-10-03 | present | +------------------+-------------+-----------+
Band Information
+------------+-----------+-------------+------------------------------+ | Band Name | Frequency | Resolution | Description | +------------+-----------+-------------+------------------------------+ | VV | 5.405 GHz | ~10 meters | Vertical transmit/receive | | VH | 5.405 GHz | ~10 meters | Vertical transmit, horizontal receive | +------------+-----------+-------------+------------------------------+
Notes
-
Official GRD collection (Earth Engine): https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S1_GRD
-
Sentinel-1 User Guide: https://sentinels.copernicus.eu/web/sentinel/user-guides/sentinel-1-sar
-
Orbit direction filter: https://developers.google.com/earth-engine/sentinel1#orbit-direction
Source code in agrigee_lite/sat/sentinel1.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
_mask_edge(img)
staticmethod
¶
Remove extreme low-backscatter areas (edges / layover)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
img
|
Image
|
Unfiltered Sentinel-1 image |
required |
Returns:
| Type | Description |
|---|---|
Image
|
Filtered Sentinel-1 image |
Source code in agrigee_lite/sat/sentinel1.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
Sentinel2
¶
Bases: OpticalSatellite
Satellite abstraction for Sentinel-2 (HARMONIZED collections).
Sentinel-2 is a constellation of twin Earth observation satellites, operated by ESA, designed for land monitoring, vegetation, soil, water cover, and coastal areas.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bands
|
list of str
|
List of bands to select. Defaults to all 10 bands most used for vegetation and soil analysis. |
None
|
indices
|
list of str
|
List of spectral indices to compute from the selected bands. |
None
|
use_sr
|
bool
|
If True, uses surface reflectance (BOA, 'S2_SR_HARMONIZED'). If False, uses top-of-atmosphere reflectance ('S2_HARMONIZED'). |
True
|
cloud_probability_threshold
|
float
|
Minimum threshold to consider a pixel as cloud-free. |
0.7
|
min_valid_pixel_count
|
int
|
Minimum number of valid (non-cloud) pixels required to retain an image. |
20
|
border_pixels_to_erode
|
float
|
Number of pixels to erode from the geometry border. |
1
|
min_area_to_keep_border
|
int
|
Minimum area (in m²) required to retain geometry after border erosion. |
35_000
|
Satellite Information
+------------------------------------+------------------------+ | Field | Value | +------------------------------------+------------------------+ | Name | Sentinel-2 | | Revisit Time | 5 days | | Revisit Time (cloud-free estimate) | ~7 days | | Pixel Size | 10 meters | | Coverage | Global | +------------------------------------+------------------------+
Collection Dates
+----------------------------+------------+------------+ | Collection Type | Start Date | End Date | +----------------------------+------------+------------+ | TOA (Top of Atmosphere) | 2016-01-01 | present | | SR (Surface Reflectance) | 2019-01-01 | present | +----------------------------+------------+------------+
Band Information
+-----------+---------------+--------------+------------------------+ | Band Name | Original Band | Resolution | Spectral Wavelength | +-----------+---------------+--------------+------------------------+ | blue | B2 | 10 m | 492 nm | | green | B3 | 10 m | 559 nm | | red | B4 | 10 m | 665 nm | | re1 | B5 | 20 m | 704 nm | | re2 | B6 | 20 m | 739 nm | | re3 | B7 | 20 m | 780 nm | | nir | B8 | 10 m | 833 nm | | re4 | B8A | 20 m | 864 nm | | swir1 | B11 | 20 m | 1610 nm | | swir2 | B12 | 20 m | 2186 nm | +-----------+---------------+--------------+------------------------+
Notes
Cloud Masking: This class uses the Cloud Score Plus dataset to estimate cloud probability: https://developers.google.com/earth-engine/datasets/catalog/GOOGLE_CLOUD_SCORE_PLUS_V1_S2_HARMONIZED
Sentinel-2 Collections: - TOA: https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2_HARMONIZED - SR: https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2_SR_HARMONIZED
Source code in agrigee_lite/sat/sentinel2.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | |
TwoSatelliteFusion
¶
Bases: OpticalSatellite
A satellite fusion class that combines data from exactly two optical satellites for synchronized analysis.
This class enables the fusion of data from two different optical satellites by finding common observation dates and merging their image collections. It ensures temporal alignment between the two satellite datasets, making it possible to perform comparative analysis or create composite datasets from dual satellite sources.
The class is specifically designed for two-satellite fusion and automatically handles: - Temporal intersection calculation between the two satellite date ranges - Spatial resolution alignment using the finest available resolution - Band renaming with prefixes to distinguish between the two satellite sources - Image collection synchronization based on common observation dates - Unified processing pipeline for both satellite datasets
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
satellite_a
|
OpticalSatellite
|
The first optical satellite configuration object. |
required |
satellite_b
|
OpticalSatellite
|
The second optical satellite configuration object. |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
sat_a |
OpticalSatellite
|
Reference to the first satellite object. |
sat_b |
OpticalSatellite
|
Reference to the second satellite object. |
startDate |
str
|
The latest start date between both satellites (ISO format). |
endDate |
str
|
The earliest end date between both satellites (ISO format). |
pixelSize |
float
|
The finest spatial resolution between both satellites. |
shortName |
str
|
Combined short name identifier for the fused satellite configuration. |
toDownloadSelectors |
list[str]
|
Combined selectors from both satellites with distinguishing prefixes. |
Examples:
>>> from agrigee_lite.sat.landsat import Landsat8
>>> from agrigee_lite.sat.sentinel import Sentinel2
>>>
>>> l8 = Landsat8()
>>> s2 = Sentinel2()
>>> fusion = TwoSatelliteFusion(l8, s2)
>>>
>>> # The fused satellite will only cover the temporal overlap
>>> print(fusion.startDate) # Latest of the two start dates
>>> print(fusion.endDate) # Earliest of the two end dates
Source code in agrigee_lite/sat/unified_satellite.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
multiple_sits(gdf, satellite, band_or_indice_to_plot, reducer='median', ax=None, color='blue', alpha=0.5)
¶
Visualize satellite time series for multiple geometries with normalized temporal alignment.
Creates overlaid line plots for multiple geometries, with time series normalized to year fractions to enable comparison across different years. Each geometry's time series is plotted as a semi-transparent line, making it easy to identify patterns and outliers across the dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
gdf
|
GeoDataFrame
|
GeoDataFrame containing multiple geometries and their temporal information. Must have the required date columns for satellite time series processing. |
required |
satellite
|
AbstractSatellite
|
Satellite configuration object. |
required |
band_or_indice_to_plot
|
str
|
Name of the band or vegetation index to visualize. |
required |
reducer
|
str
|
Temporal reducer to apply (e.g., "median", "mean"), by default "median". |
'median'
|
ax
|
Axes or None
|
Matplotlib axes object for plotting. If None, creates a new plot, by default None. |
None
|
color
|
str
|
Color for the plot lines, by default "blue". |
'blue'
|
alpha
|
float
|
Transparency level for individual lines (0.0 to 1.0), by default 0.5. Lower values help visualize overlapping time series. |
0.5
|
Returns:
| Type | Description |
|---|---|
None
|
The function creates a plot but doesn't return any value. |
Notes
This function normalizes timestamps to year fractions, where each time series
starts from 0.0, making it possible to overlay multiple years of data for
pattern analysis. The original timestamps are converted using the year_fraction
function and then normalized to start from zero.
Source code in agrigee_lite/vis/sits.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |