Skip to content

Commit 2ad6889

Browse files
committed
DOC: adding tracebacks to make the tests pass
1 parent cc640dd commit 2ad6889

File tree

1 file changed

+27
-20
lines changed

1 file changed

+27
-20
lines changed

docs/mast/mast.rst

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ an error if the "radius" field is not specified.
8686

8787
.. doctest-remote-data::
8888

89-
>>> obs_table = Observations.query_object("M8",".02 deg")
89+
>>> obs_table = Observations.query_object("M8", ".02 deg")
90+
Traceback (most recent call last):
9091
...
91-
TypeError: query_object_async() takes 2 positional arguments but 3 were given
92+
TypeError: ObservationsClass.query_object_async() takes 2 positional arguments but 3 were given
9293

9394

9495
Observation Criteria Queries
@@ -219,16 +220,17 @@ To get a table of metadata associated with observation or product lists use the
219220
obsID Product Group ID ... Long integer, e.g. 2007590987
220221
obs_collection Mission ... HST, HLA, SWIFT, GALEX, Kepler, K2...
221222

222-
The `~astroquery.mast.ObservationsClass.get_metadata` function only accepts the strings
223-
"observations" or "products" as a parameter. Any other string or spelling will result
223+
The `~astroquery.mast.ObservationsClass.get_metadata` function only accepts the strings
224+
"observations" or "products" as a parameter. Any other string or spelling will result
224225
in an error.
225226

226227
.. doctest-remote-data::
227-
228+
228229
>>> meta_table = Observations.get_metadata("observation")
230+
Traceback (most recent call last):
229231
...
230-
InvalidQueryError: Unknown query type.
231-
232+
astroquery.exceptions.InvalidQueryError: Unknown query type.
233+
232234

233235
Downloading Data
234236
================
@@ -410,19 +412,21 @@ which can be changed with the ``local_path`` keyword argument.
410412
>>> print(result)
411413
('COMPLETE', None, None)
412414

413-
The `~astroquery.mast.ObservationsClass.download_file` and `~astroquery.mast.ObservationsClass.download_products`
415+
The `~astroquery.mast.ObservationsClass.download_file` and `~astroquery.mast.ObservationsClass.download_products`
414416
methods are not interchangeable. Using the incorrect method for either single files or product lists will result
415417
in an error.
416418

417419
.. doctest-remote-data::
418420

419421
>>> result = Observations.download_products(product) # doctest: +IGNORE_OUTPUT
422+
Traceback (most recent call last):
420423
...
421424
RemoteServiceError: Error converting data type varchar to bigint.
422425

423426
.. doctest-remote-data::
424-
427+
425428
>>> result = Observations.download_file(data_products)
429+
Traceback (most recent call last):
426430
...
427431
TypeError: can only concatenate str (not "Table") to str
428432

@@ -856,8 +860,9 @@ parameters will result in an error.
856860
...
857861
>>> catalog_data = Catalogs.query_criteria(catalog="Tic",
858862
... objectname='M101', radius=1)
863+
Traceback (most recent call last):
859864
...
860-
InvalidQueryError: At least one non-positional criterion must be supplied.
865+
astroquery.exceptions.InvalidQueryError: At least one non-positional criterion must be supplied.
861866

862867

863868
The PanSTARRS catalog also accepts additional parameters to allow for query refinement. These options include column selection,
@@ -973,7 +978,7 @@ TESSCut
973978
=======
974979

975980
TESSCut is MAST's tool to provide full-frame image (FFI) cutouts from the Transiting
976-
Exoplanet Survey Satellite (TESS). The cutouts can be made from either the Science
981+
Exoplanet Survey Satellite (TESS). The cutouts can be made from either the Science
977982
Processing Operation's Center (`SPOC <https://archive.stsci.edu/missions-and-data/tess>`__) FFI products,
978983
or the TESS Image CAlibrator (`TICA <https://archive.stsci.edu/hlsp/tica>`__) high-level science products.
979984
Cutouts from the TICA products are not available for sectors 1-26,
@@ -1010,7 +1015,7 @@ Requesting a cutout by coordinate or objectname accesses the
10101015
`MAST TESScut API <https://mast.stsci.edu/tesscut/docs/getting_started.html#requesting-a-cutout>`__
10111016
and returns a target pixel file, with format described
10121017
`here <https://astrocut.readthedocs.io/en/latest/astrocut/file_formats.html#target-pixel-files>`__.
1013-
Note that the product argument will default to request for SPOC cutouts when
1018+
Note that the product argument will default to request for SPOC cutouts when
10141019
not explicitly called for TICA.
10151020

