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

Provide helpers for working with boolean slices #278

Open
Cadair opened this issue Jul 21, 2023 · 0 comments
Open

Provide helpers for working with boolean slices #278

Cadair opened this issue Jul 21, 2023 · 0 comments

Comments

@Cadair
Copy link
Member

Cadair commented Jul 21, 2023

NDCube for good reasons does not support slicing via a boolean array. However, a common pattern with Dataset is to generate a boolean array from logical operations on the headers table.
Therefore I think we should provide two helpers:

  • files.slice_by_boolean_array which will let you slice to a single contiguous region of the Dataset based on a boolean slice.
  • files.download_from_boolean_array which will only download FITS files where the array slice is true.
    (names tbd)

The slice_by_boolean_array could have options for how it changes the array into a contiguous slice, it could do first block, largest block containing all true elements etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant