Skip to content

Commit

Permalink
Merge pull request #2648 from bsipocz/MAINT_fixing_23Q1_remotes
Browse files Browse the repository at this point in the history
MAINT: fixing numerous remote test failures
  • Loading branch information
bsipocz authored Jan 26, 2023
2 parents d2d6529 + 2f73f46 commit 8b24c19
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 96 deletions.
2 changes: 1 addition & 1 deletion astroquery/eso/tests/test_eso_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
u'hawki', u'isaac', u'naco', u'visir', u'vircam', u'apex',
u'giraffe', u'uves', u'xshooter', u'muse', u'crires',
u'kmos', u'sinfoni', u'amber', u'midi', u'pionier',
u'gravity', u'espresso', u'wlgsu', u'matisse']
u'gravity', u'espresso', u'wlgsu', u'matisse', u'eris']

# Some tests take too long, leading to travis timeouts
# TODO: make this a configuration item
Expand Down
26 changes: 14 additions & 12 deletions astroquery/mpc/tests/test_mpc_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,33 @@
@pytest.mark.remote_data
class TestMPC:

@pytest.mark.parametrize('type, name', [
@pytest.mark.parametrize('target_type, name', [
('asteroid', 'ceres'),
('asteroid', 'eros'),
('asteroid', 'vesta')])
def test_query_object_valid_object_by_name(self, type, name):
response = mpc.MPC.query_object_async(target_type=type, name=name)
('asteroid', 'vesta'),
('asteroid', 'pallas'),
('asteroid', 'piszkesteto')])
def test_query_object_valid_object_by_name(self, target_type, name):
# Keep all 3 of the objects in the tests, too that used to cause issue
# https://github.com/astropy/astroquery/issues/2531
response = mpc.MPC.query_object_async(target_type=target_type, name=name)
assert response.status_code == requests.codes.ok
assert len(response.json()) == 1
assert response.json()[0]['name'].lower() == name

