Skip to content

Commit

Permalink
Merge 64efb22 into f687076
Browse files Browse the repository at this point in the history
  • Loading branch information
eteq committed Dec 24, 2019
2 parents f687076 + 64efb22 commit c443a18
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 100 deletions.
7 changes: 1 addition & 6 deletions docs/manipulation.rst
Expand Up @@ -207,9 +207,6 @@ The resampling functionality detailed above is also the default way
:ref:`specutils <specutils>` supports splicing multiple spectra together into a
single spectrum. This can be achieved as follows:




.. plot::
:include-source:
:align: center
Expand All @@ -220,11 +217,9 @@ single spectrum. This can be achieved as follows:

>>> new_spectral_axis = np.concatenate([spec1.spectral_axis.value, spec2.spectral_axis.to_value(spec1.spectral_axis.unit)]) * spec1.spectral_axis.unit

>>> resampler = LinearInterpolatedResampler()
>>> resampler = LinearInterpolatedResampler(extrapolation_treatment='zero_fill')
>>> new_spec1 = resampler(spec1, new_spectral_axis)
>>> new_spec1.flux[np.isnan(new_spec1.flux)] = 0
>>> new_spec2 = resampler(spec2, new_spectral_axis)
>>> new_spec2.flux[np.isnan(new_spec2.flux)] = 0

>>> final_spec = new_spec1 + new_spec2

Expand Down

0 comments on commit c443a18

Please sign in to comment.