You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/spherex/spherex_cutouts.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The following packages must be installed to run this notebook.
44
44
```
45
45
46
46
```{code-cell} ipython3
47
-
import concurrent
47
+
import concurrent.futures
48
48
import time
49
49
50
50
import astropy.units as u
@@ -101,11 +101,11 @@ service = pyvo.dal.TAPService("https://irsa.ipac.caltech.edu/TAP")
101
101
# Sort by observation time.
102
102
query = f"""
103
103
SELECT
104
-
'https://irsa.ipac.caltech.edu/' || a.uri || '?center={ra.to(u.degree).value},{dec.to(u.degree).value}d&size={size.to(u.degree).value}' AS uri,
104
+
'https://irsa.ipac.caltech.edu/' || a.uri || '?center={ra.value},{dec.value}d&size={size.value}' AS uri,
105
105
p.time_bounds_lower
106
106
FROM spherex.artifact a
107
107
JOIN spherex.plane p ON a.planeid = p.planeid
108
-
WHERE 1 = CONTAINS(POINT('ICRS', {ra.to(u.degree).value}, {dec.to(u.degree).value}), p.poly)
108
+
WHERE 1 = CONTAINS(POINT('ICRS', {ra.value}, {dec.value}), p.poly)
109
109
AND p.energy_bandpassname = '{bandpass}'
110
110
ORDER BY p.time_bounds_lower
111
111
"""
@@ -117,6 +117,11 @@ print("Time to do TAP query: {:2.2f} seconds.".format(time.time() - t1))
117
117
print("Number of images found: {}".format(len(results)))
118
118
```
119
119
120
+
:::{note}
121
+
SPHEREx data are also available via SIA which can provide a simpler interface for many queries, as demonstrated in {ref}`spherex-intro`.
122
+
An advantage of the method shown above is that it provides access to data immediately after ingestion (which occurs weekly) and is not subject to the same ~1 day delay as SIA.
123
+
:::
124
+
120
125
## 6. Define a function that processes a list of SPHEREx Spectral Image Cutouts
121
126
122
127
This function takes in a row of the catalog that we created above and does the following:
@@ -91,16 +92,22 @@ The IRSA SIA collections can be listed using using the ``list_collections`` meth
91
92
+++
92
93
93
94
The collections are documented at [SPHEREx Data Access: Application Program Interfaces (APIs)](https://caltech-ipac.github.io/spherex-archive-documentation/spherex-data-access#application-program-interfaces-apis)
94
-
There are currently three collections available:
95
+
There are currently three collections available for the second Quick Release:
95
96
96
-
*`'spherex_qr'` -- Quick Release Spectral Image MEFs that are part of the SPHEREx **Wide Survey**
Due to the nature of the ingestion process, availability via SIA will lag on the order of a day.
108
+
To avoid this delay, users can access data through the browsable directories or the SPHEREx Data Explorer GUI (see [SPHEREx Data Access](https://caltech-ipac.github.io/spherex-archive-documentation/spherex-data-access)), or do a TAP query as shown in {ref}`spherex-cutouts`.
109
+
:::
110
+
104
111
Each row of the results of your query represents a different spectral image.
105
112
Because SPHEREx data will be released on a weekly basis, the number of rows returned will change
106
113
depending on when you submit the query.
@@ -168,7 +175,7 @@ fc.reinit_viewer()
168
175
Visualize a spectral image MEF by sending its URL to the viewer.
169
176
170
177
```{code-cell} ipython3
171
-
fc.show_fits(url=spectral_image_url,
178
+
fc.show_fits_image(file_input=spectral_image_url,
172
179
plot_id="spectral_image",
173
180
Title="Spectral Image"
174
181
)
@@ -219,7 +226,7 @@ The main WCS describes the astrometric registration of the image, including opti
Copy file name to clipboardExpand all lines: tutorials/spherex/spherex_psf.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ Both should be defined using `astropy` units.
70
70
The goal is to obtain the cutout and then extract the PSF corresponding to the coordinates of interest.
71
71
72
72
```{tip}
73
-
To learn more about how to access SPHEREx spectral images and how to download cutouts, we refer to the [SPHEREx Intro Tutorial](spherex-intro) and the [SPHEREx Cutouts Tutorial](spherex-cutouts).
73
+
To learn more about how to access SPHEREx spectral images and how to download cutouts, we refer to the [SPHEREx Intro Tutorial](#spherex-intro) and the [SPHEREx Cutouts Tutorial](#spherex-cutouts).
74
74
```
75
75
76
76
```{code-cell} ipython3
@@ -92,11 +92,11 @@ service = pyvo.dal.TAPService("https://irsa.ipac.caltech.edu/TAP")
92
92
# Sort by observation time.
93
93
query = f"""
94
94
SELECT
95
-
'https://irsa.ipac.caltech.edu/' || a.uri || '?center={ra.to(u.degree).value},{dec.to(u.degree).value}d&size={size.to(u.degree).value}' AS uri,
95
+
'https://irsa.ipac.caltech.edu/' || a.uri || '?center={ra.value},{dec.value}d&size={size.value}' AS uri,
96
96
p.time_bounds_lower
97
97
FROM spherex.artifact a
98
98
JOIN spherex.plane p ON a.planeid = p.planeid
99
-
WHERE 1 = CONTAINS(POINT('ICRS', {ra.to(u.degree).value}, {dec.to(u.degree).value}), p.poly)
99
+
WHERE 1 = CONTAINS(POINT('ICRS', {ra.value}, {dec.value}), p.poly)
100
100
ORDER BY p.time_bounds_lower
101
101
"""
102
102
@@ -107,6 +107,11 @@ print("Time to do TAP query: {:2.2f} seconds.".format(time.time() - t1))
107
107
print("Number of images found: {}".format(len(results)))
108
108
```
109
109
110
+
:::{note}
111
+
SPHEREx data are also available via SIA which can provide a simpler interface for many queries, as demonstrated in {ref}`spherex-intro`.
112
+
An advantage of the method shown above is that it provides access to data immediately after ingestion (which occurs weekly) and is not subject to the same ~1 day delay as SIA.
113
+
:::
114
+
110
115
For this example, we focus on the first one of the retrieved SPHEREx spectral images.
111
116
112
117
```{code-cell} ipython3
@@ -176,7 +181,7 @@ We do this by first determining the pixel (x,y) coordinates of our coordinates o
0 commit comments