Skip to content

Commit 3ce2ae3

Browse files
committed
Removing empty cells, and revert commented in narrative
1 parent 3a0a6ae commit 3ce2ae3

File tree

3 files changed

+96
-77
lines changed

3 files changed

+96
-77
lines changed

docs/jplhorizons/jplhorizons.rst

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ identical to the one presented here.
3333
In order to query information for a specific Solar System body, a
3434
``Horizons`` object has to be instantiated:
3535

36-
.. code-block:: python
3736
.. doctest-remote-data::
3837

3938
>>> from astroquery.jplhorizons import Horizons
@@ -61,7 +60,7 @@ location is on Earth if it has not been specifically set. The following example
6160
uses the coordinates of the `Statue of Liberty
6261
<https://www.google.com/maps/place/Statue+of+Liberty+National+Monument/@40.6892534,-74.0466891,17z/data=!3m1!4b1!4m5!3m4!1s0x89c25090129c363d:0x40c6a5770d25022b!8m2!3d40.6892494!4d-74.0445004>`_
6362
as the observer's location:
64-
.. code-block:: python
63+
6564
.. doctest-remote-data::
6665

6766
>>> statue_of_liberty = {'lon': -74.0466891,
@@ -106,8 +105,6 @@ In the case of ambiguities in the name resolution, a list of matching objects
106105
will be provided. In order to select an object from this list, provide the
107106
respective id number or record number as ``id`` and use ``id_type=None``:
108107

109-
110-
.. code-block:: python
111108
.. doctest-remote-data::
112109

113110
>>> from astroquery.jplhorizons import Horizons
@@ -145,7 +142,6 @@ for a given observer location (``location``) and epoch or range of epochs
145142
(``epochs``) in the form of an astropy table. The following example queries the
146143
ephemerides of asteroid (1) Ceres for a range of dates as seen from Mauna Kea:
147144

148-
.. code-block:: python
149145
.. doctest-remote-data::
150146

151147
>>> from astroquery.jplhorizons import Horizons
@@ -163,8 +159,13 @@ ephemerides of asteroid (1) Ceres for a range of dates as seen from Mauna Kea:
163159
1 Ceres (A801 AA) 2010-Jan-31 00:00 2455227.5 ... 17.2067 247.2518 3.7289
164160
1 Ceres (A801 AA) 2010-Feb-10 00:00 2455237.5 ... 18.5029 250.0576 3.4415
165161
1 Ceres (A801 AA) 2010-Feb-20 00:00 2455247.5 ... 19.5814 252.7383 3.1451
166-
>>> # The following fields are available for each ephemerides query:
167-
>>> print(eph.columns)
162+
163+
164+
The following fields are available for each ephemerides query:
165+
166+
.. code-block:: python
167+
168+
>>> print(eph.columns) # doctest: +REMOTE_DATA
168169
<TableColumns names=('targetname','datetime_str','datetime_jd','H','G','solar_presence','flags','RA','DEC','RA_app','DEC_app','RA_rate','DEC_rate','AZ','EL','AZ_rate','EL_rate','sat_X','sat_Y','sat_PANG','siderealtime','airmass','magextinct','V','surfbright','illumination','illum_defect','sat_sep','sat_vis','ang_width','PDObsLon','PDObsLat','PDSunLon','PDSunLat','SubSol_ang','SubSol_dist','NPole_ang','NPole_dist','EclLon','EclLat','r','r_rate','delta','delta_rate','lighttime','vel_sun','vel_obs','elong','elongFlag','alpha','lunar_elong','lunar_illum','sat_alpha','sunTargetPA','velocityPA','OrbPlaneAng','constellation','TDB-UT','ObsEclLon','ObsEclLat','NPole_RA','NPole_DEC','GlxLon','GlxLat','solartime','earth_lighttime','RA_3sigma','DEC_3sigma','SMAA_3sigma','SMIA_3sigma','Theta_3sigma','Area_3sigma','RSS_3sigma','r_3sigma','r_rate_3sigma','SBand_3sigma','XBand_3sigma','DoppDelay_3sigma','true_anom','hour_angle','alpha_true','PABLon','PABLat')>
169170
170171
The values in these columns are the same as those defined in the Horizons
@@ -214,7 +215,6 @@ Horizons) and for a given epoch or a range of epochs (``epochs``) in the form of
214215
an astropy table. The following example queries the osculating elements of
215216
asteroid (433) Eros for a given date relative to the Sun:
216217

