Skip to content

Commit cdda4a2

Browse files
committed
Update docs, fix oldestdeps test
1 parent 90978df commit cdda4a2

4 files changed

Lines changed: 13 additions & 8 deletions

File tree

astroquery/mast/missions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,10 @@ def download_products(self, products, *, download_dir=None, flat=False,
990990
def read_product(self, uri, *, mission=None, **kwargs):
991991
"""
992992
Reads a data product file directly from a URI into an appropriate in-memory object based on file type.
993+
Supported file types are FITS and ASDF.
994+
995+
FITS files are opened with `~astropy.io.fits.open` and are downloaded and cached on disk. ASDF files
996+
are opened directly from the presigned S3 URL using `fsspec` and `asdf`, without being downloaded to disk.
993997
994998
Parameters
995999
----------

astroquery/mast/tests/test_mast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ def mock_asdf_open(mocker):
782782
mocker.patch("fsspec.filesystem", return_value=mock_fs)
783783

784784
# Create a mock AsdfFile
785-
mock_asdf_file = asdf.AsdfFile()
785+
mock_asdf_file = MagicMock(spec=asdf.AsdfFile)
786786

787787
return mocker.patch("asdf.open", return_value=mock_asdf_file)
788788

docs/mast/mast_missions.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,15 @@ The filter below returns FITS products that are "science" type **and** less than
330330
Reading Data Products
331331
======================
332332

333-
The `~astroquery.mast.MastMissionsClass.read_product` function allows you to read a data product directly into memory as an `~astropy.io.fits.HDUList`
334-
or an `~asdf.AsdfFile` object. The function accepts a product URI or a direct filename (for certain missions) as input.
333+
The `~astroquery.mast.MastMissionsClass.read_product` function allows you to read FITS or ASDF data products directly into memory as `~astropy.io.fits.HDUList`
334+
or `~asdf.AsdfFile` objects, respectively. The function accepts a product URI or a direct filename (for certain missions) as input.
335335

336-
Products from the Roman Space Telescope mission are returned as ASDF files and can be read into memory as `~asdf.AsdfFile` objects.
337-
This requires the `~asdf` and ``fsspec`` packages to be installed. Other optional packages for reading products may be required depending on the product
338-
type and file format. These packages are ``gwcs``, ``lz4``, and ``roman_datamodels``. To install astroquery with all optional dependencies,
339-
use ``pip install astroquery[all]``.
336+
FITS files are opened with `~astropy.io.fits.open` and are downloaded and cached locally.
337+
338+
ASDF products from the Roman Space Telescope mission are opened directly as `~asdf.AsdfFile` objects from presigned S3 URLs,
339+
without being downloaded locally. This requires the `~asdf` and `~fsspec` packages to be installed. Other optional packages for
340+
reading products may be required depending on the product type and file format. These packages are ``gwcs``, ``lz4``, and ``roman_datamodels``.
341+
To install astroquery with all optional dependencies, use ``pip install astroquery[all]``.
340342

341343
Remember that this method returns an open file object, so it is the user's responsibility to close the file when finished. This can be done
342344
with a context manager or by calling the ``close()`` method on the returned object.

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ deps =
5353
oldestdeps-alldeps: mocpy==0.12
5454
oldestdeps-alldeps: regions==0.5
5555
oldestdeps-alldeps: astropy-healpix==0.7
56-
oldestdeps-alldeps: roman_datamodels==0.11
5756
oldestdeps-alldeps: gwcs==0.18
5857

5958
online: pytest-custom_exit_code

0 commit comments

Comments
 (0)