-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Missing functionality - Replace X coordinates with Y values from another signal for calibration
Problem Description
Users need to perform signal axis calibration, particularly for spectroscopy workflows where:
- One signal contains measurement data (e.g., intensity vs pixel index)
- Another signal contains calibration data (e.g., wavelength values vs pixel index)
- Goal: Plot measurement intensity vs calibrated wavelength scale
This fundamental operation was missing from Sigima/DataLab, forcing users to:
- Use external tools for calibration
- Manually export/import data
- Attempt to use X-Y mode (which incorrectly applies resampling/interpolation)
Solution Implemented
Added new replace_x_by_other_y(src1, src2) function that:
- Takes Y values from
src2and uses them as X coordinates forsrc1's Y values - Directly uses Y arrays without interpolation (preserves exact calibration values)
- Requires both signals to have the same number of points
- Automatically transfers metadata (X label/unit from src2.ylabel/yunit)
- Clear error message when signal sizes don't match
Technical Details
Function signature:
def replace_x_by_other_y(src1: SignalObj, src2: SignalObj) -> SignalObj:
"""Create a new signal using Y from src1 and Y from src2 as X coordinates."""Usage example (wavelength calibration):
# Signal 1: intensity measurements [0, 1, 2, 3, 4] -> [10, 20, 30, 40, 50]
# Signal 2: wavelength calibration [0, 1, 2, 3, 4] -> [400, 450, 500, 550, 600]
# Result: intensity vs wavelength [400, 450, 500, 550, 600] -> [10, 20, 30, 40, 50]
calibrated = sigima.proc.signal.replace_x_by_other_y(intensity, wavelength)Rationale for Bug Fix Classification
While this adds new functionality, it's classified as a bug fix because:
- User-reported critical gap: Real users couldn't perform a fundamental operation expected in the target domain (spectroscopy)
- Misleading existing feature: X-Y mode appeared to solve the problem but didn't (applies unwanted interpolation)
- Expected functionality missing: Users had reasonable expectation this should exist
- Quality issue: Software incomplete for its intended scientific use cases
This justifies inclusion in a maintenance release (1.0.3) rather than waiting for a minor version bump.
Related
- DataLab Issue #273: Same feature added to GUI
- Clarifies distinction from X-Y mode (which resamples/interpolates signals)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working