astropy / astropy/specutils

Spectral concatenation

Open
#318 5 comments 1 reaction 0 assignees View on GitHub
effort-low enhancement
Dominant language
Python
Stars
204
Forks
135
Avg merge
12h 55m
Merged PRs (30d)
1

Description

I think there is a need for a Spectrum1D concatenate method that takes some number of Spectrum1D objects and outputs a single one.

There are a lot of sketchy issues with that, but it could be useful for applying to the output of extract_region in order to get the one Spectrum1D.

Some issues:
- How to deal with different spectral axes units from the different components?
- I would suggest we convert all to the spectral_axis unit of the first Spectrum1D in the list
- How to deal with different flux units from the different components?
- I would suggest we convert all to the flux unit of the first Spectrum1D in the list
- Do we assume the list of Spectrum1D objects passed in are in the "correct order"? ie what do we do if the second Spectrum1D spectral axis is completely before the first?
- I would suggest the Spectrum1D objects be ordered based on the first spectral_axis value of each AND produce a warning to say we re-ordered
- How should we deal with overlapping Spectrum1D objects passed in?
- I think we should raise an Exception, for now, saying overlapping Spectrum1D objects can not be concatenated.

Based on some thoughts and discussion in https://github.com/astropy/specutils/pull/289#issuecomment-419448293

@eteq

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Spectrum1D API and the extract_region use case, then read the discussion linked from pull request #289. Resolve the open decisions about unit conversion, ordering, warnings, and overlap handling before implementing; done should include agreed behavior and coverage for those cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.