Skip to content

Commit 1cd8097

Browse files
mstcyr2bsipocz
authored andcommitted
Updated MastClass error example
1 parent 46fa131 commit 1cd8097

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

docs/mast/mast.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,18 +1450,23 @@ The basic MAST query function returns query results as an `~astropy.table.Table`
14501450
Length = 77 rows
14511451

14521452

1453-
The 'params' parameter for the `~astroquery.mast.MastClass.service_request` method requires a key-value pair
1454-
format, with the key name inside quotation marks. Keys without quotes will produce the following error.
1453+
Many mast services, specifically JWST and Catalog services, require the two principal keywords, columns and filters,
1454+
to list parameters. Positional services will also require right ascension and declination parameters, either in
1455+
addition to columns and filters or on their own. For example, the Cone search service only requires the 'ra' and
1456+
'dec' parameters. Using the wrong service parameters will result in an error. Read the
1457+
`MAST API services documentation <https://mast.stsci.edu/api/v0/_services.html>`__ for more information on valid
1458+
service parameters.
14551459

14561460
.. doctest-remote-data::
14571461

1462+
>>> from astroquery.mast import Mast
1463+
...
14581464
>>> service = 'Mast.Caom.Cone'
1459-
>>> params = {ra:184.3,
1460-
... dec:54.5,
1461-
... radius:0.2}
1465+
>>> params = {'columns': "*",
1466+
... 'filters': {}}
14621467
>>> observations = Mast.service_request(service, params)
14631468
...
1464-
NameError: name 'ra' is not defined
1469+
RemoteServiceError: Request Object is Missing Required Parameter : RA
14651470

14661471

14671472
If the output is not the MAST json result type it cannot be properly parsed into a `~astropy.table.Table`.

0 commit comments

Comments
 (0)