Skip to content

Commit 47c736c

Browse files
committed
MAINT: fixing integral test and doctests
1 parent 8a0a427 commit 47c736c

File tree

2 files changed

+22
-19
lines changed

2 files changed

+22
-19
lines changed

astroquery/esa/integral/tests/test_isla_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_get_source_metadata(self):
8585

8686
assert len(metadata) >= 1
8787
assert metadata[0]['name'] == 'Integral'
88-
assert metadata[0]['metadata'][0]['value'] == 'Crab'
88+
assert metadata[0]['metadata']['rows'][0]['value'] == 'Crab'
8989

9090
# Query a target that does not exist
9191
with pytest.raises(ValueError) as err:

docs/esa/integral/integral.rst

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
ESA Integral Science Legacy Archive (ISLA) (`astroquery.esa.integral`)
55
**********************************************************************
66

7-
INTEGRAL is the INTernational Gamma-Ray Astrophysics Laboratory of the
8-
European Space Agency. It observes the Universe in the X-ray and soft
9-
gamma-ray band. Since its launch, on October 17, 2002, the ISDC receives
10-
the spacecraft telemetry within seconds and provides alerts, processed
7+
INTEGRAL is the INTernational Gamma-Ray Astrophysics Laboratory of the
8+
European Space Agency. It observes the Universe in the X-ray and soft
9+
gamma-ray band. Since its launch, on October 17, 2002, the ISDC receives
10+
the spacecraft telemetry within seconds and provides alerts, processed
1111
data and analysis software to the worldwide scientific community.
1212

1313
========
@@ -26,8 +26,8 @@ file in the chosen format, and queries may be executed asynchronously.
2626

2727
>>> from astroquery.esa.integral import IntegralClass
2828
>>> isla = IntegralClass()
29-
>>> isla.query_tap(query='select * from ivoa.obscore')
30-
29+
>>> isla.query_tap(query='select * from ivoa.obscore') # doctest: +IGNORE_OUTPUT
30+
<Table length=6743>
3131
access_estsize access_format access_url calib_level ... t_max t_min t_resolution t_xel
3232
int64 object object int32 ... float64 float64 float64 int64
3333
-------------- ----------------- ------------------------------------------------------------------------------ ----------- ... ----------- ----------- ------------ -----
@@ -51,7 +51,7 @@ The output can be formatted and saved as needed.
5151
>>> from astroquery.esa.integral import IntegralClass
5252
>>> isla = IntegralClass()
5353
>>> isla.get_sources(target_name='crab')
54-
54+
<Table length=1>
5555
name ra dec source_id
5656
object float64 float64 object
5757
------ ----------------- ----------------- ----------------
@@ -69,7 +69,7 @@ identified by its target name. The metadata provides in-depth information about
6969
>>> from astroquery.esa.integral import IntegralClass
7070
>>> isla = IntegralClass()
7171
>>> metadata = isla.get_source_metadata(target_name='Crab')
72-
>>> metadata
72+
>>> metadata # doctest: +IGNORE_OUTPUT
7373
[{'name': 'Integral', 'link': None, 'metadata': [{'param': 'Name', 'value': 'Crab'}, {'param': 'Id', 'value': 'J053432.0+220052'}, {'param': 'Coordinates degrees', 'value': '83.6324 22.0174'}, {'param': 'Coordinates', 'value': '05 34 31.78 22 01 02.64'}, {'param': 'Galactic', 'value': '184.55 -5.78'}, {'param': 'Isgri flag2', 'value': 'very bright source'}, {'param': 'Jemx flag', 'value': 'detected'}, {'param': 'Spi flag', 'value': 'detected'}, {'param': 'Picsit flag', 'value': 'detected'}]}, {'name': 'Simbad', 'link': 'https://simbad.cds.unistra.fr/simbad/sim-id?Ident=Crab', 'metadata': [{'param': 'Id', 'value': 'NAME Crab'}, {'param': 'Type', 'value': 'SuperNova Remnant'}, {'param': 'Other types', 'value': 'HII|IR|Psr|Rad|SNR|X|gam'}]}]
7474

7575
------------------------------------
@@ -85,8 +85,9 @@ operation asynchronously.
8585

