Skip to content

fix: internalize the functions from ee_extra - #492

Merged
12rambau merged 22 commits into
mainfrom
extra
Jul 16, 2026
Merged

12rambau merged 22 commits into
mainfrom
extra

Conversation

@12rambau

@12rambau 12rambau commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

everything is in the title.

The ee_extra lib is [less and less maintained][https://github.com/r-earthengine/ee_extra/issues) and create bugs everytime one of it's dependencies introduce a breaking change. yesterday it was package_resources today it's the warning in the js to python convertion tool.

We decided to internalize all the function we use from ee_extra and wire them directly to the catalogs when needed (awesmoe indices for example).

This lead to the creation of an extra/ folder that contains the cloud masking, pan sharpening, indices and tasseled cap capacities. ImageCollection and Image computation is rewired to this subpackage and we dropped the dependency to ee_extra.

12rambau added 22 commits July 15, 2026 13:06
- Remove dependency on ee_extra.STAC.core.getScaleParams
- Remove dependency on ee_extra.STAC.core.getOffsetParams
- Add local implementation using ee-catalog-scale.json and ee-catalog-offset.json
- Add ee_extra_utils.py module with _load_JSON and _get_platform_STAC utilities
- Add data directory with scale and offset parameter catalogs from ee_extra
- Remove dependency on ee_extra.STAC.core.scaleAndOffset
- Implement scaleAndOffset using local getScaleParams and getOffsetParams
- Uses ee.Dictionary.toImage() for scale/offset transformations
- Properly handles missing bands and copies image properties
- Remove dependency on ee_extra.QA.pipelines.preprocess
- Implement preprocess as wrapper around maskClouds + scaleAndOffset
- Set default maskClouds parameters matching ee_extra behavior
- Allow custom parameters to override defaults
- Remove dependency on ee_extra.Spectral.core.tasseledCap
- Create ee_extra_tasseled_cap.py with platform-specific coefficients
- Add _get_tc_coefficients() utility function
- Implement tasseledCap using local coefficient data
- Support Sentinel-2, Landsat (4-9), and MODIS platforms
- Remove dependency on ee_extra.QA.clouds.maskClouds
- Create ee_extra_clouds.py with platform-specific masking functions
- Support Sentinel-2, Sentinel-3, Landsat (4-9), and MODIS platforms
- Implement cloud_prob, cloud_score+, and qa masking methods
- Handle cloud shadows, cirrus, and cloud displacement index masking
- Remove dependency on ee_extra.Algorithms.core.panSharpen
- Create ee_extra_pansharpen.py with 4 sharpening algorithms
- Implement SFIM (Smoothing Filter-based Intensity Modulation)
- Implement HPFA (High-Pass Filter Addition)
- Implement PCS (Principal Component Substitution)
- Implement SM (Simple Mean)
- Support Landsat and compatible platforms
- Remove dependency on ee_extra.ImageCollection.core.closest
- Create ee_extra_temporal.py with closest() function
- Filters ImageCollection to find images nearest to target date
- Supports tolerance window with multiple time units
- Update maskClouds in ee_image_collection.py to use local impl
…ions

- Update getScaleParams, getOffsetParams, scaleAndOffset
- Update preprocess, panSharpen, tasseledCap
- Replace all ee_extra dependencies with local implementations
- Add imports for local utility functions
- Remove dependency on ee_extra.Spectral.core.spectralIndices
- Create ee_extra_spectralindices.py with spectral index formulas
- Implement 14 common indices: NDVI, EVI, SAVI, NDMI, NBR, NDWI, etc.
- Support index categories: vegetation, burn, water, snow, urban, all
- Platform-specific band mapping for Landsat and Sentinel-2
- Remove all ee_extra imports from ee_image.py and ee_image_collection.py
- Update getScaleParams and getOffsetParams to fetch from GitHub
- Use davemlz/ee-catalog-scale-offset-params repository as source
- Add _get_catalog_data() and _get_scale_offset_params() utilities
- Cache fetched data to minimize network requests
- Update methods in both ee_image.py and ee_image_collection.py
- Improves maintainability by using upstream data source
@12rambau
12rambau merged commit 2c66b99 into main Jul 16, 2026
10 of 12 checks passed
@12rambau
12rambau deleted the extra branch July 16, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant