Skip to content

Commit 0403898

Browse files
mstcyr2bsipocz
authored andcommitted
MastClass error example
1 parent 4e3a93f commit 0403898

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/mast/mast.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,6 +1454,20 @@ The basic MAST query function returns query results as an `~astropy.table.Table`
14541454
Length = 77 rows
14551455

14561456

1457+
The 'params' parameter for the `~astroquery.mast.MastClass.service_request` method requires a key-value pair
1458+
format, with the key name inside quotation marks. Keys without quotes will produce the following error.
1459+
1460+
.. doctest-remote-data::
1461+
1462+
>>> service = 'Mast.Caom.Cone'
1463+
>>> params = {ra:184.3,
1464+
... dec:54.5,
1465+
... radius:0.2}
1466+
>>> observations = Mast.service_request(service, params)
1467+
...
1468+
NameError: name 'ra' is not defined
1469+
1470+
14571471
If the output is not the MAST json result type it cannot be properly parsed into a `~astropy.table.Table`.
14581472
In this case, the async method should be used to get the raw http response, which can then be manually parsed.
14591473

0 commit comments

Comments
 (0)