8686
>>> from astroquery.esa.integral import IntegralClass
8787
>>> isla = IntegralClass()
88-
>>> isla.get_observations(target_name='crab', radius=12.0, start_revno='0290', end_revno='0599')
89-
dec email end_revno endtime ... starttime surname title
88+
>>> isla.get_observations(target_name='crab', radius=12.0, start_revno='0290', end_revno='0599') # doctest: +IGNORE_OUTPUT
89+
<Table length=27>
90+
dec email end_revno endtime ... starttime surname title
9091
float64 str60 object object ... object str20 str120
9192
---------- ------------------------------ --------- ------------------- ... ------------------- ---------- --------------------------------------------------------------
9293
26.3157778 [email protected] 0352 2005-09-02 21:20:59 ... 2005-08-31 11:07:06 Kretschmar Target of Opportunity Observations of an Outburst in A 0535+26
@@ -114,7 +115,7 @@ An additional parameter, read_fits (default value True) reads automatically the
114115

115116
>>> from astroquery.esa.integral import IntegralClass
116117
>>> isla = IntegralClass()
117-
>>> isla.download_science_windows(science_windows=['008100430010', '033400230030'], output_file=None)
118+
>>> results = isla.download_science_windows(science_windows=['008100430010', '033400230030'], output_file=None) # doctest: +IGNORE_OUTPUT
118119

119120

120121
---------------------
@@ -132,7 +133,7 @@ to refine their search.
132133
>>> isla = IntegralClass()
133134
>>> coordinates = SkyCoord(83.63320922851562, 22.01447105407715, unit="deg")
134135
>>> timeline = isla.get_timeline(coordinates=coordinates)
135-
>>> timeline
136+
>>> timeline # doctest: +IGNORE_OUTPUT
136137
{'total_items': 8714, 'fraFC': 0.8510442965343126, 'totEffExpo': 16416293.994214607, 'timeline': <Table length=8714>
137138
scwExpo scwRevs scwTimes scwOffAxis
138139
float64 float64 object float64
@@ -157,6 +158,7 @@ specific target, instrument, or energy band is available.
157158
>>> from astroquery.esa.integral import IntegralClass
158159
>>> isla = IntegralClass()
159160
>>> isla.get_epochs(target_name='J011705.1-732636', band='28_40')
161+
<Table length=50>
160162
epoch
161163
object
162164
----------------
@@ -190,7 +192,8 @@ Users can refine their results by selecting an instrument or energy band.
190192

191193
>>> from astroquery.esa.integral import IntegralClass
192194
>>> isla = IntegralClass()
193-
>>> ltt = isla.get_long_term_timeseries(target_name='J174537.0-290107', instrument='jem-x')
195+
>>> ltt = isla.get_long_term_timeseries(target_name='J174537.0-290107', instrument='jem-x') # doctest: +IGNORE_OUTPUT
196+
194197

195198
8.2. Retrieving Short-Term Timeseries
196199
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -203,7 +206,8 @@ the results are saved to a file for detailed examination.
203206

204207
>>> from astroquery.esa.integral import IntegralClass
205208
>>> isla = IntegralClass()
206-
>>> stt = isla.get_short_term_timeseries(target_name='J011705.1-732636', band='28_40', epoch='0745_06340000001')
209+
>>> stt = isla.get_short_term_timeseries(target_name='J011705.1-732636', band='28_40', epoch='0745_06340000001') # doctest: +IGNORE_OUTPUT
210+
207211

208212
8.3. Retrieving spectra
209213
~~~~~~~~~~~~~~~~~~~~~~~
@@ -216,7 +220,7 @@ output file for further processing.
216220

217221
>>> from astroquery.esa.integral import IntegralClass
218222
>>> isla = IntegralClass()
219-
>>> spectra = isla.get_spectra(target_name='J011705.1-732636', instrument='ibis', epoch='0745_06340000001')
223+
>>> spectra = isla.get_spectra(target_name='J011705.1-732636', instrument='ibis', epoch='0745_06340000001') # doctest: +IGNORE_OUTPUT
220224

221225

222226
8.4. Retrieving mosaics
@@ -229,11 +233,10 @@ Users can filter by instrument or energy band and save the resulting image to a
229233

230234
>>> from astroquery.esa.integral import IntegralClass
231235
>>> isla = IntegralClass()
232-
>>> mosaics = isla.get_mosaic(epoch='0727_88601650001', instrument='ibis')
233-
236+
>>> mosaics = isla.get_mosaic(epoch='0727_88601650001', instrument='ibis') # doctest: +IGNORE_OUTPUT +IGNORE_WARNINGS
234237

235238
Reference/API
236239
=============
237240

238241
.. automodapi:: astroquery.esa.integral
239-
:no-inheritance-diagram:
242+
:no-inheritance-diagram:

0 commit comments

Comments
 (0)