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

Error in logic of extract_pv_slice for WCS #52

Merged
merged 3 commits into from
Oct 7, 2014

Conversation

astrofrog
Copy link
Member

if cube is a Numpy array and WCS is passed, then WCS gets reset to None currently

@astrofrog
Copy link
Member Author

This also adds a regression test since it turns out this wasn't being tested.

@@ -110,3 +145,22 @@ def test_pv_slice_hdu_poly_path_no_nan(self, data):
path = Path([(1., -0.5), (1., 3.5)], width=0.001)
slice_hdu = extract_pv_slice(data, path, spacing=0.4, respect_nan=False)
assert_allclose(slice_hdu.data[0], np.array([1., 1., 1., 0., 0., 1., 2., 2., 0., 0.]))


@pytest.mark.parametrize('data', (make_test_hdu(), make_test_spectralcube(), make_test_data_wcs()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better here to pass the functions, then call the functions within test_output_wcs? In the current case, the functions are called at import time

astrofrog added a commit that referenced this pull request Oct 7, 2014
Error in logic of extract_pv_slice for WCS
@astrofrog astrofrog merged commit d26f85b into radio-astro-tools:master Oct 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants