Skip to content

Commit

Permalink
Update docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Feb 7, 2024
1 parent 24b8a3e commit 4a7dd9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion specutils/manipulation/model_replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def model_replace(spectrum, replace_region, model=10, extrapolation_treatment='d
>>> input_spectrum = Spectrum1D(spectral_axis=wave_val * u.AA, flux=flux_val * u.mJy)
>>> spline_knots = [3.5, 4.7, 6.8, 7.1] * u.AA
>>> model_replace(input_spectrum, None, spline_knots)
<Spectrum1D(flux=<Quantity [ 2., 4., 6., 8., 10., 12., 14., 16., 18., 20.] mJy>, spectral_axis=<SpectralAxis [ 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.] Angstrom>)>
<Spectrum1D(flux: <Quantity [ 2., 4., 6., 8., 10., 12., 14., 16., 18., 20.] mJy>, mean=11.00000 mJy; spectral_axis: <SpectralAxis [ 1. 2. 3. ... 8. 9. 10.] Angstrom> (length=10))>
"""
if extrapolation_treatment not in ('data_fill', 'zero_fill'):
Expand Down
9 changes: 4 additions & 5 deletions specutils/manipulation/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ class FluxConservingResampler(ResamplerBase):
>>> resample_grid = [1, 5, 9, 13, 14, 17, 21, 22, 23] *u.nm
>>> fluxc_resample = FluxConservingResampler()
>>> fluxc_resample(input_spectra, resample_grid) # doctest: +FLOAT_CMP
<Spectrum1D(flux=<Quantity [ nan, 3. , 6. , 7. , 6.25, 10. , 20. , nan, nan] mJy>, spectral_axis=<SpectralAxis [ 1., 5., 9., 13., 14., 17., 21., 22., 23.] nm>)>
"""
<Spectrum1D(flux: <Quantity [ nan, 3. , 6. , 7. , 6.25, 10. , 20. , nan, nan] mJy>, mean=8.70833 mJy; spectral_axis: <SpectralAxis [ 1. 5. 9. ... 21. 22. 23.] nm> (length=9))> """

def _fluxc_resample(self, input_bin_centers, output_bin_centers,
input_bin_fluxes, errs):
Expand Down Expand Up @@ -323,7 +322,7 @@ class LinearInterpolatedResampler(ResamplerBase):
>>> resample_grid = [1, 5, 9, 13, 14, 17, 21, 22, 23] * u.nm
>>> fluxc_resample = LinearInterpolatedResampler()
>>> fluxc_resample(input_spectra, resample_grid) # doctest: +FLOAT_CMP
<Spectrum1D(flux=<Quantity [ nan, 3.5 , 5.5 , 6.75, 6.5 , 9.5 , nan, nan, nan] mJy>, spectral_axis=<SpectralAxis [ 1., 5., 9., 13., 14., 17., 21., 22., 23.] nm>)>
<Spectrum1D(flux: <Quantity [ nan, 3.5 , 5.5 , 6.75, 6.5 , 9.5 , nan, nan, nan] mJy>, mean=6.35000 mJy; spectral_axis: <SpectralAxis [ 1. 5. 9. ... 21. 22. 23.] nm> (length=9))>
"""
def __init__(self, extrapolation_treatment='nan_fill'):
Expand Down Expand Up @@ -399,8 +398,8 @@ class SplineInterpolatedResampler(ResamplerBase):
>>> resample_grid = [1, 5, 9, 13, 14, 17, 21, 22, 23] * u.nm
>>> fluxc_resample = SplineInterpolatedResampler()
>>> fluxc_resample(input_spectra, resample_grid) # doctest: +FLOAT_CMP
<Spectrum1D(flux=<Quantity [ nan, 3.98808594, 6.94042969, 6.45869141, 5.89921875,
7.29736328, nan, nan, nan] mJy>, spectral_axis=<SpectralAxis [ 1., 5., 9., 13., 14., 17., 21., 22., 23.] nm>)>
<Spectrum1D(flux: <Quantity [ nan, 3.98808594, 6.94042969, 6.45869141, 5.89921875,
7.29736328, nan, nan, nan] mJy>, mean=6.11676 mJy; spectral_axis: <SpectralAxis [ 1. 5. 9. ... 21. 22. 23.] nm> (length=9))>
"""
def __init__(self, bin_edges='nan_fill'):
Expand Down

0 comments on commit 4a7dd9d

Please sign in to comment.