Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Oct 15, 2024
1 parent 991bb32 commit 7375600
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions specutils/tests/test_region_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@


def test_region_simple(simulated_spectra):
np.random.seed(42)

spectrum = simulated_spectra.s1_um_mJy_e1
uncertainty = StdDevUncertainty(0.1*np.random.random(len(spectrum.flux))*u.mJy)
uncertainty = StdDevUncertainty(0.1*np.ones(len(spectrum.flux))*u.mJy)
spectrum.uncertainty = uncertainty

region = SpectralRegion(0.6*u.um, 0.8*u.um)
Expand Down Expand Up @@ -148,6 +147,16 @@ def test_region_ghz(simulated_spectra):
assert_quantity_allclose(sub_spectrum.flux, sub_spectrum_flux_expected)


def test_region_ghz_spectrum_wave(simulated_spectra):
spectrum = simulated_spectra.s1_um_mJy_e1
region = SpectralRegion(499654.09666667*u.GHz, 374740.5725*u.GHz)

sub_spectrum = extract_region(spectrum, region)

sub_spectrum_flux_expected = FLUX_ARRAY * u.mJy
assert_quantity_allclose(sub_spectrum.flux, sub_spectrum_flux_expected)


def test_region_simple_check_ends(simulated_spectra):
np.random.seed(42)

Expand Down

0 comments on commit 7375600

Please sign in to comment.