Skip to content

Commit 9f1594c

Browse files
committed
allow vector obs bands
1 parent a1b5155 commit 9f1594c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

astroquery/nrao/core.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ def wrapper(*args, **kwargs):
4040
if telescope_config.upper() not in Nrao.telescope_config:
4141
raise ValueError("'telescope_config' must be one of {!s}"
4242
.format(Nrao.telescope_config))
43-
if obs_band.upper() not in Nrao.obs_bands:
43+
if isinstance(obs_band, (list, tuple)):
44+
for ob in obs_band:
45+
if ob.upper() not in Nrao.obs_bands:
46+
raise ValueError("'obs_band' must be one of {!s}"
47+
.format(Nrao.obs_bands))
48+
elif obs_band.upper() not in Nrao.obs_bands:
4449
raise ValueError("'obs_band' must be one of {!s}"
4550
.format(Nrao.obs_bands))
4651
if sub_array not in Nrao.subarrays and sub_array != 'all':
@@ -167,6 +172,12 @@ def _args_to_payload(self, **kwargs):
167172
else:
168173
freq_str = ""
169174

175+
obs_bands = kwargs.get('obs_band', 'all')
176+
if isinstance(obs_bands, six.string_types):
177+
obs_bands = obs_bands.upper()
178+
elif isinstance(obs_bands, (list,tuple)):
179+
obs_bands = [x.upper() for x in obs_bands]
180+
170181
request_payload = dict(
171182
QUERYTYPE=kwargs.get('querytype', "OBSSUMMARY"),
172183
PROTOCOL=kwargs.get('protocol',"VOTable-XML"),
@@ -195,7 +206,7 @@ def _args_to_payload(self, **kwargs):
195206
SRAD=str(
196207
commons.parse_radius(kwargs.get('radius', "1.0m")).deg) + 'd',
197208
TELESCOPE_CONFIG=kwargs.get('telescope_config', 'all').upper(),
198-
OBS_BANDS=kwargs.get('obs_band', 'all').upper(),
209+
OBS_BANDS=obs_bands,
199210
SUBARRAY=kwargs.get('subarray', 'all').upper(),
200211
SOURCE_ID=kwargs.get('source_id', ''),
201212
SRC_SEARCH_TYPE='SIMBAD or NED',

0 commit comments

Comments
 (0)