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_intro.md
+19-19Lines changed: 19 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,7 +58,7 @@ from astropy.table import Table
58
58
from astropy import units as u
59
59
from astropy.coordinates import SkyCoord
60
60
61
-
import pyvo
61
+
from astroquery.ipac.irsa import Irsa
62
62
from pyvo.dal.adhoc import DatalinkResults
63
63
64
64
from firefly_client import FireflyClient
@@ -73,31 +73,31 @@ Define some coordinates of interest.
73
73
```{code-cell} ipython3
74
74
ra_deg = 304.693508808
75
75
dec_deg = 42.4436872991
76
+
77
+
coord = SkyCoord(ra_deg, dec_deg, unit='deg')
78
+
search_radius = 1 * u.arcsec
76
79
```
77
80
78
-
Query IRSA for a list of Spectral Image MEFs that overlap this position.
81
+
Query IRSA for a list of Spectral Image MEFs that overlap this position. We use the [IRSA module in astroquery](https://astroquery.readthedocs.io/en/latest/ipac/irsa/irsa.html) and the Simple Image Access API.
79
82
80
-
```{code-cell} ipython3
81
-
# Define the TAP service URL for IRSA
82
-
tap_url = "https://irsa.ipac.caltech.edu/TAP"
83
+
+++
83
84
84
-
# Connect to the TAP service
85
-
service = pyvo.dal.TAPService(tap_url)
85
+
```{tip}
86
+
The IRSA SIA collections can be listed using using the ``list_collections`` method, we can filter on the ones containing "spherex" in the collection name:
86
87
87
-
# Define your ADQL query
88
-
query = "SELECT * FROM spherex.obscore WHERE CONTAINS(POINT('ICRS',"+str(ra_deg)+","+str(dec_deg)+"), s_region)=1"
88
+
Irsa.list_collections(filter='spherex')
89
+
```
89
90
90
-
# Submit the asynchronous query
91
-
job = service.submit_job(query)
91
+
+++
92
92
93
-
# Run the job (starts the query execution on the server)
Each row of the results of your query represents a different spectral image.
@@ -112,10 +112,10 @@ len(results)
112
112
The query results provide a lot of metadata about each spectral image. These columns have standard names as defined by the IVOA. Let's list them:
113
113
114
114
```{code-cell} ipython3
115
-
list(results.fieldnames)
115
+
results.colnames
116
116
```
117
117
118
-
The 'access_url' column is particularly important because it tells you how to access the data. Let's look at the 'access_url' value for the first row:
118
+
The `'access_url'` column is particularly important because it tells you how to access the data. Let's look at the `'access_url'` value for the first row:
0 commit comments