-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compute spectral coverage in detail (fixes #212)
- Loading branch information
1 parent
90d99b6
commit 4895af1
Showing
3 changed files
with
83 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
import megaradrp.processing.extractobj as eobj | ||
|
||
|
||
def test_cover_1(): | ||
|
||
arr = [1, 1, 1, 1, 1, 1] | ||
res = eobj.coverage_det(arr) | ||
assert res == slice(0, 7) | ||
|
||
arr = [0, 0, 0, 0, 0, 0] | ||
res = eobj.coverage_det(arr) | ||
assert res == slice(0, 0) | ||
|
||
|
||
def test_cover_2(): | ||
|
||
arr = [0, 1, 1, 1, 0, 0] | ||
res = eobj.coverage_det(arr) | ||
assert res == slice(1, 4, None) | ||
|
||
arr = [0, 1, 1, 1, 1, 0] | ||
res = eobj.coverage_det(arr) | ||
assert res == slice(1, 5) | ||
|
||
arr = [0, 1, 1, 1, 1, 1] | ||
res = eobj.coverage_det(arr) | ||
assert res == slice(1, 7) | ||
|
||
arr = [1, 1, 1, 1, 1, 0] | ||
res = eobj.coverage_det(arr) | ||
assert res == slice(0, 5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters