-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab25419
commit f36daaf
Showing
4 changed files
with
78 additions
and
10 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 |
---|---|---|
@@ -1,13 +1,22 @@ | ||
from pathlib import Path | ||
from tempfile import NamedTemporaryFile | ||
|
||
import numpy as np | ||
|
||
from ..skymap import Skymap | ||
|
||
path_to_test_skymap = Path(__file__).parent.resolve() / "resources" / "skymap.fits" | ||
|
||
|
||
def test_read(): | ||
values = Skymap.from_fits( | ||
Path(__file__).parent.resolve() / "resources" / "skymap.fits" | ||
).values | ||
values = Skymap.from_fits(path_to_test_skymap).values | ||
assert values.dtype == np.int32 | ||
assert len(values) == 49152 | ||
|
||
|
||
def test_read_write_read_conservation(): | ||
skymap = Skymap.from_fits(path_to_test_skymap) | ||
with NamedTemporaryFile() as fp: | ||
skymap.to_fits(fp.name) | ||
skymap2 = Skymap.from_fits(fp.name) | ||
assert all(skymap.values == skymap2.values) |
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