Date: Fri, 29 Mar 2024 01:32:03 -0400 (EDT) Message-ID: <915935663.2332.1711690323953@ploutercf.stsci.edu> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2331_1658690575.1711690323953" ------=_Part_2331_1658690575.1711690323953 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The Spectral DB API provides programmatic access for searching, an= d retrieving, the science pixels from level 3 JWST data products. This arti= cle provides a brief summary of the available API endpoints. See the comple= te API documentation for more de= tails.
On this page...
The global API URL is https://mast.stsci.edu/viz/api/v0.1/, which has the following endpoints:
The examples on this page assume basic knowledge of APIs and making HTTP= requests. For a refresher, see the Basics of an API<= /a>. Unless otherwise specified, all API calls and URLS on this page are HT= TP GET requests.
You can access the pixel level data for any level 3 JWST spectroscopic d= ata product, given a MAST DATA URI. Products currently supported are those = ending in "x1d", "c1d", "s2d", and "s3d". Use the endpoint https://mast.stsci.edu/spectra/a= pi/v0.1/retrieve, which accepts a URI query par= ameter with syntax "uri=3D[MAST_DATA_URI]". See the Retrieve API Documentation for complete details. The parameters returned by this endpoint, in J= SON format, are some status information about response, a dictionary of met= adata about the data columns returns, and a dictionary of array data. The p= ixel array data returned by this point matches the FITS extensions from the= Stage 3 Data Products, e.g. the x1d EXTRACT1D, or t= he s3d.
{=09 =09"status": 1,=20 =09"message": "Successfully found data for jw01039-o004_t001_miri_ch3-long_= x1d.fits", =09"uri": "mast:JWST/product/jw01039-o004_t001_miri_ch3-long_x1d.fits", =09"filename": "jw01039-o004_t001_miri_ch3-long_x1d.fits",=20 =09"column_metadata": { =09=09"wavelength": { =09=09=09"dtype": "float", "description": "wavelength values", "units": "um= ", "fitsExt": "WAVELENGTH"},=20 =09=09"flux": {...}, =09=09... =09=09}, =09"data": { =09=09"wavelength": [15.411499847425148, 15.414499847451225, ...], =09=09"flux": [0.31976015668259855, 0.32322893464617114,...], =09=09"fluxErr": [0.0003309399844085619, 0.00032996967321051527,...], =09=09... =09} }
All level 3 spectroscopic science data products are ingested into a new = Spectra Database. You can search the pixel-level information across these d= ata products, with a simple conditional syntax. Use the endpoint https://mast.stsci.edu/viz= /api/v0.1/search. See the Pixel Search API Documentation for complete deta= ils. This endpoint, in J= SON format, includes status information about the request, the string repre= sentation of the SQL query, and the a list of search results matching the s= earch criteria. Each item in the list of results represents a single data p= ixel matching your condition.
The pixel search API currently only supports searching on 1D (x1d) spect= roscopic data products. Support for 2D and 3D spectroscopic pixel searches = is coming soon.
Example: To search for 1d spectroscopic (x1d) JWST data prod= ucts that have a derived global SNR > 5 and a flux value >=3D 10 in t= he wavelength range of 1.2-1.3 microns, the URL route is https://ma= st.stsci.edu/spectra/api/v0.1/search?wavelength=3D1.2,1.3&flux.gte=3D10= &derSnr.gt=3D5
{ =09"status": 1,=20 =09"query": "select d.fileName, s.x, s.y, s.wavelength, s.flux, c.derSnr fr= om dbo.DataProduct as d join dbo.SpectralCharacteristics as c on d.DataProd= uctID=3Dc.DataProductID join dbo.SpectralPixel as s on d.DataProductID=3Ds.= DataProductID where d.productType =3D 'x1d' and s.wavelength between 1.2 an= d 1.3 and s.flux >=3D 10 and c.derSnr > 5 ;",=20 =09"results": [ =09 { =09=09"fileName": "jw01022-o015_t001_nirspec_g140h-f100lp_x1d.fits",=20 =09=09"x": 851,=20 =09=09"y": null,=20 =09=09"wavelength": 1.2000044446967135,=20 =09=09"flux": 185927662.84713414,=20 =09=09"derSnr": 34.39563686027962 =09 },=20 =09 { =09=09"fileName": "jw01022-o015_t001_nirspec_g140h-f100lp_x1d.fits", =09=09"x": 852,=20 =09=09"y": null, =09=09"wavelength": 1.200239444696234, =09 =09"flux": 186828761.36920592, =09=09"derSnr": 34.39563686027962 =09 }, =09 {"fileName": "jw01022-o015_t001_nirspec_g140h-f100lp_x1d.fits", =09=09"x": 853, "y": null, "wavelength": 1.2004744446957543, =09=09"flux": 172866204.10833856,=20 =09=09"derSnr": 34.39563686027962 =09 }, =09 {...}, =09] }