Skip to content

MAST: Read product function for MastMissions#3593

Open
snbianco wants to merge 9 commits into
astropy:mainfrom
snbianco:read-product-mm
Open

MAST: Read product function for MastMissions#3593
snbianco wants to merge 9 commits into
astropy:mainfrom
snbianco:read-product-mm

Conversation

@snbianco

@snbianco snbianco commented May 18, 2026

Copy link
Copy Markdown
Contributor

A function in the MastMissions class that can read products into memory.

For FITS files, we use astropy.io.fits.open. The product files are downloaded and cached by Astropy, and then read into a HDUList object.

For ASDF files, we use fsspec and asdf. Our downloads for Roman data are redirected to S3, so these files are not downloaded and are streamed directly into asdf.AsdfFile objects.

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.46154% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.19%. Comparing base (70c49c0) to head (a5214b2).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/mast/missions.py 88.46% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3593      +/-   ##
==========================================
+ Coverage   73.17%   73.19%   +0.02%     
==========================================
  Files         227      227              
  Lines       21078    21118      +40     
==========================================
+ Hits        15423    15457      +34     
- Misses       5655     5661       +6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scfleming

Copy link
Copy Markdown

Until we have a more mature version ready, can we please ensure documentation / tutorials call out that for FITS files read_product() still downloads the file locally, so people working on Roman work who may want to use this to download HST or JWST FITS files aren't surprised if read_product() is using up credits writing to local cloud storage on them?

I presume this can be avoided once there's a "get_s3_uris()" endpoint in MissionMAST for all the supported missions beyond Roman?

@snbianco snbianco force-pushed the read-product-mm branch 2 times, most recently from 617201a to cdda4a2 Compare May 27, 2026 17:05
@snbianco snbianco marked this pull request as ready for review May 27, 2026 20:55

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code changes look good, but I have problem with the proposed changes in pyproject.toml, IMO we should avoid workaround for [all] and should not include optional dependencies to be installed for all the test jobs.

Comment thread pyproject.toml
"sphinx-astropy>=1.5",
"scipy",
"fsspec[http]",
"asdf"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is it used in the docs?

Comment thread pyproject.toml
Comment on lines -45 to +47
"fsspec[http]",
"fsspec[http,s3]",
"moto[s3]",
"s3fs",
"asdf"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that optional dependencies should be installed for all test runs. The fact that we have fsspec and s3fs listed here is a problem of its own and should be cleaned up. So, I would not think we should add asdf.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants