Skip to content

Commit 1783c12

Browse files
committed
JWST instrument search updated and bugfixes
1 parent 2facaed commit 1783c12

File tree

5 files changed

+24
-23
lines changed

5 files changed

+24
-23
lines changed

astroquery/esa/iso/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class Conf(_config.ConfigNamespace):
1515
"""
1616
Configuration parameters for `astroquery.esa.iso`.
1717
"""
18-
DATA_ACTION = _config.ConfigItem("http://nida.esac.esa.int/nida-sl-tap/data?",
18+
DATA_ACTION = _config.ConfigItem("https://nida.esac.esa.int/nida-sl-tap/data?",
1919
"Main url for retrieving ISO Data Archive files")
2020

21-
METADATA_ACTION = _config.ConfigItem("http://nida.esac.esa.int/nida-sl-tap/tap/",
21+
METADATA_ACTION = _config.ConfigItem("https://nida.esac.esa.int/nida-sl-tap/tap/",
2222
"Main url for retrieving ISO Data Archive metadata")
2323

2424
TIMEOUT = 60

astroquery/esa/jwst/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,8 +1146,8 @@ def __get_plane_dataproducttype_condition(self, *, prod_type=None):
11461146
raise ValueError("prod_type must be one of: "
11471147
+ str(', '.join(self.PLANE_DATAPRODUCT_TYPES)))
11481148
else:
1149-
condition = " AND dataproducttype LIKE '"+prod_type.lower() + \
1150-
"' "
1149+
condition = " AND dataproducttype ILIKE '%"+prod_type.lower() + \
1150+
"%' "
11511151
return condition
11521152

11531153
def __get_instrument_name_condition(self, *, value=None):
@@ -1159,7 +1159,7 @@ def __get_instrument_name_condition(self, *, value=None):
11591159
raise ValueError("instrument_name must be one of: "
11601160
+ str(', '.join(self.INSTRUMENT_NAMES)))
11611161
else:
1162-
condition = " AND instrument_name LIKE '"+value.upper()+"' "
1162+
condition = " AND instrument_name ILIKE '%"+value.upper()+"%' "
11631163
return condition
11641164

11651165
def __get_filter_name_condition(self, *, value=None):
@@ -1191,7 +1191,7 @@ def __get_artifact_producttype_condition(self, *, product_type=None):
11911191
raise ValueError("product_type must be one of: "
11921192
+ str(', '.join(self.ARTIFACT_PRODUCT_TYPES)))
11931193
else:
1194-
condition = " AND producttype LIKE '"+product_type+"'"
1194+
condition = " AND producttype ILIKE '%"+product_type+"%'"
11951195
return condition
11961196

11971197
@staticmethod

astroquery/esa/xmm_newton/tests/test_xmm_newton_remote.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
from ..tests.dummy_tap_handler import DummyXMMNewtonTapHandler
2323

2424

25+
def data_path(filename):
26+
data_dir = os.path.join(os.path.dirname(__file__), 'data')
27+
return os.path.join(data_dir, filename)
28+
29+
2530
@pytest.mark.remote_data
2631
class TestXMMNewtonRemote:
2732
_files = {
@@ -148,7 +153,7 @@ def test_get_postcard_filename(self, tmp_cwd):
148153
xsa.get_postcard(**parameters)
149154

150155
def test_get_epic_metadata(self):
151-
tap_url = "http://nxsadev.esac.esa.int/tap-server/tap/"
156+
tap_url = "https://nxsa.esac.esa.int/tap-server/tap/"
152157
target_name = "4XMM J122934.7+015657"
153158
radius = 0.01
154159
epic_source_table = "xsa.v_epic_source"
@@ -191,9 +196,9 @@ def test_get_epic_metadata(self):
191196
assert report_diff_values(slew_source, table)
192197

193198
def test_download_proprietary_data_incorrect_credentials(self, tmp_cwd):
194-
parameters = {'observation_id': "0762470101",
199+
parameters = {'observation_id': "0861270201",
195200
'prop': 'True',
196-
'credentials_file': "astroquery/esa/xmm_newton/tests/data/dummy_config.ini",
201+
'credentials_file': data_path("dummy_config.ini"),
197202
'level': "PPS",
198203
'name': 'OBSMLI',
199204
'filename': 'single',
@@ -205,7 +210,7 @@ def test_download_proprietary_data_incorrect_credentials(self, tmp_cwd):
205210
xsa.download_data(**parameters)
206211

207212
def test_download_proprietary_data_without_credentials(self, tmp_cwd):
208-
parameters = {'observation_id': "0883780101",
213+
parameters = {'observation_id': "0861270201",
209214
'level': "PPS",
210215
'name': 'OBSMLI',
211216
'filename': 'single',

docs/esa/iso/iso.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ provided by this service, see section 'Getting Tables Details'.
9191
>>> ISO.download_data('80000203', retrieval_type="OBSERVATION",
9292
... product_level="DEFAULT_DATA_SET",
9393
... filename="80000203", verbose=True)
94-
INFO: http://nida.esac.esa.int/nida-sl-tap/data?retrieval_type=OBSERVATION&DATA_RETRIEVAL_ORIGIN=astroquery&tdt=80000203&product_level=DEFAULT_DATA_SET [astroquery.esa.iso.core]
94+
INFO: https://nida.esac.esa.int/nida-sl-tap/data?retrieval_type=OBSERVATION&DATA_RETRIEVAL_ORIGIN=astroquery&tdt=80000203&product_level=DEFAULT_DATA_SET [astroquery.esa.iso.core]
9595
INFO: Copying file to 80000203.tar... [astroquery.esa.iso.core]
96-
INFO: Wrote http://nida.esac.esa.int/nida-sl-tap/data?retrieval_type=OBSERVATION&DATA_RETRIEVAL_ORIGIN=astroquery&tdt=80000203&product_level=DEFAULT_DATA_SET to 80000203.tar [astroquery.esa.iso.core]
96+
INFO: Wrote https://nida.esac.esa.int/nida-sl-tap/data?retrieval_type=OBSERVATION&DATA_RETRIEVAL_ORIGIN=astroquery&tdt=80000203&product_level=DEFAULT_DATA_SET to 80000203.tar [astroquery.esa.iso.core]
9797
'80000203.tar'
9898
>>> tar = tarfile.open("80000203.tar")
9999
>>> tar.list() # doctest: +IGNORE_OUTPUT
@@ -102,7 +102,6 @@ provided by this service, see section 'Getting Tables Details'.
102102
-rw-r--r-- idaops/0 14400 2005-12-23 11:02:55 ././ISO1659972236/EXTRAKON//psph80000203.fits
103103
-rw-r--r-- idaops/0 5599 2005-12-23 11:02:55 ././ISO1659972236/EXTRAKON//ppch80000203.gif
104104
-rw-r--r-- idaops/0 266240 2005-12-23 11:02:54 ././ISO1659972236/EXTRAKON//C10180000203.tar
105-
>>> tar.extract("././ISO1659972236/EXTRAKON//psph80000203.fits") # doctest: +SKIP
106105
>>> tar.extractall()
107106
>>> tar.close()
108107

docs/esa/jwst/jwst.rst

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,14 @@ Using the observation ID as input parameter, this function will retrieve the obs
308308
.. doctest-remote-data::
309309
310310
>>> from astroquery.esa.jwst import Jwst
311-
>>> observation_id = 'jw01076-o110_s01130_nircam_f444w-grismr'
311+
>>> observation_id = 'jw02739-o001_t001_nircam_clear-f444w'
312312
>>> results = Jwst.get_related_observations(observation_id=observation_id)
313-
>>> results
314-
['jw01076110001_02101_00001_nrcalong',
315-
'jw01076110001_02101_00001_nrcblong',
316-
'jw01076110001_02101_00002_nrcalong',
317-
'jw01076110001_02101_00002_nrcblong',
318-
'jw01076110001_02101_00003_nrcalong',
319-
'jw01076110001_02101_00003_nrcblong',
320-
'jw01076110001_02101_00004_nrcalong',
321-
'jw01076110001_02101_00004_nrcblong']
313+
>>> results[0:5]
314+
['jw02739001001_02105_00001_nrcalong',
315+
'jw02739001001_02105_00001_nrcblong',
316+
'jw02739001001_02105_00002_nrcalong',
317+
'jw02739001001_02105_00002_nrcblong',
318+
'jw02739001001_02105_00003_nrcalong']
322319
323320
324321
1.5 Getting public tables

0 commit comments

Comments
 (0)