astropy / astropy/specutils

Spectrum1D convenience method to resample

Open
#1,000 0 comments 0 reactions 0 assignees View on GitHub
feature
Dominant language
Python
Stars
204
Forks
135
Avg merge
12h 55m
Merged PRs (30d)
1

Description

Basically https://specutils.readthedocs.io/en/stable/manipulation.html#resampling on existing Spectrum1D object without having to do all the extra steps in `manipulation` separately and then create a new Spectrum1D object.

Possible API (not saying this is the best but to show you more what I mean):

```python
>>> from astropy import units as u
>>> from specutils import Spectrum1D
>>> sp = Spectrum1D(spectral_axis=[1000, 2000] * u.AA, flux=[1, 2] * u.nJy)
>>> sp.sample(1500 * u.AA, sampler='linear_interpolation') # Input wavelength can also be array

```

Contributor guide

Open the contributing guide

Research direction

Start with the resampling section of the manipulation documentation and the existing Spectrum1D API. Determine how a convenience method could expose the documented resampling behavior on an existing object; done should cover the proposed scalar and array wavelength inputs and the linear_interpolation sampler.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.