217-
.. code-block:: python
218218
.. doctest-remote-data::
219219

220220
>>> from astroquery.jplhorizons import Horizons
@@ -226,8 +226,13 @@ asteroid (433) Eros for a given date relative to the Sun:
226226
--- d ... AU d
227227
------------------ ------------- ... ----------------- -----------------
228228
433 Eros (A898 PA) 2458133.33546 ... 1.782442696867877 642.9387350660577
229-
>>> # The following fields are queried:
230-
>>> print(el.columns)
229+
230+
231+
The following fields are queried:
232+
233+
.. code-block:: python
234+
235+
>>> print(el.columns) # doctest: +REMOTE_DATA
231236
<TableColumns names=('targetname','datetime_jd','datetime_str','H','G','e','q','incl','Omega','w','Tp_jd','n','M','nu','a','Q','P')>
232237
233238
Optional parameters of :meth:`~astroquery.jplhorizons.HorizonsClass.elements`
@@ -253,7 +258,6 @@ the form of an astropy table. The following example queries the state
253258
vector of asteroid 2012 TC4 as seen from Goldstone for a range of
254259
epochs:
255260

256-
.. code-block:: python
257261
.. doctest-remote-data::
258262

259263
>>> from astroquery.jplhorizons import Horizons
@@ -275,8 +279,13 @@ epochs:
275279
(2012 TC4) 2458028.493055556 ... 0.03910796987365932 -0.004063569840032833
276280
(2012 TC4) 2458028.5 ... 0.03907974874463358 -0.004064045454467904
277281
Length = 145 rows
278-
>>> # The following fields are queried:
279-
>>> print(vec.columns)
282+
283+
284+
The following fields are queried:
285+
286+
.. code-block:: python
287+
288+
>>> print(vec.columns) # doctest: +REMOTE_DATA
280289
<TableColumns names=('targetname','datetime_jd','datetime_str','H','G','x','y','z','vx','vy','vz','lighttime','range','range_rate')>
281290
282291
@@ -304,17 +313,21 @@ We provide some examples to illustrate how to use them based on the following
304313
JPL Horizons ephemerides query of near-Earth asteroid (3552) Don Quixote since
305314
its year of Discovery:
306315

307-
.. code-block:: python
308316
.. doctest-remote-data::
309317

310318
>>> from astroquery.jplhorizons import Horizons
311319
>>> obj = Horizons(id='3552', location='568',
312320
... epochs={'start':'2010-01-01', 'stop':'2019-12-31',
313321
... 'step':'1y'})
314322
>>> eph = obj.ephemerides()
315-
>>> # As we have seen before, we can display a truncated version of table
316-
>>> # ``eph`` by simply using
317-
>>> print(eph)
323+
324+
325+
As we have seen before, we can display a truncated version of table
326+
``eph`` by simply using
327+
328+
.. code-block:: python
329+
330+
>>> print(eph) # doctest: +REMOTE_DATA
318331
targetname datetime_str ... PABLon PABLat
319332
--- --- ... deg deg
320333
-------------------------- ----------------- ... -------- --------
@@ -394,7 +407,6 @@ let's calculate the total rate of the object by summing 'RA_rate' and 'DEC_rate'
394407
in quadrature:
395408

396409

397-
.. code-block:: python
398410
.. doctest-remote-data::
399411

400412
>>> import numpy as np
@@ -425,9 +437,8 @@ available, too, e.g., the ``RA_rate`` column is expressed in ``arcsec /
425437
h`` - arcseconds per hour:
426438

427439
.. code-block:: python
428-
.. doctest-remote-data::
429440
430-
>>> print(eph['RA_rate'])
441+
>>> print(eph['RA_rate']) # doctest: +REMOTE_DATA
431442
RA_rate
432443
arcsec / h
433444
----------
@@ -446,7 +457,6 @@ h`` - arcseconds per hour:
446457
The unit of this column can be easily converted to any other unit describing the
447458
same dimensions. For instance, we can turn ``RA_rate`` into ``arcsec / s``:
448459

449-
.. code-block:: python
450460
.. doctest-remote-data::
451461

452462
>>> eph['RA_rate'].convert_unit_to('arcsec/s')
@@ -568,7 +578,6 @@ For example, get the barycentric coordinates of Jupiter as an astropy
568578

569579

570580

571-
572581
Acknowledgements
573582
================
574583

docs/jplsbdb/jplsbdb.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ Example
3838
The most simple query to obtain information for a specific Solar
3939
System small-body works as follows:
4040

