Skip to content

Commit 86b2354

Browse files
committed
Fixing remote data in mast.mission, fixing code example formatting, too
1 parent 556a1c2 commit 86b2354

File tree

1 file changed

+66
-62
lines changed

1 file changed

+66
-62
lines changed

docs/mast/mast.rst

Lines changed: 66 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -187,102 +187,106 @@ was previously available in the original HST web search form, and are present in
187187
the current Mission Search interface.
188188

189189
Currenlty, the API only includes the search functionality. The functionality to
190-
download data products associated with search results is not currently supported.
190+
download data products associated with search results is not currently supported.
191191

192-
An object of MastMissions class is instantiated with a default mission of 'hst' and
192+
An object of MastMissions class is instantiated with a default mission of 'hst' and
193193
default service set to 'search'.
194-
194+
195195
.. code-block:: python
196196
197-
>>> from astroquery.mast.missions import MastMissions
198-
>>> missions = MastMissions()
199-
>>> missions.mission
200-
'hst'
201-
>>> missions.service
202-
'search'
197+
>>> from astroquery.mast.missions import MastMissions
198+
>>> missions = MastMissions()
199+
>>> missions.mission
200+
'hst'
201+
>>> missions.service
202+
'search'
203203
204-
The missions object can be used to search metadata using region coordinates. the keywoed argumentss
204+
The missions object can be used to search metadata using region coordinates. the keywoed argumentss
205205
can be used to specify output characteristics like selec_cols and sort_by and conditions that filter
206206
on values like proposal id, pi last name etc. The available column names for a mission can be found out
207207
by using the ~astroquery.mast.MastMissionsClass.get_column_list function.
208208

209-
.. code-block:: python
209+
.. doctest-remote-data::
210+
211+
>>> from astroquery.mast.missions import MastMissions
212+
>>> missions = MastMissions(mission='hst')
213+
>>> columns = missions.get_column_list()
210214

211-
>>> from astroquery.mast.missions import MastMissions
212-
>>> missions = MastMissions(mission='hst')
213-
>>> columns = missions.get_column_list()
214215

215216
For positional searches, the columns "ang_sep", "sci_data_set_name", "search_key" and "search_position"
216217
will always be included, in addition to any columns specified using "select_cols". For non-positional
217218
searches, "search_key" and "sci_data_set_name" will always be included, in addition to any columns
218-
specified using "select_cols".
219+
specified using "select_cols".
219220

220221
For a non positional search, select_cols would always include search_key and sci_data_set_name.
221222

222-
.. code-block:: python
223+
.. doctest-remote-data::
223224

