Add support for new-format SMAC coefficients + Improve handling of CAMS data retrieval#35
Merged
Merged
Conversation
Identified multiple instances where user-provided or variable input was being interpolated directly into SQL queries using f-strings or .format() in tile_db.py and grids.py. Replaced string interpolation with parameterized queries using '?' placeholders in the following functions: - tile_db.py: _select_tiles_by_spatial_relationships, get_mgrs_def, mgrs_to_wkt, wrs_to_wkt - grids.py: _get_roi (in both sen2like and prisma4sen2like) This change prevents potential SQL injection vulnerabilities while maintaining existing functionality. Verified with targeted tests. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Introduced new SMAC coefficient files for Sentinel-2 platforms (S2A, S2B, S2C) with coefficients organized by band columns. - Updated the `smac` module to read the new-format files, allowing for band-specific coefficient retrieval. - Modified `Sentinel2Product` to select the appropriate coefficient file based on the sensor name, with S2D falling back to S2A coefficients. - Enhanced `S2L_Atmcor` to pass the band parameter when loading SMAC coefficients. - Added unit tests to verify loading of coefficients for all Sentinel-2 bands, ensuring distinct coefficients for different platforms and compatibility with legacy Landsat-8 formats.
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for new-format SMAC coefficients for Sentinel-2
smacmodule to read the new-format files, allowing for band-specific coefficient retrieval.Sentinel2Productto select the appropriate coefficient file based on the sensor name, with S2D falling back to S2A coefficients.S2L_Atmcorto pass the band parameter when loading SMAC coefficients.Improve handling of CAMS data retrieval and interpolation logic