@@ -11,33 +11,31 @@ This is a python interface for querying the
11
11
`HEASARC <https://heasarc.gsfc.nasa.gov/ >`__
12
12
archive web service.
13
13
14
- There are two interfaces for the Heasarc services:``heasarc.Heasac `` and
15
- ``heasarc.Xamin ``. The first uses the classical Browse interface, and offers
16
- limited search capabilities. The second uses the new ``Xamin `` interface,
17
- which relies on the Virtual Observatory protocols. It offser more powerful
18
- search options.
14
+ There main interface for the Heasarc services``heasarc.Heasac`` now uses
15
+ Virtual Observatory protocols with the Xamin interface, which offers
16
+ more powerful search options than the old Browse interface.
19
17
20
- - :ref: `Heasarc Xamin Interface `.
18
+ - :ref: `Heasarc Main ( Xamin) Interface `.
21
19
- :ref: `Old Browse Interface `.
22
20
23
- .. _Heasarc Xamin Interface :
21
+ .. _Heasarc Main Interface :
24
22
25
- Heasarc Xamin Interface
23
+ Heasarc Main Interface
26
24
=======================
27
25
28
26
Query a Table
29
27
-------------
30
- The basic use case is one where you wants to query a table from some position in the sky.
31
- In this example, we query the NuSTAR master table ``numaster `` table for all observations
28
+ The basic use case is one where we wants to query a table from some position in the sky.
29
+ In this example, we query the NuSTAR master table ``numaster `` for all observations
32
30
of the AGN ``NGC 3783 ``. We use `~astropy.coordinates.SkyCoord ` to obtain the coordinates
33
- and then pass them to `~astroquery.heasarc.HeasarcXaminClass .query_region `:
31
+ and then pass them to `~astroquery.heasarc.HeasarcClass .query_region `:
34
32
35
33
.. doctest-remote-data ::
36
34
37
- >>> from astroquery.heasarc import Xamin
35
+ >>> from astroquery.heasarc import Heasarc
38
36
>>> from astropy.coordinates import SkyCoord
39
37
>>> pos = SkyCoord.from_name(' ngc 3783' )
40
- >>> tab = Xamin .query_region(pos, table = ' numaster' )
38
+ >>> tab = Heasarc .query_region(pos, table = ' numaster' )
41
39
>>> tab[' name' , ' obsid' , ' ra' , ' dec' ][:3 ].pprint()
42
40
name obsid ra dec
43
41
deg deg
@@ -46,16 +44,16 @@ and then pass them to `~astroquery.heasarc.HeasarcXaminClass.query_region`:
46
44
NGC_3783 60901023 174.7571 -37.7385
47
45
NGC_3783 60902005 174.7571 -37.7385
48
46
49
- To query a region around some position, specifying the search radius.
50
- You use `~astropy.units `:
47
+ To query a region around some position, specifying the search radius,
48
+ we use `~astropy.units `:
51
49
52
50
.. doctest-remote-data ::
53
51
54
- >>> from astroquery.heasarc import Xamin
52
+ >>> from astroquery.heasarc import Heasac
55
53
>>> from astropy.coordinates import SkyCoord
56
54
>>> from astropy import units as u
57
55
>>> pos = SkyCoord(' 120 38' , unit = u.deg)
58
- >>> tab = Xamin .query_region(pos, table = ' chanmaster' , radius = 2 * u.deg)
56
+ >>> tab = Heasac .query_region(pos, table = ' chanmaster' , radius = 2 * u.deg)
59
57
>>> tab[' name' , ' obsid' , ' ra' , ' dec' ][:5 ].pprint()
60
58
name obsid ra dec
61
59
deg deg
@@ -66,25 +64,34 @@ You use `~astropy.units`:
66
64
1RXS J075526.1+391111 13008 118.85875 39.18639
67
65
SDSS J080040.77+391700.5 18110 120.17000 39.28344
68
66
69
- The list of requested tables can also be passed to `~~astroquery.heasarc.HeasarcXaminClass.query_region `:
67
+ If no radius value is given, a default that is appropriate
68
+ for each table is used. You can see the value of the default
69
+ radius values by calling `~~astroquery.heasarc.HeasarcClass.get_default_radius `,
70
+ passing the name of the table.
71
+
72
+ The list of returned columns can also be given as a comma-separated string to
73
+ `~~astroquery.heasarc.HeasarcClass.query_region `:
70
74
71
75
.. doctest-skip ::
72
76
73
- >>> Xamin .query_region(pos, table = ' chanmaster' , radius = 2 * u.deg,
77
+ >>> Heasac .query_region(pos, table = ' chanmaster' , radius = 2 * u.deg,
74
78
... columns= ' obsid, name, time, pi_lname' )
75
79
80
+ If no columns are given, the call will return a set of default columns.
81
+ If you want all the columns returned, use ``columns='*'` ``
82
+
76
83
List Available Tables
77
84
---------------------
78
- The collection of available tables can be obtained by calling the `~astroquery.heasarc.HeasarcXaminClass .tables `
85
+ The collection of available tables can be obtained by calling the `~astroquery.heasarc.HeasarcClass .tables `
79
86
method. In this example, we query the master tables only by passing ``master=True ``.
80
- which is ``False `` by default (i.e. query all table). `~astroquery.heasarc.HeasarcXaminClass .tables ` returns an
87
+ which is ``False `` by default (i.e. return all table). `~astroquery.heasarc.HeasarcClass .tables ` returns an
81
88
`~astropy.table.Table ` with two columns containing the names and description of the available
82
89
tables.
83
90
84
91
.. doctest-remote-data ::
85
92
86
- >>> from astroquery.heasarc import Xamin
87
- >>> tables = Xamin .tables(master = True )
93
+ >>> from astroquery.heasarc import Heasac
94
+ >>> tables = Heasac .tables(master = True )
88
95
>>> tables.pprint(align = ' <' )
89
96
name description
90
97
---------- -------------------------------------------------------------
@@ -94,13 +101,13 @@ tables.
94
101
erosmaster eROSITA Observations Master Catalog
95
102
96
103
If you do not know the name of the table you are looking for, you can use the ``keywords ``
97
- parameter in `~astroquery.heasarc.HeasarcXaminClass .tables `. For example, if you want to find all tables that
104
+ parameter in `~astroquery.heasarc.HeasarcClass .tables `. For example, if you want to find all tables that
98
105
are related to Chandra, you can do:
99
106
100
107
.. doctest-remote-data ::
101
108
102
- >>> from astroquery.heasarc import Xamin
103
- >>> tab = Xamin .tables(keywords = ' chandra' )
109
+ >>> from astroquery.heasarc import Heasac
110
+ >>> tab = Heasac .tables(keywords = ' chandra' )
104
111
>>> # list the first 10
105
112
>>> tab[:10 ].pprint()
106
113
name description
@@ -120,8 +127,8 @@ If you are interested only finding the master tables, you can also set ``master`
120
127
121
128
.. doctest-remote-data ::
122
129
123
- >>> from astroquery.heasarc import Xamin
124
- >>> tab = Xamin .tables(keywords = ' chandra' , master = True )
130
+ >>> from astroquery.heasarc import Heasac
131
+ >>> tab = Heasac .tables(keywords = ' chandra' , master = True )
125
132
>>> tab.pprint()
126
133
name description
127
134
---------- --------------------
@@ -132,8 +139,8 @@ following find all tables that have both 'xmm' and 'chandra' keyworkds:
132
139
133
140
.. doctest-remote-data ::
134
141
135
- >>> from astroquery.heasarc import Xamin
136
- >>> tab = Xamin .tables(keywords = ' xmm chandra' )
142
+ >>> from astroquery.heasarc import Heasac
143
+ >>> tab = Heasac .tables(keywords = ' xmm chandra' )
137
144
>>> tab.pprint()
138
145
name description
139
146
---------- ----------------------------------------------------------------
@@ -147,8 +154,8 @@ following for instance will find master tables that have keywords 'nicer' or 'sw
147
154
148
155
.. doctest-remote-data ::
149
156
150
- >>> from astroquery.heasarc import Xamin
151
- >>> tab = Xamin .tables(keywords = [' nicer' , ' swift' ], master = True )
157
+ >>> from astroquery.heasarc import Heasac
158
+ >>> tab = Heasac .tables(keywords = [' nicer' , ' swift' ], master = True )
152
159
>>> tab.pprint()
153
160
name description
154
161
---------- --------------------
@@ -162,11 +169,11 @@ with those results.
162
169
163
170
.. doctest-remote-data ::
164
171
165
- >>> from astroquery.heasarc import Xamin
172
+ >>> from astroquery.heasarc import Heasac
166
173
>>> from astropy.coordinates import SkyCoord
167
174
>>> pos = SkyCoord.from_name(' ngc 3516' )
168
- >>> tab = Xamin .query_region(pos, table = ' nicermastr' )
169
- >>> links = Xamin .get_links(tab[:2 ])
175
+ >>> tab = Heasac .query_region(pos, table = ' nicermastr' )
176
+ >>> links = Heasac .get_links(tab[:2 ])
170
177
>>> links.pprint(max_width = 120 )
171
178
ID access_url ... content_length
172
179
... byte
@@ -179,12 +186,12 @@ The first gives the url to the data from the main heasarc server. The second giv
179
186
the local path to the data on Sciserver. The last gives the S3 URI to the data in the cloud.
180
187
You can specify where the data are to be downloaded using the ``location `` parameter.
181
188
182
- To download the data, you can pass ``links `` table to `~astroquery.heasarc.HeasarcXaminClass .download_data `,
189
+ To download the data, you can pass ``links `` table to `~astroquery.heasarc.HeasarcClass .download_data `,
183
190
specifying from where you want the data to fetched by specifying the ``host `` parameter. By default,
184
191
the data is fetched from the main HEASARC servers.
185
192
The recommendation is to use different hosts depending on where you can is running:
186
193
* ``host='sciserver' ``: Use this option if you running you analysis on Sciserver. Because
187
- all the archive can be mounted locally there, `~astroquery.heasarc.HeasarcXaminClass .download_data `
194
+ all the archive can be mounted locally there, `~astroquery.heasarc.HeasarcClass .download_data `
188
195
will only copy the relevent data.
189
196
* ``host='aws' ``: Use this option if you are running the analysis in Amazon Web Services (AWS).
190
197
Data will be downloaded from AWS S3 storage.
@@ -194,26 +201,26 @@ before being untarred.
194
201
195
202
Advanced Queries
196
203
----------------
197
- Behind the scenes, `~astroquery.heasarc.HeasarcXaminClass .query_region ` constructs an query in the
204
+ Behind the scenes, `~astroquery.heasarc.HeasarcClass .query_region ` constructs an query in the
198
205
Astronomical Data Query Language ADQL, which is powerful in constructing
199
- complex queries. Passing ``get_query_payload=True `` to `~astroquery.heasarc.HeasarcXaminClass .query_region `
206
+ complex queries. Passing ``get_query_payload=True `` to `~astroquery.heasarc.HeasarcClass .query_region `
200
207
returns the constructed ADQL query.
201
208
202
209
.. doctest-remote-data ::
203
210
204
- >>> from astroquery.heasarc import Xamin
211
+ >>> from astroquery.heasarc import Heasac
205
212
>>> from astropy.coordinates import SkyCoord
206
213
>>> from astropy import units as u
207
214
>>> pos = SkyCoord(' 120 38' , unit = u.deg)
208
- >>> query = Xamin .query_region(pos, table = ' xmmmaster' , radius = 2 * u.deg,
215
+ >>> query = Heasac .query_region(pos, table = ' xmmmaster' , radius = 2 * u.deg,
209
216
>>> get_query_payload= True )
210
217
>>> query
211
218
"SELECT * FROM xmmmaster WHERE CONTAINS(POINT('ICRS',ra,dec),CIRCLE('ICRS',120.0,38.0,2.0))=1"
212
219
...
213
220
>>> # The query can be modified and then submitted using:
214
221
>>> query = """ SELECT ra,dec,name,obsid FROM xmmmaster
215
222
... WHERE CONTAINS(POINT(' ICRS' ,ra,dec),CIRCLE(' ICRS' ,120.0 ,38.0 ,2.0 ))= 1 """
216
- >>> tab = Xamin .query_tap(query).to_table()
223
+ >>> tab = Heasac .query_tap(query).to_table()
217
224
>>> tab[:10 ].pprint()
218
225
ra dec name obsid
219
226
deg deg
@@ -231,33 +238,33 @@ returns the constructed ADQL query.
231
238
232
239
Complex Regions
233
240
---------------
234
- In additon to a cone search (some position and search radius), ```Xamin .query_region` `` accepts
241
+ In additon to a cone search (some position and search radius), ```Heasac .query_region` `` accepts
235
242
other options too, including ``'box' ``, ``'polygon' `` and ``'all-sky' ``. Details can be found
236
- in `~astroquery.heasarc.HeasarcXaminClass .query_region `. Examples include:
243
+ in `~astroquery.heasarc.HeasarcClass .query_region `. Examples include:
237
244
238
245
.. doctest-skip ::
239
246
240
247
>>> # query box region
241
248
>>> pos = SkyCoord(' 226.2 10.6' , unit = u.deg)
242
- >>> Xamin .query_region(pos, table = ' xmmmaster' , spatial = ' box' , width = 0.5 * u.deg)
249
+ >>> Heasac .query_region(pos, table = ' xmmmaster' , spatial = ' box' , width = 0.5 * u.deg)
243
250
244
251
for ``'box' `` and:
245
252
246
253
.. doctest-skip ::
247
- >>> Xamin .query_region(table = ' xmmmaster' , spatial = ' polygon' ,
254
+ >>> Heasac .query_region(table = ' xmmmaster' , spatial = ' polygon' ,
248
255
polygon=[(226.2,10.6),(225.9,10.5),(225.8,10.2),(226.2,10.3)])
249
256
250
257
for ``'polygon' ``.
251
258
252
259
List Table Columns
253
260
------------------
254
- To list the columns of some table, use `~astroquery.heasarc.HeasarcXaminClass .columns `. Here we list the columns
261
+ To list the columns of some table, use `~astroquery.heasarc.HeasarcClass .columns `. Here we list the columns
255
262
in the XMM master table ``xmmmaster ``:
256
263
257
264
.. doctest-remote-data ::
258
265
259
- >>> from astroquery.heasarc import Xamin
260
- >>> columns = Xamin .columns(table_name = ' xmmmaster' )
266
+ >>> from astroquery.heasarc import Heasac
267
+ >>> columns = Heasac .columns(table_name = ' xmmmaster' )
261
268
>>> columns[:10 ].pprint(align = ' <' )
262
269
name description
263
270
-------------- ---------------------------------------------------------------
@@ -277,6 +284,12 @@ in the XMM master table ``xmmmaster``:
277
284
278
285
Old Browse Interface
279
286
====================
287
+ :::{admonition} Limited Support
288
+ :class: warning
289
+
290
+ The old Browse interface has only limited support from the Heasarc,
291
+ please consider using the main `~astroquery.heasarc.HeasarcClas ` interface.
292
+ :::
280
293
281
294
Getting lists of available datasets
282
295
-----------------------------------
0 commit comments