Skip to content

Only works for spectra with increasing wavelength values?  #6

@swallstrom

Description

@swallstrom

Hello, I'm using your code to resample submm spectra where sometimes the channel width is negative, i.e. the spectrum runs from e.g. 400 km/s to -400 km/s instead of the other way around. This is pretty common for submm spectra, and normally doesn't make any difference to data reduction or analysis. However, using spectres I get outputs of all nans (or all 0 if I set fill=0). Flipping all the arrays works fine, but feels like it shouldn't be necessary... A fix would be nice, or at least a note in the documentation that this is a requirement of the input data!

For completeness, the problem-causing input spectrum is attached and I was using
new_wavs = np.flip(np.arange(-445, 390))

example_spec.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions