Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: LDO use filled data #540

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Onedspec fill value test
e-koch committed Mar 2, 2019
commit e6b7de46e9952cf0c8d39b8e8e385f513773c027
16 changes: 16 additions & 0 deletions spectral_cube/tests/test_projection.py
Original file line number Diff line number Diff line change
@@ -141,6 +141,22 @@ def test_proj_with_fillvalue(LDO, data):
assert mask.sum() == 1
assert not hasattr(mask, 'unit')

def test_ondespec_with_fillvalue():
# Check that np.isnan strips units

spec = twelve_qty_1d.copy()
spec[5] = np.nan
p = OneDSpectrum(spec, copy=False)

p0 = p.with_fill_value(0.)

assert np.isfinite(p0.filled_data[:]).all()

mask = np.isnan(p)

assert mask.sum() == 1
assert not hasattr(mask, 'unit')

@pytest.mark.parametrize(('LDO', 'data'),
zip(LDOs, data_twelve))
def test_self_arith(LDO, data):