Skip to content

Commit 5faf0b4

Browse files
committed
update documentation for xamin
1 parent 915ea98 commit 5faf0b4

File tree

1 file changed

+62
-49
lines changed

1 file changed

+62
-49
lines changed

docs/heasarc/heasarc.rst

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,31 @@ This is a python interface for querying the
1111
`HEASARC <https://heasarc.gsfc.nasa.gov/>`__
1212
archive web service.
1313

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.
1917

20-
- :ref:`Heasarc Xamin Interface`.
18+
- :ref:`Heasarc Main (Xamin) Interface`.
2119
- :ref:`Old Browse Interface`.
2220

23-
.. _Heasarc Xamin Interface:
21+
.. _Heasarc Main Interface:
2422

25-
Heasarc Xamin Interface
23+
Heasarc Main Interface
2624
=======================
2725

2826
Query a Table
2927
-------------
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
3230
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`:
3432

3533
.. doctest-remote-data::
3634

37-
>>> from astroquery.heasarc import Xamin
35+
>>> from astroquery.heasarc import Heasarc
3836
>>> from astropy.coordinates import SkyCoord
3937
>>> pos = SkyCoord.from_name('ngc 3783')
40-
>>> tab = Xamin.query_region(pos, table='numaster')
38+
>>> tab = Heasarc.query_region(pos, table='numaster')
4139
>>> tab['name', 'obsid', 'ra', 'dec'][:3].pprint()
4240
name obsid ra dec
4341
deg deg
@@ -46,16 +44,16 @@ and then pass them to `~astroquery.heasarc.HeasarcXaminClass.query_region`:
4644
NGC_3783 60901023 174.7571 -37.7385
4745
NGC_3783 60902005 174.7571 -37.7385
4846

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`:
5149

5250
.. doctest-remote-data::
5351

54-
>>> from astroquery.heasarc import Xamin
52+
>>> from astroquery.heasarc import Heasac
5553
>>> from astropy.coordinates import SkyCoord
5654
>>> from astropy import units as u
5755
>>> 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)
5957
>>> tab['name', 'obsid', 'ra', 'dec'][:5].pprint()
6058
name obsid ra dec
6159
deg deg
@@ -66,25 +64,34 @@ You use `~astropy.units`:
6664
1RXS J075526.1+391111 13008 118.85875 39.18639
6765
SDSS J080040.77+391700.5 18110 120.17000 39.28344
6866

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`:
7074

7175
.. doctest-skip::
7276

73-
>>> Xamin.query_region(pos, table='chanmaster', radius=2*u.deg,
77+
>>> Heasac.query_region(pos, table='chanmaster', radius=2*u.deg,
7478
... columns='obsid, name, time, pi_lname')
7579

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+
7683
List Available Tables
7784
---------------------
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`
7986
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
8188
`~astropy.table.Table` with two columns containing the names and description of the available
8289
tables.
8390

8491
.. doctest-remote-data::
8592

86-
>>> from astroquery.heasarc import Xamin
87-
>>> tables = Xamin.tables(master=True)
93+
>>> from astroquery.heasarc import Heasac
94+
>>> tables = Heasac.tables(master=True)
8895
>>> tables.pprint(align='<')
8996
name description
9097
---------- -------------------------------------------------------------
@@ -94,13 +101,13 @@ tables.
94101
erosmaster eROSITA Observations Master Catalog
95102

96103
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
98105
are related to Chandra, you can do:
99106

100107
.. doctest-remote-data::
101108