224-
>>> from astroquery.mast.missions import MastMissions
225-
>>> from astropy.coordinates import SkyCoord
226-
>>> missions = MastMissions(mission='hst')
227-
>>> regionCoords = SkyCoord(210.80227, 54.34895, unit=('deg', 'deg'))
228-
>>> results = missions.query_region(regionCoords, 3, sci_pep_id=12556, select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status"], sort_by=['sci_targname'])
229-
>>> results[:5]
230-
<Table masked=True length=5>
231-
sci_status sci_targname sci_data_set_name ang_sep sci_pep_id search_pos sci_pi_last_name search_key
232-
str6 str16 str9 str20 int64 str18 str6 str27
233-
---------- ---------------- ----------------- -------------------- ---------- ------------------ ---------------- ---------------------------
234-
PUBLIC NUCLEUS+HODGE602 OBQU010H0 0.017460048037303017 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU010H0
235-
PUBLIC NUCLEUS+HODGE602 OBQU01050 0.017460048037303017 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU01050
236-
PUBLIC NUCLEUS+HODGE602 OBQU01030 0.022143836477276503 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU01030
237-
PUBLIC NUCLEUS+HODGE602 OBQU010F0 0.022143836477276503 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU010F0
238-
PUBLIC NUCLEUS+HODGE602 OBQU010J0 0.04381046755938432 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU010J0
225+
>>> from astroquery.mast.missions import MastMissions
226+
>>> from astropy.coordinates import SkyCoord
227+
>>> missions = MastMissions(mission='hst')
228+
>>> regionCoords = SkyCoord(210.80227, 54.34895, unit=('deg', 'deg'))
229+
>>> results = missions.query_region(regionCoords, 3, sci_pep_id=12556,
230+
... select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status"],
231+
... sort_by=['sci_targname'])
232+
>>> results[:5] # doctest: +IGNORE_OUTPUT
233+
<Table masked=True length=5>
234+
sci_status sci_targname sci_data_set_name ang_sep sci_pep_id search_pos sci_pi_last_name search_key
235+
str6 str16 str9 str20 int64 str18 str6 str27
236+
---------- ---------------- ----------------- -------------------- ---------- ------------------ ---------------- ---------------------------
237+
PUBLIC NUCLEUS+HODGE602 OBQU010H0 0.017460048037303017 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU010H0
238+
PUBLIC NUCLEUS+HODGE602 OBQU01050 0.017460048037303017 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU01050
239+
PUBLIC NUCLEUS+HODGE602 OBQU01030 0.022143836477276503 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU01030
240+
PUBLIC NUCLEUS+HODGE602 OBQU010F0 0.022143836477276503 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU010F0
241+
PUBLIC NUCLEUS+HODGE602 OBQU010J0 0.04381046755938432 12556 210.80227 54.34895 GORDON 210.80227 54.34895OBQU010J0
239242

240243

241244
for paging through the results, offset and limit can be used to specify the starting record and the number
242245
of returned records. the default values for offset and limit is 0 and 5000 respectively.
243246

244-
.. code-block:: python
247+
.. doctest-remote-data::
245248

246-
>>> from astroquery.mast.missions import MastMissions
247-
>>> from astropy.coordinates import SkyCoord
248-
>>> missions = MastMissions()
249-
>>> results = missions.query_criteria(sci_start_time=">=2021-01-01 00:00:00", select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status", "sci_pep_id"], sort_by=['sci_pep_id'], limit=1000, offset=1000)
250-
>>> len(results)
251-
>>> 1000
249+
>>> from astroquery.mast.missions import MastMissions
250+
>>> from astropy.coordinates import SkyCoord
251+
>>> missions = MastMissions()
252+
>>> results = missions.query_criteria(sci_start_time=">=2021-01-01 00:00:00",
253+
... select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status", "sci_pep_id"],
254+
... sort_by=['sci_pep_id'], limit=1000, offset=1000)
255+
>>> len(results)
256+
1000
252257

253258
Metadata queries can also be performed using object names with the
254259
~astroquery.mast.MastMissionsClass.query_object function.
255260

256-
.. code-block:: python
261+
.. doctest-remote-data::
257262

258-
>>> results = missions.query_object('M101', 3, select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status"], sort_by=['sci_targname'])
259-
>>> results[:5]
260-
<Table masked=True length=5>
261-
ang_sep search_pos sci_status search_key sci_stop_time sci_targname sci_start_time sci_data_set_name
262-
str20 str18 str6 str27 str26 str16 str26 str9
263-
------------------ ------------------ ---------- --------------------------- -------------------------- ------------ -------------------------- -----------------
264-
2.751140575012458 210.80227 54.34895 PUBLIC 210.80227 54.34895LDJI01010 2019-02-19T05:52:40.020000 +164.6+9.9 2019-02-19T00:49:58.010000 LDJI01010
265-
0.8000626246647815 210.80227 54.34895 PUBLIC 210.80227 54.34895J8OB02011 2003-08-27T08:27:34.513000 ANY 2003-08-27T07:44:47.417000 J8OB02011
266-
1.1261718338567348 210.80227 54.34895 PUBLIC 210.80227 54.34895J8D711J1Q 2003-01-17T00:50:22.250000 ANY 2003-01-17T00:42:06.993000 J8D711J1Q
267-
1.1454431087675097 210.80227 54.34895 PUBLIC 210.80227 54.34895JD6V01012 2017-06-15T18:33:25.983000 ANY 2017-06-15T18:10:12.037000 JD6V01012
268-
1.1457795862361977 210.80227 54.34895 PUBLIC 210.80227 54.34895JD6V01013 2017-06-15T20:08:44.063000 ANY 2017-06-15T19:45:30.023000 JD6V01013
263+
>>> results = missions.query_object('M101', 3, select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status"],
264+
... sort_by=['sci_targname'])
265+
>>> results[:5] # doctest: +IGNORE_OUTPUT
266+
<Table masked=True length=5>
267+
ang_sep search_pos sci_status search_key sci_stop_time sci_targname sci_start_time sci_data_set_name
268+
str20 str18 str6 str27 str26 str16 str26 str9
269+
------------------ ------------------ ---------- --------------------------- -------------------------- ------------ -------------------------- -----------------
270+
2.751140575012458 210.80227 54.34895 PUBLIC 210.80227 54.34895LDJI01010 2019-02-19T05:52:40.020000 +164.6+9.9 2019-02-19T00:49:58.010000 LDJI01010
271+
0.8000626246647815 210.80227 54.34895 PUBLIC 210.80227 54.34895J8OB02011 2003-08-27T08:27:34.513000 ANY 2003-08-27T07:44:47.417000 J8OB02011
272+
1.1261718338567348 210.80227 54.34895 PUBLIC 210.80227 54.34895J8D711J1Q 2003-01-17T00:50:22.250000 ANY 2003-01-17T00:42:06.993000 J8D711J1Q
273+
1.1454431087675097 210.80227 54.34895 PUBLIC 210.80227 54.34895JD6V01012 2017-06-15T18:33:25.983000 ANY 2017-06-15T18:10:12.037000 JD6V01012
274+
1.1457795862361977 210.80227 54.34895 PUBLIC 210.80227 54.34895JD6V01013 2017-06-15T20:08:44.063000 ANY 2017-06-15T19:45:30.023000 JD6V01013
269275

270276
Metadata queries can also be performed using non-positional parameters with the
271277
~astroquery.mast.MastMissionsClass.query_criteria function.
272278

273-
.. code-block:: python
279+
.. doctest-remote-data::
274280

275-
>>> results = missions.query_criteria(sci_data_set_name="Z06G0101T", sci_pep_id="1455", select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status"], sort_by=['sci_targname'])
276-
>>> results[:5]
277-
<Table masked=True length=5>
278-
search_key sci_stop_time sci_data_set_name sci_start_time sci_targname sci_status
279-
str9 str26 str9 str26 str19 str6
280-
---------- -------------------------- ----------------- -------------------------- ------------ ----------
281-
Z06G0101T 1990-05-13T11:02:34.567000 Z06G0101T 1990-05-13T10:38:09.193000 -- PUBLIC
282-
Z06G0201T 1990-05-13T11:31:47.567000 Z06G0201T 1990-05-13T11:07:22.190000 -- PUBLIC
283-
Z06G0301T 1990-05-13T12:43:18.567000 Z06G0301T 1990-05-13T12:18:53.190000 -- PUBLIC
284-
Z06G0401T 1990-05-13T13:12:18.567000 Z06G0401T 1990-05-13T12:47:53.190000 -- PUBLIC
285-
Z0AM5201T -- Z0AM5201T -- -- PUBLIC
281+
>>> results = missions.query_criteria(sci_data_set_name="Z06G0101T", sci_pep_id="1455",
282+
... select_cols=["sci_stop_time", "sci_targname", "sci_start_time", "sci_status"],
283+
... sort_by=['sci_targname'])
284+
>>> results[:5] # doctest: +IGNORE_OUTPUT
285+
<Table masked=True length=5>
286+
search_key sci_stop_time sci_data_set_name sci_start_time sci_targname sci_status
287+
str9 str26 str9 str26 str19 str6
288+
---------- -------------------------- ----------------- -------------------------- ------------ ----------
289+
Z06G0101T 1990-05-13T11:02:34.567000 Z06G0101T 1990-05-13T10:38:09.193000 -- PUBLIC
286290

287291

288292

0 commit comments

Comments
 (0)