41-
.. code-block:: python
4241
.. doctest-remote-data::
4342

4443
>>> from astroquery.jplsbdb import SBDB
@@ -65,7 +64,6 @@ schematic. Please consult the `Data Output section
6564
<https://ssd-api.jpl.nasa.gov/doc/sbdb.html#data-output>`__ of the SBDB API
6665
documentation to learn more about the meaning of the different output fields:
6766

68-
.. code-block:: python
6967
.. doctest-remote-data::
7068

7169
>>> print(SBDB.schematic(sbdb)) # doctest: +IGNORE_OUTPUT

docs/jplspec/jplspec.rst

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ The default option to return the query payload is set to false, in the
2424
following examples we have explicitly set it to False and True to show the
2525
what each setting yields:
2626

27-
.. code-block:: python
2827
.. doctest-remote-data::
2928

3029
>>> from astroquery.jplspec import JPLSpec
@@ -49,7 +48,6 @@ what each setting yields:
4948

5049
The following example, with ``get_query_payload = True``, returns the payload:
5150

52-
.. code-block:: python
5351
.. doctest-remote-data::
5452

5553
>>> response = JPLSpec.query_lines(min_frequency=100 * u.GHz,
@@ -64,7 +62,6 @@ The following example, with ``get_query_payload = True``, returns the payload:
6462
The units of the columns of the query can be displayed by calling
6563
``response.info``:
6664

67-
.. code-block:: python
6865
.. doctest-remote-data::
6966

7067
>>> response = JPLSpec.query_lines(min_frequency=100 * u.GHz,
@@ -90,7 +87,6 @@ The units of the columns of the query can be displayed by calling
9087
These come in handy for converting to other units easily, an example using a
9188
simplified version of the data above is shown below:
9289

93-
.. code-block:: python
9490
.. doctest-remote-data::
9591

9692
>>> print (response['FREQ', 'ERR', 'ELO'])
@@ -122,7 +118,6 @@ molecule information such as the partition functions at different
122118
temperatures. Keep in mind that a negative TAG value signifies that
123119
the line frequency has been measured in the laboratory
124120

125-
.. code-block:: python
126121
.. doctest-remote-data::
127122

128123
>>> import matplotlib.pyplot as plt
@@ -137,7 +132,6 @@ the line frequency has been measured in the laboratory
137132
You can also access the temperature of the partition function
138133
through metadata:
139134

140-
.. code-block:: python
141135
.. doctest-remote-data::
142136

143137
>>> result['QLOG2'].meta
@@ -152,7 +146,6 @@ continuation of the example above, an example that accesses and plots the
152146
partition function against the temperatures found in the metadata is shown
153147
below:
154148

155-
.. code-block:: python
156149
.. doctest-skip::
157150

158151
>>> temp = result.meta['Temperature (K)']
@@ -177,7 +170,6 @@ calculate production rates at different temperatures with the proportionality:
177170
for the CO molecule) we can continue to determine the partition function at
178171
other temperatures using curve fitting models:
179172

180-
.. code-block:: python
181173
.. doctest-skip::
182174

183175
>>> from scipy.optimize import curve_fit
@@ -217,74 +209,89 @@ in the JPL query catalog or a string with the exact name found in the catalog,
217209
that you do not set the local parse parameter since the module will be able
218210
to query these directly.
219211

220-
.. code-block:: python
221212
.. doctest-remote-data::
222213

223214
>>> from astroquery.jplspec import JPLSpec
224215
>>> import astropy.units as u
225216
>>> response = JPLSpec.query_lines_async(min_frequency=100 * u.GHz,
226-
... max_frequency=1000 * u.GHz,
227-
... min_strength=-500,
228-
... molecule="H2O",
229-
... parse_name_locally=True)
230-
>>> # Searches like these can lead to very broad queries. Since the table yields
231-
>>> # extensive results, we will only show a dictionary of the tags that
232-
>>> # went into the payload to create a response:
233-
{'CH2OO': 46014,
234-
'H2O': 18003,
235-
'H2O v2,2v2,v': 18005,
236-
'H2O-17': 19003,
237-
'H2O-18': 20003,
238-
'H2O2': 34004,
239-
'HCCCH2OD': 57003,
240-
'HCCCH2OH': 56010,
241-
'HCOCH2OH': 60006,
242-
'NH2CH2CH2OH': 61004}
217+
... max_frequency=1000 * u.GHz,
218+
... min_strength=-500,
219+
... molecule="H2O",
220+
... parse_name_locally=True)
221+
222+
Searches like these can lead to very broad queries. Since the table yields
223+
extensive results, we will only show a dictionary of the tags that
224+
went into the payload to create a response:
225+
226+
227+
.. We don't get these dictionaries as reponses, fix these examples and
228+
remove skip. #2408
229+
230+
.. doctest-skip::
231+
232+
>>> {'CH2OO': 46014,
233+
... 'H2O': 18003,
234+
... 'H2O v2,2v2,v': 18005,
235+
... 'H2O-17': 19003,
236+
... 'H2O-18': 20003,
237+
... 'H2O2': 34004,
238+
... 'HCCCH2OD': 57003,
239+
... 'HCCCH2OH': 56010,
240+
... 'HCOCH2OH': 60006,
241+
... 'NH2CH2CH2OH': 61004}
243242

