Searching for Mission-Specific Data with Astroquery#
Learning Goals#
By the end of this tutorial, you will:
Understand how to use the
astroquery.mast
module to access mission dataset metadata from MAST.Run metadata queries based on coordinates, an object name, or non-positional criteria.
Filter and download data products associated with datasets of interest.
Search for datasets from multiple missions and among High Level Science Products (HLSPs).
Table of Contents#
Introduction
Imports
Querying for Datasets from Missions-MAST
Search Parameters
Query by Object Name
Query by Region
Query by Criteria
Getting Data Products
Performing a Product Query
Filtering Data Products
Downloading Products
Exclusive Data Access
Switching Missions
Exercises
Exercise Solutions
Additional Resources
Introduction#
Welcome! This tutorial explores the capabilities of the astroquery.mast.MastMissions
class, a versatile tool for accessing and working with datasets hosted by the Mikulski Archive for Space Telescopes (MAST). MastMissions
is a Python wrapper for the MAST Search API, which allows you to search for mission-specific dataset metadata and data products. This data is also findable through the MAST Search UI.
The following missions/products are available for search as of January 2025:
Hubble Space Telescope (
hst
)James Webb Space Telescope (
jwst
)
In this notebook, we will walk through the basic workflow for searching datasets, retrieving data products, and downloading data products. This workflow will look very similar to the one used with the astroquery.mast.Observations
class, detailed in our “Searching MAST using astroquery.mast” notebook. There are a few key differences to note, and you should use the class that is best suited for your unique goals:
API:
MastMissions
uses the Mast Search API whileObservations
uses the MAST Portal API.Collection:
MastMissions
can only perform queries on a single collection, or “mission”, at a time.Observations
uses the Common Archive Observation Model (CAOM) and can run queries across every available observational collection at the same time.Filter Keywords:
MastMissions
has an extensive selection of mission-specific keywords to use while writing queries.Observations
is limited to the fields described by the CAOM and has no criteria with mission-specific meaning.
In summary, MastMissions
is well-suited for fast, mission-specific queries that might require a more extensive selection of filter keywords. Observations
is better for more broad, multi-mission searches.
Imports#
This notebook uses the following packages:
astropy to handle astronomical units and coordinate systems
astroquery.mast to query the MAST Archive
import astropy.units as u
from astropy.coordinates import SkyCoord
from astroquery.mast import MastMissions
Querying for Datasets from Missions-MAST#
In order to make queries on Missions-MAST metadata, we will have to perform some setup. We will initialize an object of the astroquery.mast.MastMissions
class and assign its mission
attribute. The object can be used to search mission dataset metadata by object name, sky position, or other criteria.
The default value for mission
is hst
, meaning that queries will be run on Hubble dataset metadata. The searchable metadata for Hubble encompasses all information that was previously accessible through the original HST web search form. The metadata for Hubble and all other available missions is also available through the MAST Search UI.
Later in the tutorial, we will learn how to change the mission
attribute to make queries on other missions.
# Create MastMissions object to search for Hubble datasets
missions = MastMissions(mission='hst')
missions.mission
'hst'
Search Parameters#
When writing queries, keyword arguments can be used to specify output characteristics and filter on fields like instrument, exposure type, and proposal ID. The available column names for a mission are returned by the get_column_list
function. Below, we will print out the name, data type, and description for the first 10 columns in HST metadata.
# Get available columns for HST mission
columns = missions.get_column_list()
columns[:10]
name | data_type | description |
---|---|---|
str22 | str9 | str226 |
search_pos | string | Search Position (RA and Dec) |
sci_data_set_name | string | Data set name, the first character indicates instrument; L=COS; I=WFC3; J=ACS; N=NICMOS; O=STIS; U=WFPC2; W=WFPC; X=FOC; Y=FOS; Z=GHRS; F=FGS; V=HSP; nine-character name (e.g. J8BA7JCAQ, O4140Q020) |
sci_targname | string | Target name designated by the observer for the HST proposal; Uppercase; No blank characters; Spaces sometimes filled with - ; (e.g. A901-FIELD-25, NGC4486-POS1, 0537-441INCA221-36, ALPHA-CEN) |
sci_hapnum | boolean | Reports if there are any Hubble Advanced Products (HAP), enter 0 for no, 1 for yes |
sci_haspnum | boolean | Reports if there are any Hubble Advanced Spectral Products (HASP), enter 0 for no, 1 for yes |
sci_instrume | string | Instrument used (e.g. ACS, COS, FGS, FOC, FOS, HRS, HSP, NICMOS, STIS, WFC3, WFPC, WFPC2) |
sci_aper_1234 | string | Aperture configuration; WFPC2 (e.g. PC1, WF3, WFALL); ACS (e.g. WFC, HRC, SBC); STIS (e.g. 25MAMA, F25QTZ) |
sci_spec_1234 | string | The filter(s) or grating(s) used (e.g. G160L, G270M, G230LB, F300W) |
sci_actual_duration | float | Exposure time in seconds |
sci_start_time | datetime | Observation start time; The earliest in-flight data is available from Apr 24 1990 |
We can refine our results even further with optional keyword arguments. The following parameters are available:
radius
: For positional searches only. Only return results within a certain distance from an object or set of coordinates. Default is 3 arcminutes.limit
: The maximum number of results to return. Default is 5000.offset
: Skip the first n results. Useful for paging through results.sort_by
: A list of field names to sort by.sort_desc
: A list of booleans (one for each field specified insort_by
), describing if each field should be sorted in descending order (True
) or ascending order (False
)select_cols
: A list of columns to be returned in the response.
As we walk through different types of queries, we will see these parameters in action!
Query by Object Name#
We’ve reached our first query! We can use object names to perform metadata queries using the query_object
function.
To start, let’s query for the Messier 1 object, a supernova remnant in the Taurus constellation. You may know it better as the Crab Nebula!
# Query for Messier 1 ('M1')
results = missions.query_object('M1')
# Display the first 5 results
print(f'Total number of results: {len(results)}')
results[:5]
Total number of results: 741
search_pos | sci_data_set_name | sci_targname | sci_hapnum | sci_haspnum | sci_instrume | sci_aper_1234 | sci_spec_1234 | sci_actual_duration | sci_start_time | sci_pep_id | sci_pi_last_name | sci_ra | sci_dec | sci_refnum | sci_central_wavelength | sci_release_date | sci_stop_time | sci_preview_name | scp_scan_type | sci_hlsp | ang_sep |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
str15 | str9 | str30 | int64 | int64 | str6 | str17 | str26 | float64 | str26 | int64 | str12 | float64 | float64 | int64 | float64 | str26 | str26 | str9 | str18 | int64 | str19 |
83.6324 22.0174 | J9FX01041 | CRAB | 1 | 0 | ACS | WFC1-POL120V | F606W;POL120V | 2300.0 | 2005-09-06T21:26:46.433000 | 10526 | HESTER | 83.63375381768 | 22.01859141895 | 5 | 5934.7896 | 2006-09-07T05:15:19.803000 | 2005-09-06T22:08:13.497000 | J9FX01041 | -- | -- | 0.10383123118898147 |
83.6324 22.0174 | J9FX02041 | CRAB | 1 | 0 | ACS | WFC1-POL120V | F606W;POL120V | 2300.0 | 2005-09-15T22:52:34.470000 | 10526 | HESTER | 83.63375394433 | 22.01859153345 | 5 | 5934.7886 | 2006-09-16T09:52:13.417000 | 2005-09-15T23:34:01.537000 | J9FX02041 | -- | -- | 0.1038410702845166 |
83.6324 22.0174 | J9FX03041 | CRAB | 1 | 0 | ACS | WFC1-POL120V | F606W;POL120V | 2300.0 | 2005-09-25T21:05:47.463000 | 10526 | HESTER | 83.63375408315 | 22.0185916581 | 5 | 5934.7871 | 2006-09-26T06:08:15.500000 | 2005-09-25T21:47:14.527000 | J9FX03041 | -- | -- | 0.10385181961996841 |
83.6324 22.0174 | J9FX04041 | CRAB | 1 | 0 | ACS | WFC1-POL120V | F606W;POL120V | 2300.0 | 2005-10-02T22:33:28.457000 | 10526 | HESTER | 83.63375418702 | 22.01859175078 | 5 | 5934.7866 | 2006-10-03T07:13:23.787000 | 2005-10-02T23:14:55.550000 | J9FX04041 | -- | -- | 0.10385983838178592 |
83.6324 22.0174 | J9FX05041 | CRAB | 1 | 0 | ACS | WFC1-POL120V | F606W;POL120V | 2000.0 | 2005-10-12T20:52:39.503000 | 10526 | HESTER | 83.63375434754 | 22.01859189305 | 5 | 5934.7852 | 2006-10-13T02:32:04.710000 | 2005-10-12T21:29:06.567000 | J9FX05041 | -- | -- | 0.10387219098736124 |
There were over 600 total results, meaning that hundreds of HST datasets were targeting the Crab Nebula. Now, let’s try refining our search a bit more.
Each dataset is associated with a celestial coordinate, given by
sci_ra
(right ascension) andsci_dec
(declination). By default, the query returns all datasets that fall within 3 arcminutes from the object’s coordinates. Let’s set theradius
parameter to be 1 arcminute instead.Say that we’re not interested in the first 4 results. We can assign
offset
to skip a certain number of rows.By default, a subset of recommended columns are returned for each query. However, we can specify exactly which columns to return using the
select_cols
keyword argument. Certain columns are included automatically, depending on the mission.
# Refined query for Messier 1 ('M1')
results = missions.query_object('M1',
radius=1, # Search within a 1 arcminute radius
offset=4, # Skip the first 4 results
select_cols=['sci_start_time', 'sci_pi_last_name']) # Select certain columns
# Display the first 5 results
print(f'Total number of results: {len(results)}')
results[:5]
Total number of results: 453
search_pos | sci_data_set_name | sci_targname | sci_start_time | sci_pi_last_name | ang_sep |
---|---|---|---|---|---|
str15 | str9 | str22 | str26 | str12 | str19 |
83.6324 22.0174 | J9FX05041 | CRAB | 2005-10-12T20:52:39.503000 | HESTER | 0.10387219098736124 |
83.6324 22.0174 | J9FX06041 | CRAB | 2005-10-22T20:40:28.510000 | HESTER | 0.10388689143244417 |
83.6324 22.0174 | J9FX07041 | CRAB | 2005-10-30T20:36:14.527000 | HESTER | 0.10390159755961832 |
83.6324 22.0174 | J9FX01011 | CRAB | 2005-09-06T16:41:38.433000 | HESTER | 0.10392027927762577 |
83.6324 22.0174 | J9FX01021 | CRAB | 2005-09-06T18:16:07.427000 | HESTER | 0.10392027927762577 |
Query by Region#
The missions
object also allows us to query by a region in the sky. By passing in a set of coordinates to the query_region
function, we can return datasets that fall within a certain radius
value of that point. This type of search is also known as a cone search.
# Create coordinate object
coords = SkyCoord(210.80227, 54.34895, unit=('deg'))
# Query for results within 10 arcseconds of coordinates
results = missions.query_region(coords,
radius=10 * u.arcsec)
# Display results
print(f'Total number of results: {len(results)}')
results[:5]
Total number of results: 19
search_pos | sci_data_set_name | sci_targname | sci_hapnum | sci_haspnum | sci_instrume | sci_aper_1234 | sci_spec_1234 | sci_actual_duration | sci_start_time | sci_pep_id | sci_pi_last_name | sci_ra | sci_dec | sci_refnum | sci_central_wavelength | sci_release_date | sci_stop_time | sci_preview_name | scp_scan_type | sci_hlsp | ang_sep |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
str18 | str9 | str16 | int64 | int64 | str6 | str4 | str5 | float64 | str26 | int64 | str8 | float64 | float64 | int64 | float64 | str19 | str26 | str9 | str1 | int64 | str20 |
210.80227 54.34895 | OBQU01050 | NUCLEUS+HODGE602 | 0 | 0 | STIS | 52X2 | G140L | 186.0 | 2012-05-24T07:51:40.553000 | 12556 | GORDON | 210.8018512676 | 54.34879151526 | 1 | 1425.0 | 2013-05-24T10:09:14 | 2012-05-24T07:54:46.553000 | OBQU01050 | -- | -- | 0.017460048037303017 |
210.80227 54.34895 | OBQU010H0 | NUCLEUS+HODGE602 | 0 | 0 | STIS | 52X2 | G230L | 186.0 | 2012-05-24T09:17:38.570000 | 12556 | GORDON | 210.8018512676 | 54.34879151526 | 1 | 2376.0 | 2013-05-24T13:15:15 | 2012-05-24T09:20:44.570000 | OBQU010H0 | -- | -- | 0.017460048037303017 |
210.80227 54.34895 | OBQU01030 | NUCLEUS+HODGE602 | 0 | 0 | STIS | 52X2 | G140L | 186.0 | 2012-05-24T07:43:20.553000 | 12556 | GORDON | 210.8020002958 | 54.34928391272 | 1 | 1425.0 | 2013-05-24T10:08:32 | 2012-05-24T07:46:26.553000 | OBQU01030 | -- | -- | 0.022143836477276503 |
210.80227 54.34895 | OBQU010F0 | NUCLEUS+HODGE602 | 0 | 0 | STIS | 52X2 | G230L | 186.0 | 2012-05-24T09:09:18.570000 | 12556 | GORDON | 210.8020002958 | 54.34928391272 | 1 | 2376.0 | 2013-05-24T13:15:05 | 2012-05-24T09:12:24.570000 | OBQU010F0 | -- | -- | 0.022143836477276503 |
210.80227 54.34895 | W1000501T | NGC5457-NUC | 0 | 0 | WFPC | P6 | F555W | 100.0 | 1992-07-16T06:31:16.517000 | 3639 | WESTPHAL | 210.802865 | 54.34933666666667 | 14 | 5479.0 | 1993-07-16T13:33:26 | 1992-07-16T06:32:56.517000 | W1000501T | -- | -- | 0.031163986021028572 |
The above datasets fall within our cone search. In other words, their target coordinates are within 10 arcseconds of the coordinates that we defined.
Query by Criteria#
In some cases, we may want to run queries with non-positional parameters. To accomplish this, we use the query_criteria
function.
For any of our query functions, we can filter our results by the value of columns in the dataset.
Let’s say that we want observations from HST’s Wide Field Camera 3 (WFC3) instument that use the F555W filter. We are only interested in datasets connected to proposal number 15879.
# Query with column criteria
results = missions.query_criteria(sci_instrume='WFC3', # From Wide Field Camera 3
sci_spec_1234='F555W', # Uses F555W filter
sci_pep_id=15879, # Proposal number 15879
select_cols=['sci_instrume', 'sci_spec_1234', 'sci_pep_id', 'sci_pi_last_name'])
# Display the first 5 results
print(f'Total number of results: {len(results)}')
results[:5]
Total number of results: 98
sci_data_set_name | sci_instrume | sci_spec_1234 | sci_pep_id | sci_pi_last_name |
---|---|---|---|---|
str9 | str6 | str5 | int64 | str5 |
IE37NAHHQ | WFC3 | F555W | 15879 | RIESS |
IE37NAHIQ | WFC3 | F555W | 15879 | RIESS |
IE37NBARQ | WFC3 | F555W | 15879 | RIESS |
IE37NBASQ | WFC3 | F555W | 15879 | RIESS |
IE37NBATQ | WFC3 | F555W | 15879 | RIESS |
To exclude and filter out a certain value from the results, we can prepend the value with !
.
Let’s run the same query as above, but this time, we will filter out datasets that use the F555W filter.
# Filtered query, excluding datasets using F555W filter
results = missions.query_criteria(sci_instrume='WFC3',
sci_spec_1234='!F555W', # Excludes datasets that use F555W filter
sci_pep_id=15879,
select_cols=['sci_instrume', 'sci_spec_1234', 'sci_pep_id', 'sci_pi_last_name'])
# Display the first 5 results
print(f'Total number of results: {len(results)}')
results[:5]
Total number of results: 236
sci_data_set_name | sci_instrume | sci_spec_1234 | sci_pep_id | sci_pi_last_name |
---|---|---|---|---|
str9 | str6 | str5 | int64 | str5 |
IE37NAHAQ | WFC3 | F153M | 15879 | RIESS |
IE37NAHEQ | WFC3 | F153M | 15879 | RIESS |
IE37NAHFQ | WFC3 | F160W | 15879 | RIESS |
IE37NAHGQ | WFC3 | F814W | 15879 | RIESS |
IE37NAHJQ | WFC3 | F814W | 15879 | RIESS |
We can also use wildcards on string criteria for more advanced filtering. Wildcards are special characters used in search patterns to represent one or more unknown characters, allowing for flexible matching of strings. The wildcard character is *
: it replaces any number of characters preceding, following, or in between the existing characters, depending on its placement.
Let’s use the same query from above, but we will add the condition that the target name must contain the string “GEM”.
# Filtered query with wildcard
results = missions.query_criteria(sci_instrume='WFC3',
sci_spec_1234='!F555W',
sci_pep_id=15879,
sci_targname='*GEM*', # Must contain the string 'GEM'
select_cols=['sci_instrume', 'sci_spec_1234', 'sci_pep_id', 'sci_pi_last_name'])
# Display the first 5 results
print(f'Total number of results: {len(results)}')
results[:5]
Total number of results: 5
sci_data_set_name | sci_targname | sci_instrume | sci_spec_1234 | sci_pep_id | sci_pi_last_name |
---|---|---|---|---|---|
str9 | str7 | str6 | str5 | int64 | str5 |
IE37OBBWQ | V-W-GEM | WFC3 | F153M | 15879 | RIESS |
IE37OBCGQ | V-W-GEM | WFC3 | F153M | 15879 | RIESS |
IE37OBCHQ | V-W-GEM | WFC3 | F160W | 15879 | RIESS |
IE37OBCIQ | V-W-GEM | WFC3 | F814W | 15879 | RIESS |
IE37OBCLQ | V-W-GEM | WFC3 | F814W | 15879 | RIESS |
To filter by multiple values for a single column, we use a string of the values delimited by commas.
To illustrate this, we will use a slightly different query. We query for WFC3 datasets from proposal 15879 that use either the F153M filter or the F160W filter.
# Filtered query with multiple values
results = missions.query_criteria(sci_instrume='WFC3',
sci_spec_1234='F153M, F160W', # Uses either F153M filter OR F160W filter
sci_pep_id=15879,
select_cols=['sci_instrume', 'sci_spec_1234', 'sci_pep_id', 'sci_pi_last_name'])
# Display the first 5 results
print(f'Total number of results: {len(results)}')
results[:5]
Total number of results: 138
sci_data_set_name | sci_instrume | sci_spec_1234 | sci_pep_id | sci_pi_last_name |
---|---|---|---|---|
str9 | str6 | str5 | int64 | str5 |
IE37NAHAQ | WFC3 | F153M | 15879 | RIESS |
IE37NAHEQ | WFC3 | F153M | 15879 | RIESS |
IE37NAHFQ | WFC3 | F160W | 15879 | RIESS |
IE37NBAMQ | WFC3 | F160W | 15879 | RIESS |
IE37NBANQ | WFC3 | F160W | 15879 | RIESS |
For columns with numeric or date values, we can filter using comparison values:
<
: Return values less than or before the given number/date>
: Return values greater than or after the given number/date<=
: Return values less than or equal to the given number/date>=
: Return values greater than or equal to the given number/date
As an example, let’s write a query to return all datasets with an observation date before May 1, 1990. These were some of Hubble’s first observations! We’ll use the optional sort_by
and sort_desc
keywords to sort our results in reverse chronological order.
# Query using comparison operator
results = missions.query_criteria(sci_start_time='<1990-05-01', # Must be observed before May 1, 1990
select_cols=['sci_start_time', 'sci_pep_id'],
sort_by=['sci_start_time'], # Sort by observation start time
sort_desc=[True]) # Sort in descending order
# Display the first 10 results
print(f'Total number of results: {len(results)}')
results[:10]
Total number of results: 196
sci_data_set_name | sci_start_time | sci_pep_id |
---|---|---|
str9 | str26 | int64 |
W0340Y01R | 1990-04-24T23:18:15.253000 | 1476 |
X1680B01T | 1990-04-24T23:17:59.053000 | 4107 |
X1681201T | 1990-04-24T23:17:59.053000 | 4107 |
X16I1N01T | 1990-04-24T23:17:59.053000 | 3801 |
X14W0401T | 1990-04-24T23:17:59.053000 | 3504 |
X14W0402T | 1990-04-24T23:17:59.053000 | 3504 |
X14W0403T | 1990-04-24T23:17:59.053000 | 3504 |
X14W0404T | 1990-04-24T23:17:59.053000 | 3504 |
X14W0405T | 1990-04-24T23:17:59.053000 | 3504 |
X14W0406T | 1990-04-24T23:17:59.053000 | 3504 |
For numeric or date data types, we can also filter with ranges. This requires the following syntax: '#..#'
.
Let’s write a query that uses range syntax to return datasets that have an exposure time between 5000 and 5005 seconds.
# Query using range operator
results = missions.query_criteria(sci_actual_duration='5000..5005', # Exposure duration is between 5000 and 5005 seconds
select_cols=['sci_pep_id', 'sci_actual_duration'])
# Display results
print(f'Total number of results: {len(results)}')
results[:10]
Total number of results: 133
sci_data_set_name | sci_actual_duration | sci_pep_id |
---|---|---|
str9 | float64 | int64 |
LC1203020 | 5000.768 | 12936 |
J95S15010 | 5000.0 | 10418 |
IC2B02090 | 5005.0 | 12875 |
IC3A05040 | 5000.0 | 13018 |
IC3A06040 | 5000.0 | 13018 |
IC3A07040 | 5000.0 | 13018 |
IE9T01020 | 5000.0 | 16274 |
IE9T02020 | 5000.0 | 16274 |
IE9T03020 | 5000.0 | 16274 |
IE9T04020 | 5000.0 | 16274 |
Wow, there’s a lot of tips and tricks for writing queries! Here’s a quick summary:
To exclude and filter out a certain value from the results, prepend the value with
!
.Wildcards are special characters used in search patterns to represent one or more unknown characters, allowing for flexible matching of strings. The wildcard character is
*
and it replaces any number of characters preceding, following, or in between existing characters, depending on its placement.To filter by multiple values for a single column, use a string of values delimited by commas.
For columns with numeric or date data types, filter using comparison values (
<
,>
,<=
,>=
).For columns with numeric or date data types, select a range with the syntax
'#..#'
.
Getting Data Products#
Performing a Product Query#
Each observation returned from a MAST query can have one or more associated data products. For example, a JWST observation might return an uncalibrated file, a guide-star file, and the actual science data.
For reproducibility, we’ll run another criteria query for datasets that use Hubble’s Advanced Camera for Surveys (ACS) instrument. We are interested in datasets connected to proposal number 12451 that are associated with at least one High Level Science Product.
# Query using range operator
datasets = missions.query_criteria(sci_pep_id=12451, # Proposal number 12451
sci_instrume='ACS', # Use ACS instrument
sci_hlsp='>1') # Associated with at least one HLSP
# Display results
print(f'Total number of results: {len(datasets)}')
datasets[:5]
Total number of results: 29
sci_data_set_name | sci_targname | sci_hapnum | sci_haspnum | sci_instrume | sci_aper_1234 | sci_spec_1234 | sci_actual_duration | sci_start_time | sci_pep_id | sci_pi_last_name | sci_ra | sci_dec | sci_refnum | sci_central_wavelength | sci_release_date | sci_stop_time | sci_preview_name | scp_scan_type | sci_hlsp |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
str9 | str18 | int64 | int64 | str6 | str7 | str14 | float64 | str26 | int64 | str7 | float64 | float64 | int64 | float64 | str19 | str26 | str9 | str1 | int64 |
JBTAA0010 | ABELL209 | 1 | 0 | ACS | WFC-FIX | F625W;CLEAR2L | 1032.0 | 2012-06-28T14:11:54.653000 | 12451 | POSTMAN | 22.96891666667 | -13.61122222222 | 36 | 6311.8481 | 2012-06-28T17:17:47 | 2012-06-28T14:31:45.717000 | JBTAA0010 | -- | 12 |
JBTAA0020 | ABELL209 | 1 | 0 | ACS | WFC-FIX | F850LP;CLEAR2L | 1035.0 | 2012-06-28T14:34:44.670000 | 12451 | POSTMAN | 22.96887414019 | -13.61118826361 | 36 | 9031.459 | 2012-06-28T17:47:50 | 2012-06-28T14:55:15.703000 | JBTAA0020 | -- | 12 |
JBTAA1010 | ABELL209 | 1 | 0 | ACS | WFC-FIX | F475W;CLEAR2L | 1032.0 | 2012-06-28T15:47:39.677000 | 12451 | POSTMAN | 22.96891666667 | -13.61122222222 | 36 | 4746.9565 | 2012-06-28T19:30:26 | 2012-06-28T16:07:30.710000 | JBTAA1010 | -- | 12 |
JBTAA1020 | ABELL209 | 1 | 0 | ACS | WFC-FIX | F775W;CLEAR2L | 1031.0 | 2012-06-28T16:10:33.660000 | 12451 | POSTMAN | 22.96887414019 | -13.61118826361 | 36 | 7693.4688 | 2012-06-28T19:10:46 | 2012-06-28T16:31:00.693000 | JBTAA1020 | -- | 12 |
JBTAA3010 | ABELL209 | 1 | 0 | ACS | WFC-FIX | F606W;CLEAR2L | 1032.0 | 2012-07-15T16:19:51.680000 | 12451 | POSTMAN | 22.96891666667 | -13.61122222222 | 36 | 5921.8911 | 2012-07-15T19:08:21 | 2012-07-15T16:39:42.713000 | JBTAA3010 | -- | 12 |
The get_product_list
function accepts a table of datasets or a list of dataset IDs and returns a table containing the associated data products. Let’s fetch the data products for the first three datasets in the table above.
# Get a list of data products
products = missions.get_product_list(datasets[:3])
# Display results
print(f'Total number of products: {len(products)}')
products[:5]
Total number of products: 309
product_key | access | dataset | instrument_name | filters | filename | uri | authz_primary_identifier | authz_secondary_identifier | file_suffix | category | size | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|
str66 | str6 | str9 | str6 | str14 | str56 | str66 | str42 | str3 | str15 | str14 | int64 | str9 |
JBTAA0010_jbtaa0010_asn.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | jbtaa0010_asn.fits | JBTAA0010/jbtaa0010_asn.fits | JBTAA0010 | ASN | ASN | AUX | 11520 | science |
JBTAA0010_jbtaa0010_trl.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | jbtaa0010_trl.fits | JBTAA0010/jbtaa0010_trl.fits | JBTAA0010 | CAL | TRL | AUX | 679680 | science |
JBTAA0010_jbtaa0010_drc.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | jbtaa0010_drc.fits | JBTAA0010/jbtaa0010_drc.fits | JBTAA0010 | CAL | DRC | CALIBRATED | 214660800 | science |
JBTAA0010_jbtaa0010_spt.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | jbtaa0010_spt.fits | JBTAA0010/jbtaa0010_spt.fits | JBTAA0010 | CAL | SPT | UNCALIBRATED | 86400 | science |
JBTAA0010_jbtaa0010_log.txt | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | jbtaa0010_log.txt | JBTAA0010/jbtaa0010_log.txt | JBTAA0010 | CAL | LOG | AUX | 224739 | science |
Some products can be associated with multiple datasets, and this table may contain duplicates. To return a list of products with only unique filenames, use the get_unique_product_list
function.
# Get products with unique filenames
unique_products = missions.get_unique_product_list(datasets[:3])
# Display results
unique_products[:5]
INFO: 26 of 309 products were duplicates. Only returning 283 unique product(s). [astroquery.mast.utils]
INFO: To return all products, use `MastMissions.get_product_list` [astroquery.mast.missions]
product_key | access | dataset | instrument_name | filters | filename | uri | authz_primary_identifier | authz_secondary_identifier | file_suffix | category | size | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|
str66 | str6 | str9 | str6 | str14 | str56 | str66 | str42 | str3 | str15 | str14 | int64 | str9 |
JBTAA0010_17717071j_osc.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | 17717071j_osc.fits | JBTAA0010/17717071j_osc.fits | OSC | REFERENCE | 17280 | reference | ||
JBTAA0010_25g1256nj_bpx.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | 25g1256nj_bpx.fits | JBTAA0010/25g1256nj_bpx.fits | BPX | REFERENCE | 23040 | reference | ||
JBTAA0010_37g1550cj_mdz.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | 37g1550cj_mdz.fits | JBTAA0010/37g1550cj_mdz.fits | MDZ | REFERENCE | 247680 | reference | ||
JBTAA0010_4af1559ij_imp.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | 4af1559ij_imp.fits | JBTAA0010/4af1559ij_imp.fits | IMP | REFERENCE | 953280 | reference | ||
JBTAA0010_4bb1536cj_idc.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | 4bb1536cj_idc.fits | JBTAA0010/4bb1536cj_idc.fits | IDC | REFERENCE | 285120 | reference |
Filtering Data Products#
These datasets returned quite a few products! We are not interested in all of them, and luckily, we have a handy function to filter them for us. filter_products
allows you to filter based on file extension (extension
) and any other of the product fields.
A quick note on filtering: the AND operation is performed for a list of filters, and the OR operation is performed within a filter set. For example, the filter below will return FITS products that are “science” type and have a file_suffix
of “ASN” (association files) or “JIF” (jitter information files).
# Filter products
filtered = missions.filter_products(products,
extension='fits', # FITS file extension
type='science', # Science data
file_suffix=['ASN', 'JIF']) # Association files OR jitter information files
# Display results
filtered
product_key | access | dataset | instrument_name | filters | filename | uri | authz_primary_identifier | authz_secondary_identifier | file_suffix | category | size | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|
str66 | str6 | str9 | str6 | str14 | str56 | str66 | str42 | str3 | str15 | str14 | int64 | str9 |
JBTAA0010_jbtaa0010_asn.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | jbtaa0010_asn.fits | JBTAA0010/jbtaa0010_asn.fits | JBTAA0010 | ASN | ASN | AUX | 11520 | science |
JBTAA0010_jbtaa0010_jif.fits | PUBLIC | JBTAA0010 | ACS | F625W;CLEAR2L | jbtaa0010_jif.fits | JBTAA0010/jbtaa0010_jif.fits | JBTAA0010 | OMS | JIF | JITTER/SUPPORT | 60480 | science |
JBTAA0020_jbtaa0020_asn.fits | PUBLIC | JBTAA0020 | ACS | F850LP;CLEAR2L | jbtaa0020_asn.fits | JBTAA0020/jbtaa0020_asn.fits | JBTAA0020 | ASN | ASN | AUX | 11520 | science |
JBTAA0020_jbtaa0020_jif.fits | PUBLIC | JBTAA0020 | ACS | F850LP;CLEAR2L | jbtaa0020_jif.fits | JBTAA0020/jbtaa0020_jif.fits | JBTAA0020 | OMS | JIF | JITTER/SUPPORT | 60480 | science |
JBTAA1010_jbtaa1010_asn.fits | PUBLIC | JBTAA1010 | ACS | F475W;CLEAR2L | jbtaa1010_asn.fits | JBTAA1010/jbtaa1010_asn.fits | JBTAA1010 | ASN | ASN | AUX | 11520 | science |
JBTAA1010_jbtaa1010_jif.fits | PUBLIC | JBTAA1010 | ACS | F475W;CLEAR2L | jbtaa1010_jif.fits | JBTAA1010/jbtaa1010_jif.fits | JBTAA1010 | OMS | JIF | JITTER/SUPPORT | 60480 | science |
Downloading Products#
The download_products
function accepts a table of products like the one above and will download the products to your local machine. By default, products will be downloaded into the current working directory, in a subdirectory called mastDownload
. The full local filepaths will have the form mastDownload/<mission>/<Dataset ID>/file.
You can change the download directory using the download_dir
parameter.
# Download products using filtered product Table
manifest = missions.download_products(filtered[:2])
# Display results
manifest
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=JBTAA0010%2Fjbtaa0010_asn.fits to mastDownload/hst/JBTAA0010/jbtaa0010_asn.fits ...
[Done]
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=JBTAA0010%2Fjbtaa0010_jif.fits to mastDownload/hst/JBTAA0010/jbtaa0010_jif.fits ...
[Done]
Local Path | Status | Message | URL |
---|---|---|---|
object | str8 | object | object |
mastDownload/hst/JBTAA0010/jbtaa0010_asn.fits | COMPLETE | None | None |
mastDownload/hst/JBTAA0010/jbtaa0010_jif.fits | COMPLETE | None | None |
For a more streamlined workflow, the function also accepts dataset IDs and product filters.
# Download products using dataset IDs and product filters
manifest = missions.download_products(['JBTAA0010', 'JBTAA0020'],
extension='fits',
type='science',
file_suffix=['ASN', 'JIF'])
# Display results
manifest
INFO: Found cached file mastDownload/hst/JBTAA0010/jbtaa0010_asn.fits with expected size 11520. [astroquery.query]
INFO: Found cached file mastDownload/hst/JBTAA0010/jbtaa0010_jif.fits with expected size 60480. [astroquery.query]
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=JBTAA0020%2Fjbtaa0020_asn.fits to mastDownload/hst/JBTAA0020/jbtaa0020_asn.fits ...
[Done]
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=JBTAA0020%2Fjbtaa0020_jif.fits to mastDownload/hst/JBTAA0020/jbtaa0020_jif.fits ...
[Done]
Local Path | Status | Message | URL |
---|---|---|---|
object | str8 | object | object |
mastDownload/hst/JBTAA0010/jbtaa0010_asn.fits | COMPLETE | None | None |
mastDownload/hst/JBTAA0010/jbtaa0010_jif.fits | COMPLETE | None | None |
mastDownload/hst/JBTAA0020/jbtaa0020_asn.fits | COMPLETE | None | None |
mastDownload/hst/JBTAA0020/jbtaa0020_jif.fits | COMPLETE | None | None |
To download a single data product file, use the download_file
function with a MAST URI as input.
The default is to download the file to the current working directory, but you can specify the download
directory or filepath with the local_path
keyword argument.
# Download a single data product
result = missions.download_file('JBTAA0010/jbtaa0010_asn.fits')
# Display result
result
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=JBTAA0010%2Fjbtaa0010_asn.fits to jbtaa0010_asn.fits ...
[Done]
('COMPLETE', None, None)
Exclusive Data Access#
Some data may not be publicly available and will require authentication and authorization. To download proprietary data with Astroquery, you will need a MyST Account with proper permissions. You will also need to provide an API token.
You can use the login
function to authenticate yourself. After uncommenting and executing the following cell, you should be prompted to enter your token.
# missions.login()
You can also provide a token to a MastMissions
object upon initialization using the mast_token
parameter. However, remember to be cautious with your API token. You should not share the token or check it into source control. For the best security, we recommend using the login
method to authenticate yourself.
Switching Missions#
As mentioned previously, each MastMissions
object can only make queries and download products from a single collection at a time. This collection can be modified with the mission
class attribute, which is case-insensitive. This allows users to query multiple collections with the same object.
To demonstrate, we’ll create a new MastMissions
object and initialize the mission
to be 'JWST'
. This will perform queries on dataset metadata from the James Webb Space Telescope.
multi_mission = MastMissions(mission='JWST')
multi_mission.mission
'jwst'
Next, we’ll query for JWST datasets around NGC 346, a young star cluster in the Small Magellanic Cloud. We’ll use a radius of 0.2 arcminutes.
# Query JWST for NGC 346
results = multi_mission.query_object('NGC 346',
radius=0.2) # Search within a 0.2 arcminute radius
# Display results
print(f'Total number of datasets: {len(results)}')
results[:5]
Total number of datasets: 169
ArchiveFileID | fileSetName | productLevel | targprop | targ_ra | targ_dec | instrume | exp_type | opticalElements | date_obs | duration | program | observtn | visit | publicReleaseDate | pi_name | proposal_type | proposal_cycle | targtype | access | ang_sep |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
int64 | str25 | str14 | str22 | float64 | float64 | str7 | str13 | str76 | str27 | float64 | int64 | int64 | int64 | str19 | str17 | str3 | int64 | str5 | str16 | float64 |
143912893 | jw01227001003_02101_00001 | 1b, 2a, 2b, 2c | NGC-346 | 14.77060458333333 | -72.16920833333336 | MIRI | MIR_IMAGE | F770W | 2022-10-10T07:43:23.1330000 | 77.701 | 1227 | 1 | 3 | 2023-10-11T03:40:56 | Meixner, Margaret | GTO | 1 | FIXED | PUBLIC | 0.0 |
143912790 | jw01227001003_02101_00002 | 1b, 2a, 2b, 2c | NGC-346 | 14.77060458333333 | -72.16920833333336 | MIRI | MIR_IMAGE | F770W | 2022-10-10T07:46:04.0930000 | 77.701 | 1227 | 1 | 3 | 2023-10-11T03:39:18 | Meixner, Margaret | GTO | 1 | FIXED | PUBLIC | 0.0 |
143912742 | jw01227001003_02101_00003 | 1b, 2a, 2b, 2c | NGC-346 | 14.77060458333333 | -72.16920833333336 | MIRI | MIR_IMAGE | F770W | 2022-10-10T07:48:42.3010000 | 77.701 | 1227 | 1 | 3 | 2023-10-11T03:39:23 | Meixner, Margaret | GTO | 1 | FIXED | PUBLIC | 0.0 |
143912909 | jw01227001003_02101_00004 | 1b, 2a, 2b, 2c | NGC-346 | 14.77060458333333 | -72.16920833333336 | MIRI | MIR_IMAGE | F770W | 2022-10-10T07:51:20.4450000 | 77.701 | 1227 | 1 | 3 | 2023-10-11T03:40:28 | Meixner, Margaret | GTO | 1 | FIXED | PUBLIC | 0.0 |
143912806 | jw01227001003_02103_00001 | 1b, 2a, 2b, 2c | NGC-346 | 14.77060458333333 | -72.16920833333336 | MIRI | MIR_IMAGE | F1000W | 2022-10-10T07:56:20.1650000 | 99.901 | 1227 | 1 | 3 | 2023-10-11T03:43:08 | Meixner, Margaret | GTO | 1 | FIXED | PUBLIC | 0.0 |
This query returned over 160 JWST datasets. Now, let’s try it with a different data collection. We’ll reassign the mission
attribute on the multi_mission
object to be 'ullyses'
and run the same query.
multi_mission.mission = 'ullyses'
multi_mission.mission
'ullyses'
# Query ULLYSES for NGC 346
results = multi_mission.query_object('NGC 346',
radius=0.2) # Search within a 0.2 arcminute radius
# Display results
print(f'Total number of datasets: {len(results)}')
results[:5]
Total number of datasets: 2
search_pos | target_id | names_search | target_name_hlsp | simbad_link | target_classification | targ_ra | targ_dec | host_galaxy_name | spectral_type | bmv0_mag | u_mag | b_mag | v_mag | gaia_g_mean_mag | star_mass | instrument | grating | filter | observation_id | ang_sep |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
str17 | int64 | str48 | str14 | str66 | str12 | float64 | float64 | str3 | str4 | float64 | float64 | float64 | float64 | float64 | float64 | str4 | str5 | str1 | str39 | str19 |
14.76833 -72.1775 | 55 | NGC346 MPG 396,Cl* NGC346 MPG 396,NGC346-MPG-396 | NGC346-MPG-396 | https://simbad.u-strasbg.fr/simbad/sim-id?Ident=Cl*+NGC346+MPG+396 | Mid O Dwarf | 14.762184457428036 | -72.17637442586573 | SMC | O7 V | -0.27 | 13.09 | 14.17 | 14.39 | 14.382007 | -- | COS | G160M | -- | hlsp_ullyses_hst_cos_ngc346-mpg-396_uv | 0.13152388757468492 |
14.76833 -72.1775 | 57 | NGC346 MPG 487,Cl* NGC346 MPG 487,NGC346-MPG-487 | NGC346-MPG-487 | https://simbad.u-strasbg.fr/simbad/sim-id?Ident=Cl*+NGC346+MPG+487 | Late O Dwarf | 14.778136436564196 | -72.17813531865009 | SMC | O8 V | -0.27 | 13.3 | 14.31 | 14.53 | 14.499837 | 25.7 | STIS | E140M | -- | hlsp_ullyses_hst_stis_ngc346-mpg-487_uv | 0.18407398702435046 |
Notice that this query returned only a few datasets. The result tables also look very different in terms of data and column keywords. This is because each query is being performed on a different data collection!
Exercises#
Exercise 1: It’s time to apply all that you’ve learned and try your hand at writing a MastMissions
query! Write a non-positional query based on the following:
Image observations
Instrument should NOT include the Cosmic Origins Spectrograph (COS)
Filter used is F150W, F105W, or F110W
Declination is greater than 0 degrees
Exposure time is between 1000 and 2000 seconds
Target name contains the string “GAL”
Skip the first 5 entries
Sort by exposure time in descending order
Limit the results to 3 datasets
# A non-positional query with column criteria
# results = missions.query_criteria(...) # Write your query here!
# Display results
# results
Exercise 2: Using your results from Exercise 1, download the association table data products for the 3 datasets (HINT: file_suffix = 'ASN'
). You can fetch, filter, and download the products as three separate steps, or use the streamlined workflow built in to download_products
.
# Fetch products from 3 datasets
# products = missions.get_product_list(...)
# Filter products
# filtered = missions.filter_products(...)
# Download products
# missions.download_products(...)
Exercise 3: Use a new MastMissions
object and the mission
attribute to search for datasets around the coordinate “22h57m39s -29d37m20s” from both HST and JWST. Use a radius of 0.1 arcminutes.
# Create new MastMissions object
#m = MastMissions()
# Create sky coordinate object
#coord = SkyCoord(...)
# Query HST metadata for region
#results = m.query_region(...)
# Display the first 5 results
#print(f'Total number of datasets: {len(results)}')
#results[:5]
# Switch mission to JWST
# ...
# Query JWST metadata for region
#results = m.query_region(...)
# Display the first 5 results
#print(f'Total number of datasets: {len(results)}')
#results[:5]
Exercise Solutions#
Exercise 1:
# A non-positional query with column criteria
results = missions.query_criteria(sci_obs_type='IMAGE',
sci_instrume='!COS',
sci_spec_1234='F150W, F105W, F110W',
sci_dec='>0',
sci_actual_duration='1000..2000',
sci_targname='*GAL*',
offset=5,
sort_by=['sci_actual_duration'],
sort_desc=[True],
limit=3)
# Display results
results
WARNING: MaxResultsWarning: Maximum results returned, may not include all sources within radius. [astroquery.mast.missions]
sci_data_set_name | sci_targname | sci_hapnum | sci_haspnum | sci_instrume | sci_aper_1234 | sci_spec_1234 | sci_actual_duration | sci_start_time | sci_pep_id | sci_pi_last_name | sci_ra | sci_dec | sci_refnum | sci_central_wavelength | sci_release_date | sci_stop_time | sci_preview_name | scp_scan_type | sci_hlsp |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
str9 | str27 | int64 | int64 | str6 | str6 | str5 | float64 | str26 | int64 | str6 | float64 | float64 | int64 | float64 | str19 | str26 | str9 | str1 | int64 |
N4A705010 | GAL-CLUS-0026+1653-ARCC | 0 | 0 | NICMOS | NIC1 | F110W | 1151.9038 | 1998-01-08T03:44:07.490000 | 7425 | TURNER | 6.657118050129 | 17.16004527511 | 0 | 11292.4 | 1999-01-08T19:47:33 | 1998-01-08T04:04:06.490000 | N4A705010 | -- | -- |
N4A703010 | GAL-CLUS-0026+1653-ARCD | 0 | 0 | NICMOS | NIC1 | F110W | 1151.9038 | 1997-10-31T14:20:31.493000 | 7425 | TURNER | 6.64289440364 | 17.16556874169 | 0 | 11292.4 | 1998-10-31T21:30:52 | 1997-10-31T14:40:30.493000 | N4A703010 | -- | -- |
IF9V31030 | VIRGO-INTERGALACTIC-FIELD-E | 1 | 0 | WFC3 | IR-FIX | F110W | 1058.805543 | 2023-12-14T15:40:25.307000 | 17510 | GREGG | 187.6896916667 | 12.99041111111 | 0 | 11534.459 | 2023-12-14T21:58:47 | 2023-12-14T16:08:42.237000 | IF9V31030 | -- | -- |
Exercise 2:
# As 3 separate steps
# Fetch products from first 3 datasets
products = missions.get_product_list(results)
# Filter products
filtered = missions.filter_products(products,
file_suffix='ASN')
# Download products
missions.download_products(filtered)
WARNING: MaxResultsWarning: Maximum results returned, may not include all sources within radius. [astroquery.mast.missions]
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=IF9V31030%2Fif9v31030_asn.fits to mastDownload/hst/IF9V31030/if9v31030_asn.fits ...
[Done]
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=N4A703010%2Fn4a703010_asn.fits to mastDownload/hst/N4A703010/n4a703010_asn.fits ...
[Done]
Downloading URL https://mast.stsci.edu/search/hst/api/v0.1/retrieve_product?product_name=N4A705010%2Fn4a705010_asn.fits to mastDownload/hst/N4A705010/n4a705010_asn.fits ...
[Done]
Local Path | Status | Message | URL |
---|---|---|---|
object | str8 | object | object |
mastDownload/hst/IF9V31030/if9v31030_asn.fits | COMPLETE | None | None |
mastDownload/hst/N4A703010/n4a703010_asn.fits | COMPLETE | None | None |
mastDownload/hst/N4A705010/n4a705010_asn.fits | COMPLETE | None | None |
# Streamlined
missions.download_products(results['sci_data_set_name'].tolist(),
file_suffix='ASN')
WARNING: MaxResultsWarning: Maximum results returned, may not include all sources within radius. [astroquery.mast.missions]
WARNING: MaxResultsWarning: Maximum results returned, may not include all sources within radius. [astroquery.mast.missions]
WARNING: MaxResultsWarning: Maximum results returned, may not include all sources within radius. [astroquery.mast.missions]
INFO: Found cached file mastDownload/hst/IF9V31030/if9v31030_asn.fits with expected size 11520. [astroquery.query]
INFO: Found cached file mastDownload/hst/N4A703010/n4a703010_asn.fits with expected size 11520. [astroquery.query]
INFO: Found cached file mastDownload/hst/N4A705010/n4a705010_asn.fits with expected size 11520. [astroquery.query]
Local Path | Status | Message | URL |
---|---|---|---|
object | str8 | object | object |
mastDownload/hst/IF9V31030/if9v31030_asn.fits | COMPLETE | None | None |
mastDownload/hst/N4A703010/n4a703010_asn.fits | COMPLETE | None | None |
mastDownload/hst/N4A705010/n4a705010_asn.fits | COMPLETE | None | None |
Exercise 3:
# Create new MastMissions object
m = MastMissions()
# Create sky coordinate object
coord = SkyCoord('22h57m39s -29d37m20s')
# Query HST metadata for region
results = m.query_region(coord,
radius=0.1)
# Display the first 5 results
print(f'Total number of datasets: {len(results)}')
results[:5]
Total number of datasets: 476
search_pos | sci_data_set_name | sci_targname | sci_hapnum | sci_haspnum | sci_instrume | sci_aper_1234 | sci_spec_1234 | sci_actual_duration | sci_start_time | sci_pep_id | sci_pi_last_name | sci_ra | sci_dec | sci_refnum | sci_central_wavelength | sci_release_date | sci_stop_time | sci_preview_name | scp_scan_type | sci_hlsp | ang_sep |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
str18 | str9 | str19 | int64 | int64 | str6 | str12 | str13 | float64 | str26 | int64 | str9 | float64 | float64 | int64 | float64 | str26 | str26 | str9 | str1 | int64 | str20 |
344.4125 -29.62222 | N4N92Q040 | HD216956 | 0 | 0 | NICMOS | NIC2-FIX | F222M | 255.923 | 1998-08-06T01:24:53.733000 | 7894 | HENRY | 344.4125879875 | -29.62214772201 | 8 | 22181.699 | 2000-07-04T20:12:32 | 1998-08-06T01:29:20.733000 | N4N92Q040 | -- | -- | 0.006314126839181508 |
344.4125 -29.62222 | N4N92Q030 | HD216956 | 0 | 0 | NICMOS | NIC2-FIX | F207M | 255.923 | 1998-08-06T01:19:59.733000 | 7894 | HENRY | 344.4125879884 | -29.62214772055 | 8 | 20824.1 | 2000-07-04T20:12:32 | 1998-08-06T01:24:26.733000 | N4N92Q030 | -- | -- | 0.00631422112268177 |
344.4125 -29.62222 | N4N92Q020 | HD216956 | 0 | 0 | NICMOS | NIC2-FIX | F180M | 127.92868 | 1998-08-06T01:17:16.733000 | 7894 | HENRY | 344.412587989 | -29.62214771973 | 8 | 17971.1 | 2000-07-04T20:12:32 | 1998-08-06T01:19:35.733000 | N4N92Q020 | -- | -- | 0.006314277659432727 |
344.4125 -29.62222 | N4N92Q010 | HD216956 | 0 | 0 | NICMOS | NIC2-FIX | F110W | 127.92868 | 1998-08-06T01:14:30.733000 | 7894 | HENRY | 344.4125879895 | -29.62214771891 | 8 | 11284.7 | 2000-07-04T20:12:32 | 1998-08-06T01:16:49.733000 | N4N92Q010 | -- | -- | 0.006314330409832213 |
344.4125 -29.62222 | Z3EJ0102T | HD216956 | 0 | 0 | HRS | 2.0 | MIRROR-A1 | 0.0 | 1996-09-30T08:18:34.937000 | 6627 | LALLEMENT | 344.4123659004 | -29.6221209983 | 0 | -- | 1997-09-30T22:45:42 | 1996-09-30T08:22:46.937000 | -- | -- | -- | 0.00917640457522127 |
# Switch mission to JWST
m.mission = 'JWST'
# Query JWST metadata for region
results = m.query_region(coord,
radius=0.1)
# Display the first 5 results
print(f'Total number of datasets: {len(results)}')
results[:5]
Total number of datasets: 67
ArchiveFileID | fileSetName | productLevel | targprop | targ_ra | targ_dec | instrume | exp_type | opticalElements | date_obs | duration | program | observtn | visit | publicReleaseDate | pi_name | proposal_type | proposal_cycle | targtype | access | ang_sep |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
int64 | str25 | str14 | str25 | float64 | float64 | str6 | str13 | str48 | str27 | float64 | int64 | int64 | int64 | str19 | str20 | str3 | int64 | str5 | str16 | float64 |
139989292 | jw01193006001_02101_00001 | 1b, 2a, 2b, 2c | FOMALHAUT | 344.4150901092018 | -29.62327928996265 | MIRI | MIR_IMAGE | F2550W | 2022-10-21T20:17:08.6000000 | 269.102 | 1193 | 6 | 1 | 2023-10-21T22:14:59 | Beichman, Charles A. | GTO | 1 | FIXED | PUBLIC | 0.0 |
139989097 | jw01193006001_02101_00002 | 1b, 2a, 2b, 2c | FOMALHAUT | 344.4150901103719 | -29.62327929047184 | MIRI | MIR_IMAGE | F2550W | 2022-10-21T20:22:59.8950000 | 269.102 | 1193 | 6 | 1 | 2023-10-21T22:12:51 | Beichman, Charles A. | GTO | 1 | FIXED | PUBLIC | 0.0 |
139993460 | jw01193006001_02101_00003 | 1b, 2a, 2b, 2c | FOMALHAUT | 344.415090111542 | -29.62327929098103 | MIRI | MIR_IMAGE | F2550W | 2022-10-21T20:28:51.1910000 | 269.102 | 1193 | 6 | 1 | 2023-10-21T22:12:48 | Beichman, Charles A. | GTO | 1 | FIXED | PUBLIC | 0.0 |
139989372 | jw01193006001_02101_00004 | 1b, 2a, 2b, 2c | FOMALHAUT | 344.4150901127151 | -29.62327929149152 | MIRI | MIR_IMAGE | F2550W | 2022-10-21T20:34:43.3830000 | 269.102 | 1193 | 6 | 1 | 2023-10-21T22:13:16 | Beichman, Charles A. | GTO | 1 | FIXED | PUBLIC | 0.0 |
139989260 | jw01193007001_02101_00001 | 1b, 2a, 2b | FOMALHAUT-COPY-MIRI-CORON | 344.4150901161078 | -29.62327929296791 | MIRI | MIR_TACQ | FND | 2022-10-21T20:53:55.8600000 | 1.296 | 1193 | 7 | 1 | 2023-10-22T07:32:01 | Beichman, Charles A. | GTO | 1 | FIXED | PUBLIC | 0.0 |
Additional Resources#
Citations#
If you use astroquery
for published research, please cite the
authors. Follow these links for more information about citing astroquery
:
About this Notebook#
Author(s): Sam Bianco
Keyword(s): Tutorial, Astroquery, MastMissions
First published: January 2025
Last updated: January 2025