Skip to content

Commit

Permalink
Add test on a fits image (currently fails)
Browse files Browse the repository at this point in the history
  • Loading branch information
bamford committed Nov 29, 2024
1 parent 56ef473 commit 6946271
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_fits.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@
var = os.path.join(testdir, "variable_length_table.fits")


def test_image():
# this one directly hits a remote server - should cache?
url = "https://fits.gsfc.nasa.gov/samples/WFPC2ASSNu5780205bx.fits"
out = kerchunk.fits.process_file(url)
m = fsspec.get_mapper("reference://", fo=out, remote_protocol="https")
g = zarr.open(m)
arr = g["PRIMARY"][:]
with fsspec.open(
"https://fits.gsfc.nasa.gov/samples/WFPC2ASSNu5780205bx.fits"
) as f:
hdu = fits.getdata(f)
assert (hdu == arr).all()


def test_ascii_table():
# this one directly hits a remote server - should cache?
url = "https://fits.gsfc.nasa.gov/samples/WFPC2u5780205r_c0fx.fits"
Expand Down

0 comments on commit 6946271

Please sign in to comment.