244243
As you can see, the 'H2O' string was processed as a regular expression,
245244
and the search matched any molecule that contained the combination of
246245
characters 'H20'.
247246

248247
A few examples that show the power of the regex option are the following:
249248

250-
.. code-block:: python
251249
.. doctest-remote-data::
252250

253251
>>> response = JPLSpec.query_lines_async(min_frequency=100 * u.GHz,
254-
... max_frequency=1000 * u.GHz,
255-
... min_strength=-500,
256-
... molecule="H2O$",
257-
... parse_name_locally=True)
258-
>>> # The response:
259-
{'H2O': 18003}
252+
... max_frequency=1000 * u.GHz,
253+
... min_strength=-500,
254+
... molecule="H2O$",
255+
... parse_name_locally=True)
256+
257+
258+
The response:
259+
260+
.. doctest-skip::
261+
262+
>>> {'H2O': 18003}
260263

261264

262265
As seen above, the regular expression "H2O$" yields only an exact match because
263266
the special character $ matches the end of the line. This functionality allows
264267
you to be as specific or vague as you want to allow the results to be:
265268

266-
.. code-block:: python
267269
.. doctest-remote-data::
268270

269271
>>> from astroquery.jplspec import JPLSpec
270272
>>> import astropy.units as u
271273
>>> response = JPLSpec.query_lines_async(min_frequency=100 * u.GHz,
272-
... max_frequency=1000 * u.GHz,
273-
... min_strength=-500,
274-
... molecule="^H.O$",
275-
... parse_name_locally=True)
276-
>>> # This pattern matches any word that starts with an H, ends with an O, and
277-
>>> # contains any character in between, it results in the following molecules
278-
>>> # being queried:
279-
{'H2O': 18003,
280-
'HDO': 19002
281-
'HCO': 29004
282-
'HNO': 31005 }
274+
... max_frequency=1000 * u.GHz,
275+
... min_strength=-500,
276+
... molecule="^H.O$",
277+
... parse_name_locally=True)
278+
279+
280+
This pattern matches any word that starts with an H, ends with an O, and
281+
contains any character in between, it results in the following molecules
282+
being queried:
283+
284+
.. doctest-skip::
285+
286+
>>> {'H2O': 18003,
287+
... 'HDO': 19002
288+
... 'HCO': 29004
289+
... 'HNO': 31005 }
290+
283291

284292
Another example of the functionality of this option is the option to obtain
285293
results from a molecule and its isotopes, in this case H2O and HDO:
286294

287-
.. code-block:: python
288295
.. doctest-remote-data::
289296

290297
>>> from astroquery.jplspec import JPLSpec
@@ -294,13 +301,18 @@ results from a molecule and its isotopes, in this case H2O and HDO:
294301
... min_strength=-500,
295302
... molecule=r"^H[2D]O(-\d\d|)$",
296303
... parse_name_locally=True)
297-
>>> # This pattern matches any H2O and HDO isotopes and it results in the following
298-
>>> # molecules being part of the payload:
299-
{'H2O': 18003,
300-
'H2O-17': 19003,
301-
'H2O-18': 20003,
302-
'HDO': 19002,
303-
'HDO-18': 21001}
304+
305+
306+
This pattern matches any H2O and HDO isotopes and it results in the following
307+
molecules being part of the payload:
308+
309+
.. doctest-skip::
310+
311+
>>> {'H2O': 18003,
312+
... 'H2O-17': 19003,
313+
... 'H2O-18': 20003,
314+
... 'HDO': 19002,
315+
... 'HDO-18': 21001}
304316

305317
Remember to print your response to see the table of your results.
306318

0 commit comments

Comments
 (0)