Skip to content

fix(codecs): correct wavelength padding key in pad_spectrum#68

Closed
hopeful0 wants to merge 1 commit into
PolymathicAI:mainfrom
hopeful0:fix/spectrum-pad-wavelength-sentinel
Closed

fix(codecs): correct wavelength padding key in pad_spectrum#68
hopeful0 wants to merge 1 commit into
PolymathicAI:mainfrom
hopeful0:fix/spectrum-pad-wavelength-sentinel

Conversation

@hopeful0
Copy link
Copy Markdown

While using the SDSS spectrum codec, I kept seeing failures consistent with #61 even after #64 landed. Tracing the encode path showed that pad_spectrum (introduced in #64) pads flux, ivar, mask, and wavelength, but padding_values still used the key "lambda". Because the modality field is wavelength, those padded positions were filled with 0 instead of the intended 99999 sentinel.

This change updates the dict key to "wavelength" so padded wavelength bins match the other fields.

@hopeful0
Copy link
Copy Markdown
Author

hopeful0 commented May 13, 2026

It seems the issue is that pad_spectrum uses right padding, and padding wavelenght with 0 disrupts the monotonic increasing property of the wavelengths, causing encoding errors

@tom-hehir
Copy link
Copy Markdown
Contributor

Hi @hopeful0, thank you very much for identifying this! We also ran into this issue and just pushed a fix on commit 3434e31 (latest commit on main). Apologies that we only saw this issue after pushing the fix, otherwise we could have just merged this PR! Thank you for sending in the fix anyway :)

@tom-hehir tom-hehir closed this May 27, 2026
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.

2 participants