10161021
.. doctest-remote-data::
@@ -1028,8 +1033,8 @@ not explicitly called for TICA.
10281033
2 APERTURE 1 ImageHDU 81 (5, 5) int32
10291034

10301035

1031-
For users with time-sensitive targets who would like cutouts from the latest observations,
1032-
we recommend requesting for the TICA product. Using the same target from the example above,
1036+
For users with time-sensitive targets who would like cutouts from the latest observations,
1037+
we recommend requesting for the TICA product. Using the same target from the example above,
10331038
this example shows a request for TICA cutouts:
10341039

10351040
.. doctest-remote-data::
@@ -1088,8 +1093,9 @@ parameter will result in an error when set to 'TICA'.
10881093
>>> from astroquery.mast import Tesscut
10891094
...
10901095
>>> hdulist = Tesscut.get_cutouts(objectname="Eleonora", product='tica', moving_target=True, size=5, sector=6)
1096+
Traceback (most recent call last):
10911097
...
1092-
InvalidQueryError: Only SPOC is available for moving targets queries.
1098+
astroquery.exceptions.InvalidQueryError: Only SPOC is available for moving targets queries.
10931099

10941100
The `~astroquery.mast.TesscutClass.download_cutouts` function takes a product type ("TICA" or "SPOC", but defaults to "SPOC"),
10951101
coordinate, cutout size (in pixels or an angular quantity), or object name (e.g. "M104" or "TIC 32449963") and moving target
@@ -1150,8 +1156,8 @@ To access sector information for a particular coordinate, object, or moving targ
11501156
tess-s0008-1-1 8 1 1
11511157
tess-s0034-1-2 34 1 2
11521158

1153-
Note that because of the delivery cadence of the
1154-
TICA high level science products, later sectors will be available sooner with TICA than with
1159+
Note that because of the delivery cadence of the
1160+
TICA high level science products, later sectors will be available sooner with TICA than with
11551161
SPOC. Also note that TICA is not available for sectors 1-26. The following example is the same
11561162
query as above, but for TICA. Notice that products for sector 8 are no longer available,
11571163
but are now available for sector 61.
@@ -1446,7 +1452,7 @@ Many mast services, specifically JWST and Catalog services, require the two prin
14461452
to list parameters. Positional services will also require right ascension and declination parameters, either in
14471453
addition to columns and filters or on their own. For example, the cone search service only requires the 'ra' and
14481454
'dec' parameters. Using the wrong service parameters will result in an error. Read the
1449-
`MAST API services documentation <https://mast.stsci.edu/api/v0/_services.html>`__ for more information on valid
1455+
`MAST API services documentation <https://mast.stsci.edu/api/v0/_services.html>`__ for more information on valid
14501456
service parameters.
14511457

14521458
.. doctest-remote-data::
@@ -1457,9 +1463,10 @@ service parameters.
14571463
>>> params = {'columns': "*",
14581464
... 'filters': {}}
14591465
>>> observations = Mast.service_request(service, params)
1466+
Traceback (most recent call last):
14601467
...
1461-
RemoteServiceError: Request Object is Missing Required Parameter : RA
1462-
1468+
astroquery.exceptions.RemoteServiceError: Request Object is Missing Required Parameter : RA
1469+
14631470

14641471
If the output is not the MAST json result type it cannot be properly parsed into a `~astropy.table.Table`.
14651472
In this case, the async method should be used to get the raw http response, which can then be manually parsed.

0 commit comments

Comments
 (0)