Skip to content

Edge Correction#37

Open
michaelkiper wants to merge 3 commits intoemit-sds:developfrom
michaelkiper:edge-correction
Open

Edge Correction#37
michaelkiper wants to merge 3 commits intoemit-sds:developfrom
michaelkiper:edge-correction

Conversation

@michaelkiper
Copy link
Copy Markdown
Collaborator

@michaelkiper michaelkiper commented Nov 11, 2025

Overview

This PR is to add in the edge correction according to Francisco's code.

It's fairly straight forward. The static.yml file defines a new field for edge correction where there's a new key-value pair that's the "name-of-file": [list, of, left, edge, indices]. Then during the static processing portion, it'll perform an in-place correction of the magnitudes of the edge discontinuities.

To note: the edge correction will adjust the preceding LEFT side of the edge discontinuity. AND moreover, the preceding left spectra magnitudes will be cumulatively scaled as there are more edges to correct.

Related Tickets

resolves #29

Testing

Regression tested + additional unit tests. Run make test to verify.

(emit-fc) makiper@MT-400290 cover-class % make test
python3 -m unittest discover tests -p '*_test.py'
.......................
----------------------------------------------------------------------
Ran 23 tests in 0.499s

OK

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds edge correction functionality to handle spectral data discontinuities by scaling the left side of edge indices to match adjacent magnitudes. The correction is applied cumulatively when multiple edges are specified, with each edge's left portion being scaled based on the ratio between adjacent wavelength band values.

Key changes:

  • New left_edge_scale function that performs in-place magnitude correction on spectral data
  • Integration of edge correction into the static data processing pipeline
  • Configuration support for specifying edge indices per dataset class

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/cover_class/static/preprocessor.py Implements the left_edge_scale function for correcting edge discontinuities
src/cover_class/static/retrieval.py Integrates edge correction into the data processing workflow before interpolation
src/cover_class/config/static.yml Adds example configuration for the left-edge-correction feature
tests/static/retrieval_test.py Adds unit tests for the edge correction functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean step discontinuities

2 participants