Open
Conversation
Contributor
There was a problem hiding this comment.
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_scalefunction 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.
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.
Overview
This PR is to add in the edge correction according to Francisco's code.
It's fairly straight forward. The
static.ymlfile 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 testto verify.