@pytest.mark.parametrize('type, number', [
@pytest.mark.parametrize('target_type, number', [
('comet', '103P')])
def test_query_object_valid_object_by_number(self, type, number):
response = mpc.MPC.query_object_async(
target_type=type, number=number)
def test_query_object_valid_object_by_number(self, target_type, number):
response = mpc.MPC.query_object_async(target_type=target_type, number=number)
assert response.status_code == requests.codes.ok
assert len(response.json()) == 1
assert str(response.json()[0]['number']) + \
response.json()[0]['object_type'] == number

@pytest.mark.parametrize('type, designation', [
@pytest.mark.parametrize('target_type, designation', [
('comet', 'C/2012 S1')])
def test_query_object_valid_object_by_designation(self, type, designation):
response = mpc.MPC.query_object_async(
target_type=type, designation=designation)
def test_query_object_valid_object_by_designation(self, target_type, designation):
response = mpc.MPC.query_object_async(target_type=target_type, designation=designation)
assert response.status_code == requests.codes.ok
assert len(response.json()) == 1
assert response.json()[0]['designation'].lower() == designation.lower()
Expand Down
4 changes: 1 addition & 3 deletions astroquery/utils/commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
ASTROPY_LT_4_3 = not minversion('astropy', '4.3')
ASTROPY_LT_5_0 = not minversion('astropy', '5.0')

ASTROPY_LT_5_1 = not minversion('astropy', '5.1dev197')
# Update the line above once 5.1 is released
# ASTROPY_LT_5_1 = not minversion('astropy', '5.1')
ASTROPY_LT_5_1 = not minversion('astropy', '5.1')


def radius_to_unit(radius, unit='degree'):
Expand Down
22 changes: 11 additions & 11 deletions docs/cadc/cadc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ these collections:
TESS : {'Description': 'The TESS collection at the CADC', 'Bands': ['Optical']}
UKIRT : {'Description': 'The UKIRT collection at the CADC', 'Bands': ['Infrared|Optical', '', 'Optical', 'Infrared']}
VGPS : {'Description': 'The VGPS collection at the CADC', 'Bands': ['Radio']}
VLASS : {'Description': 'The VLASS collection at the CADC', 'Bands': ['', 'Radio']}
VLASS : {'Description': 'The VLASS collection at the CADC', 'Bands': ['Radio']}
WALLABY : {'Description': 'The WALLABY collection at the CADC', 'Bands': ['Radio']}
XMM : {'Description': 'The XMM collection at the CADC', 'Bands': ['Optical', 'UV', 'X-ray']}

Expand All @@ -51,7 +51,7 @@ region or by name. The following example queries CADC for Canada
France Hawaii Telescope (CFHT) data for a given region and resolves
the URLs for downloading the corresponding data.


.. Remove IGNORE_WARNINGS once https://github.com/astropy/astroquery/issues/2523 is fixed
.. doctest-remote-data::

>>> from astroquery.cadc import Cadc
Expand All @@ -73,7 +73,7 @@ the URLs for downloading the corresponding data.
caom:CFHT/2583703 2583703 ... 2021-02-26T10:37:42.355
caom:CFHT/2376828 2376828 ... 2021-09-01T23:48:18.790
caom:CFHT/2376828 2376828 ... 2021-09-01T23:48:18.790
>>> urls = cadc.get_data_urls(result)
>>> urls = cadc.get_data_urls(result) # doctest: +IGNORE_WARNINGS
>>> for url in urls:
... print(url) #doctest: +IGNORE_OUTPUT
...
Expand All @@ -92,14 +92,14 @@ the results on the name of the target (as an example - any other
filtering possible) and resolves the URLs for both the primary and
auxiliary data (in this case preview files)


.. Remove IGNORE_WARNINGS once https://github.com/astropy/astroquery/issues/2523 is fixed
.. doctest-remote-data::

>>> from astroquery.cadc import Cadc
>>> cadc = Cadc()
>>> result = cadc.query_region('08h45m07.5s +54d18m00s')
>>> urls = cadc.get_data_urls(result[result['target_name'] == 'Nr3491_1'],
... include_auxiliaries=True)
... include_auxiliaries=True) # doctest: +IGNORE_WARNINGS
>>> for url in urls:
... print(url) # doctest: +IGNORE_OUTPUT
...
Expand Down Expand Up @@ -136,15 +136,15 @@ the CADC metadata.
If only a subsection of the FITS file is needed, CADC can query an
area and resolve the cutout of a result.


.. Remove IGNORE_WARNINGS once https://github.com/astropy/astroquery/issues/2523 is fixed
.. doctest-remote-data::

>>> from astropy import units as u
>>> from astroquery.cadc import Cadc
>>> cadc = Cadc()
>>> coords = '01h45m07.5s +23d18m00s'
>>> radius = 0.01*u.deg
>>> images = cadc.get_images(coords, radius, collection='CFHT')
>>> images = cadc.get_images(coords, radius, collection='CFHT') # doctest: +IGNORE_WARNINGS
>>> images # doctest: +IGNORE_OUTPUT
[<astropy.io.fits.hdu.image.PrimaryHDU object at 0x7f3805a06ef0>]
[<astropy.io.fits.hdu.image.PrimaryHDU object at 0x7f3805b23b38>]
Expand All @@ -153,7 +153,7 @@ area and resolve the cutout of a result.
Alternatively, if the query result is large and data does not need to be
in memory, lazy access to the downloaded FITS file can be used.


.. Remove IGNORE_WARNINGS once https://github.com/astropy/astroquery/issues/2523 is fixed
.. doctest-remote-data::

>>> from astropy import units as u
Expand All @@ -162,7 +162,7 @@ in memory, lazy access to the downloaded FITS file can be used.
>>> cadc = Cadc()
>>> coords = SkyCoord(10, 20, unit='deg')
>>> radius = 0.01*u.deg
>>> readable_objs = cadc.get_images_async(coords, radius, collection='CFHT')
>>> readable_objs = cadc.get_images_async(coords, radius, collection='CFHT') # doctest: +IGNORE_WARNINGS
>>> readable_objs # doctest: +IGNORE_OUTPUT
Downloaded object from URL https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/sync?ID=ad%3ACFHT%2F2234132o.fits.fz&RUNID=pot39nwwtaht03wc&POS=CIRCLE+26.2812589776878+23.299999818906816+0.01 with ID 140045451168112
Downloaded object from URL https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/sync?ID=ad%3ACFHT%2F2368279p.fits.fz&RUNID=pot39nwwtaht03wc&POS=CIRCLE+26.2812589776878+23.299999818906816+0.01 with ID 140045451142576
Expand All @@ -181,7 +181,7 @@ are needed, the result table can be passed into the
`~astroquery.cadc.CadcClass.get_image_list` function, along with the
cutout coordinates and radius.


.. Remove IGNORE_WARNINGS once https://github.com/astropy/astroquery/issues/2523 is fixed
.. doctest-remote-data::

>>> from astroquery.cadc import Cadc
Expand All @@ -191,7 +191,7 @@ cutout coordinates and radius.
>>> radius = 0.1*u.deg
>>> results = cadc.query_region(coords, radius, collection='CFHT')
>>> filtered_results = results[results['time_exposure'] > 120.0]
>>> image_list = cadc.get_image_list(filtered_results, coords, radius)
>>> image_list = cadc.get_image_list(filtered_results, coords, radius) # doctest: +IGNORE_WARNINGS
>>> print(image_list) # doctest: +IGNORE_OUTPUT
['https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/sync?ID=ad%3ACFHT%2F2368278o.fits.fz&RUNID=dbuswaj4zwruzi92&POS=CIRCLE+26.2812589776878+23.299999818906816+0.1',
'https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/caom2ops/sync?ID=ad%3ACFHT%2F2368278p.fits.fz&RUNID=dbuswaj4zwruzi92&POS=CIRCLE+26.2812589776878+23.299999818906816+0.1',
Expand Down
49 changes: 22 additions & 27 deletions docs/esa/iso/iso.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. _astroquery.esa.iso:

****************************************
**************************************
ESA ISO Archive (`astroquery.esa.iso`)
****************************************
**************************************
The Infrared Space Observatory (ISO) was a space telescope for infrared light designed and
operated by the European Space Agency (ESA), in cooperation with ISAS (now part of JAXA) and NASA.
The ISO was designed to study infrared light at wavelengths of 2.5 to 240 micrometres and operated
Expand All @@ -20,9 +20,9 @@ ESA experts at ESAC.
Examples
========

------------------------------
--------------------
1. Querying ISO data
------------------------------
--------------------

.. doctest-remote-data::

Expand Down Expand Up @@ -79,9 +79,9 @@ print(table).
Once we have the observations identifiers (TDT) we can invoke the data download. To discover the tables
provided by this service, see section 'Getting Tables Details'.

------------------------------
-------------------
2. Getting ISO data
------------------------------
-------------------

.. doctest-remote-data::

Expand Down Expand Up @@ -153,33 +153,27 @@ we can loop on the observations to download the best products (DEFAULT_DATA_SET)
INFO: http://nida.esac.esa.int/...


-------------------------------
2. Getting ISO postcards
-------------------------------
------------------------
3. Getting ISO postcards
------------------------

This will download the ISO postcard for the observation '80001538' and it will stored in a PNG called
'postcard.png'.

.. doctest-remote-data::

>>> from astroquery.esa.iso import ISO
>>> from IPython.display import Image
>>> from IPython.core.display import HTML
>>>
>>> ISO.get_postcard('80001538', filename="postcard") # doctest: +IGNORE_OUTPUT
Downloading URL http://nida.esac.esa.int/nida-sl-tap/data?retrieval_type=POSTCARD&DATA_RETRIEVAL_ORIGIN=astroquery&tdt=80001538 to /Users...
>>> Image(filename = "postcard.png", width=400, height=100)
<IPython.core.display.Image object>


.. figure:: images/campostcard.png
:scale: 100%
:alt: Postcard image for observation 80001538

The resulting plot from the example above

This will download the ISO postcard for the observation '80001538' and it will stored in a PNG called
'postcard.png'. Then, we display the postcard inside the python interface.
The postcard downloaded in the example above

------------------------------------------
3. Getting ISO Tables Details through TAP
4. Getting ISO Tables Details through TAP
------------------------------------------

.. doctest-remote-data::
Expand Down Expand Up @@ -207,7 +201,7 @@ This will download the ISO postcard for the observation '80001538' and it will s
This will show the available tables in ISO TAP service in the ISO Data Archive.

-------------------------------------
4. Getting columns details of ISO TAP
5. Getting columns details of ISO TAP
-------------------------------------

.. doctest-remote-data::
Expand All @@ -231,9 +225,9 @@ This will show the column details of the table 'ida.observations' in ISO TAP ser
in the ISO Data Archive.


-------------------------------------
4. Working with ISO VO tables
-------------------------------------
-----------------------------
6. Working with ISO VO tables
-----------------------------

ISO provides Virtual Observatory compatible products and tables. Three different VO
compatible tables are provided:
Expand Down Expand Up @@ -298,9 +292,10 @@ Same can be done to discover images M31 images:
ISO CAM01 Image Target: M31_LW6 10.68375 41.26945 http://nida.esac.esa.int/nida-sl-tap/data?RETRIEVAL_TYPE=STANDALONE&obsno=583023050
ISO CAM01 Image Target: M31_LW3 10.68375 41.26945 http://nida.esac.esa.int/nida-sl-tap/data?RETRIEVAL_TYPE=STANDALONE&obsno=583027030

-------------------------------------
4. Working with ISO VO products
-------------------------------------
-------------------------------
7. Working with ISO VO products
-------------------------------

Either by invocation of the URL provided in every row of previous section or using the STANDALONE retrieval level, VO compatible products can be open using python astropy FITS module.

Images can be displayed by using the following code:
Expand Down
5 changes: 3 additions & 2 deletions docs/esasky/esasky.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ If you know the names of all the available catalogs you can use :meth:`~astroque
'XMM-EPIC-STACK', 'XMM-EPIC', 'XMM-OM', 'XMM-SLEW', 'Tycho-2', 'Gaia-DR3', 'Hipparcos-2', 'HSC',
'Herschel-HPPSC-070', 'Herschel-HPPSC-100', 'Herschel-HPPSC-160', 'Herschel-SPSC-250', 'Herschel-SPSC-350',
'Herschel-SPSC-500', 'Planck-PGCC', 'Planck-PCCS2E-HFI', 'Planck-PCCS2-HFI', 'Planck-PCCS2-LFI', 'Planck-PSZ2',
'Icecube', 'Fermi_4FGL-DR2', 'Fermi_3FHL', 'Fermi_4LAC-DR2', '2WHSP', '2RXS', 'OU_Blazars']
'Icecube', 'Fermi_4FGL-DR2', 'Fermi_3FHL', 'Fermi_4LAC-DR2', '2WHSP', '2RXS', 'OU_Blazars',
'eROSITA-eFEDS-hard', 'eROSITA-eFEDS-main', 'eROSITA-etaCha-hard', 'eROSITA-etaCha-main']

Get the available maps mission names
------------------------------------
Expand All @@ -48,7 +49,7 @@ If you know the names of all the available maps missions you can use :meth:`~ast
>>> maps_list = ESASky.list_maps()
>>> print(maps_list)
['INTEGRAL', 'XMM', 'Chandra', 'SUZAKU', 'XMM-OM-OPTICAL', 'XMM-OM-UV', 'HST-UV', 'HST-OPTICAL', 'HST-IR',
'ISO-IR', 'Herschel', 'AKARI', 'JWST-MID-IR', 'JWST-NEAR-IR', 'Spitzer', 'ALMA']
'ISO-IR', 'Herschel', 'AKARI', 'JWST-MID-IR', 'JWST-NEAR-IR', 'Spitzer', 'ALMA', 'eROSITA']

Get the available spectra mission names
---------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/eso/eso.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ list of available instrument-specific queries can be obtained with the
>>> from astroquery.eso import Eso
>>> eso = Eso()
>>> eso.list_instruments()
['fors1', 'fors2', 'sphere', 'vimos', 'omegacam', 'hawki', 'isaac', 'naco', 'visir',
['fors1', 'fors2', 'sphere', 'vimos', 'omegacam', 'eris', 'hawki', 'isaac', 'naco', 'visir',
'vircam', 'apex', 'giraffe', 'uves', 'xshooter', 'espresso', 'muse', 'crires',
'kmos', 'sinfoni', 'amber', 'gravity', 'matisse', 'midi', 'pionier', 'wlgsu']

Expand Down
28 changes: 14 additions & 14 deletions docs/ipac/ned/ned.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ instance if you want to query NGC 224
>>> result_table = Ned.query_object("NGC 224")
>>> print(result_table) # an astropy.table.Table
No. Object Name RA ... Redshift Points Diameter Points Associations
degrees ...
degrees ...
--- ----------- ---------- ... --------------- --------------- ------------
1 MESSIER 031 10.68479 ... 38 13 2
1 MESSIER 031 10.68479 ... 39 13 2


Query a region
Expand Down Expand Up @@ -240,7 +240,7 @@ for the specified object. We look at a simple example:
No. RA ... Published Frequence Mode Qualifiers
...
--- -------------- ... ------------------------ -------------------------
0 12h29m06.6997s ...
0 12h29m06.6997s ...
1 12h29m06.7000s ... Uncertain origin
2 12h29m06.7000s ... Uncertain origin
3 12h29m06.7000s ... Uncertain origin
Expand All @@ -251,17 +251,17 @@ for the specified object. We look at a simple example:
8 12h29m06.7001s ... Uncertain origin
9 12h29m06.7001s ... Uncertain origin
... ... ... ... ...
123 12h29m07.55s ... Broad-band measurement From reprocessed raw data
124 12h29m06.05s ... Broad-band measurement From new, raw data
125 12h29m06.5s ... Broad-band measurement From new, raw data
126 12h29m06.5s ... Broad-band measurement From reprocessed raw data
127 12h29m09.0s ... Uncertain origin
128 12h29m08.9s ... Uncertain origin
129 12h29m07.9s ... Uncertain origin
130 12h29m04s ... Uncertain origin
131 12h29m06s ... Uncertain origin
132 12h29m08s ... Uncertain origin
Length = 133 rows
138 12h29m06.05s ... Broad-band measurement From new, raw data
139 12h29m06.5s ... Broad-band measurement From new, raw data
140 12h29m06.5s ... Broad-band measurement From reprocessed raw data
141 12h29m09.0s ... Uncertain origin
142 12h29m08.9s ... Uncertain origin
143 12h29m07.9s ... Uncertain origin
144 12h29m04s ... Uncertain origin
145 12h29m06s ... Uncertain origin
146 12h29m08s ... Uncertain origin
147 12h29m06s ... Uncertain origin
Length = 148 rows


Reference/API
Expand Down
Loading

0 comments on commit 8b24c19

Please sign in to comment.