Skip to content

Add support for new-format SMAC coefficients + Improve handling of CAMS data retrieval#35

Merged
telespazio-tim merged 5 commits into
senbox-org:masterfrom
kassoulet:master
Jun 18, 2026
Merged

Add support for new-format SMAC coefficients + Improve handling of CAMS data retrieval#35
telespazio-tim merged 5 commits into
senbox-org:masterfrom
kassoulet:master

Conversation

@kassoulet

Copy link
Copy Markdown
Contributor

Add support for new-format SMAC coefficients for Sentinel-2

  • 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.

Improve handling of CAMS data retrieval and interpolation logic

kassoulet and others added 5 commits June 9, 2026 16:50
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.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@telespazio-tim
telespazio-tim merged commit a8587c3 into senbox-org:master Jun 18, 2026
2 checks passed
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.

3 participants