102-
>>> from astroquery.heasarc import Xamin
103-
>>> tab = Xamin.tables(keywords='chandra')
109+
>>> from astroquery.heasarc import Heasac
110+
>>> tab = Heasac.tables(keywords='chandra')
104111
>>> # list the first 10
105112
>>> tab[:10].pprint()
106113
name description
@@ -120,8 +127,8 @@ If you are interested only finding the master tables, you can also set ``master`
120127

121128
.. doctest-remote-data::
122129

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)
125132
>>> tab.pprint()
126133
name description
127134
---------- --------------------
@@ -132,8 +139,8 @@ following find all tables that have both 'xmm' and 'chandra' keyworkds:
132139

133140
.. doctest-remote-data::
134141

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')
137144
>>> tab.pprint()
138145
name description
139146
---------- ----------------------------------------------------------------
@@ -147,8 +154,8 @@ following for instance will find master tables that have keywords 'nicer' or 'sw
147154

148155
.. doctest-remote-data::
149156

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)
152159
>>> tab.pprint()
153160
name description
154161
---------- --------------------
@@ -162,11 +169,11 @@ with those results.
162169

163170
.. doctest-remote-data::
164171

165-
>>> from astroquery.heasarc import Xamin
172+
>>> from astroquery.heasarc import Heasac
166173
>>> from astropy.coordinates import SkyCoord
167174
>>> 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])
170177
>>> links.pprint(max_width=120)
171178
ID access_url ... content_length
172179
... byte
@@ -179,12 +186,12 @@ The first gives the url to the data from the main heasarc server. The second giv
179186
the local path to the data on Sciserver. The last gives the S3 URI to the data in the cloud.
180187
You can specify where the data are to be downloaded using the ``location`` parameter.
181188

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`,
183190
specifying from where you want the data to fetched by specifying the ``host`` parameter. By default,
184191
the data is fetched from the main HEASARC servers.
185192
The recommendation is to use different hosts depending on where you can is running:
186193
* ``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`
188195
will only copy the relevent data.
189196
* ``host='aws'``: Use this option if you are running the analysis in Amazon Web Services (AWS).
190197
Data will be downloaded from AWS S3 storage.
@@ -194,26 +201,26 @@ before being untarred.
194201

195202
Advanced Queries
196203
----------------
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
198205
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`
200207
returns the constructed ADQL query.
201208

202209
.. doctest-remote-data::
203210

204-
>>> from astroquery.heasarc import Xamin
211+
>>> from astroquery.heasarc import Heasac
205212
>>> from astropy.coordinates import SkyCoord
206213
>>> from astropy import units as u
207214
>>> 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,
209216
>>> get_query_payload=True)
210217
>>> query
211218
"SELECT * FROM xmmmaster WHERE CONTAINS(POINT('ICRS',ra,dec),CIRCLE('ICRS',120.0,38.0,2.0))=1"
212219
...
213220
>>> # The query can be modified and then submitted using:
214221
>>> query = """SELECT ra,dec,name,obsid FROM xmmmaster
215222
... 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()
217224
>>> tab[:10].pprint()
218225
ra dec name obsid
219226
deg deg
@@ -231,33 +238,33 @@ returns the constructed ADQL query.
231238

232239
Complex Regions
233240
---------------
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
235242
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:
237244

238245
.. doctest-skip::
239246

240247
>>> # query box region
241248
>>> 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)
243250

244251
for ``'box'`` and:
245252

246253
.. doctest-skip::
247-
>>> Xamin.query_region(table='xmmmaster', spatial='polygon',
254+
>>> Heasac.query_region(table='xmmmaster', spatial='polygon',
248255
polygon=[(226.2,10.6),(225.9,10.5),(225.8,10.2),(226.2,10.3)])
249256

250257
for ``'polygon'``.
251258

252259
List Table Columns
253260
------------------
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
255262
in the XMM master table ``xmmmaster``:
256263

257264
.. doctest-remote-data::
258265

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')
261268
>>> columns[:10].pprint(align='<')
262269
name description
263270
-------------- ---------------------------------------------------------------
@@ -277,6 +284,12 @@ in the XMM master table ``xmmmaster``:
277284

278285
Old Browse Interface
279286
====================
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+
:::
280293

281294
Getting lists of available datasets
282295
-----------------------------------

0 commit comments

Comments
 (0)