Skip to main content

MASTQUERY

User-friendly tools for using the MAST Mashup API (https://mast.stsci.edu/api/v0/index.html)

Installation:

# From PIP
pip install mastquery

# *OR* from latest version of the respository
git clone https://github.com/gbrammer/mastquery.git
cd mastquery
pip install . 

Demo:

See also demo.ipynb.

>>> from mastquery import query, fetch

### Query associations
>>> tab = query.run_query(box=None, proposal_id=[11359],
                         instruments=['WFC3/IR'], 
                         filters=['G141'],
                         base_query=query.DEFAULT_QUERY)

>>> print(tab['obs_id', 'filter', 'exptime', 'proposal_id'])
  obs_id   filter  exptime  proposal_id
========   ======  =======  ===========
ib6o23010   G141    4211.7        11359

### Data products
>>> prod = query.get_products_table(tab, extensions=['RAW'])

>>> print(prod['observation_id', 'filter', 'productFilename'])
observation_id filter  productFilename  
============== ====== ==================
     ib6o23rsq   G141 ib6o23rsq_raw.fits
     ib6o23ruq   G141 ib6o23ruq_raw.fits
     ib6o23ryq   G141 ib6o23ryq_raw.fits
     ib6o23s0q   G141 ib6o23s0q_raw.fits
     
### Fetch products
>>> s3_lines = fetch.make_curl_script(prod, script_name=None, s3_sync=True)
>>> print(s3_lines[0])
aws s3 sync --request-payer requester --exclude="*.*" --include="*raw.fits" s3://stpubdata/hst/public/ib6o/ib6o23rsq/ .//

Release files for mastquery 1.8.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mastquery 1.8.8
File Size Uploaded
mastquery-1.8.8.tar.gz 308.9 kB Details

Release files / mastquery-1.8.8.tar.gz

Download URL mastquery-1.8.8.tar.gz
Size 308.9 kB
Tags Source
SHA-256 checksum
How to use checksums
23fd100e570d1d437b516d5379289cab96c1f02ecf51ca848c8ba9e79684a215
BLAKE2b-256 checksum
How to use checksums
04ea0d4e0d242203cbbbd25b86fa2406f95f97ce99f3ff4f24eca19a08807cad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.8.8 This release

1 release file

1.8.7

1 release file

1.8.6

1 release file

1.8.5

1 release file

1.8.2

1 release file

1.8.1

1 release file

1.8

1 release file

1.7.1

1 release file

1.7

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.1

1 release file

1.5

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page