Skip to content

Commit b7f2553

Browse files
authored
Merge pull request #2131 from bsipocz/ipac_namespace
New ipac namespace to restructure modules
2 parents fadc456 + f001fe2 commit b7f2553

File tree

132 files changed

+520
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+520
-430
lines changed

astroquery/ibe/__init__.py

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,9 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2-
"""
3-
IRSA Image Server program interface (IBE) Query Tool
4-
====================================================
52

6-
This module contains various methods for querying the
7-
IRSA Image Server program interface (IBE).
8-
"""
9-
from astropy import config as _config
103

4+
import warnings
115

12-
class Conf(_config.ConfigNamespace):
13-
"""
14-
Configuration parameters for `astroquery.ibe`.
15-
"""
6+
warnings.warn("the ``ibe`` module has been moved to astroquery.ipac.irsa.ibe, "
7+
"please update your imports.", DeprecationWarning, stacklevel=2)
168

17-
server = _config.ConfigItem(
18-
'https://irsa.ipac.caltech.edu/ibe/',
19-
'Name of the IBE server to use.')
20-
mission = _config.ConfigItem(
21-
'ptf',
22-
('Default mission. See, for example, '
23-
'https://irsa.ipac.caltech.edu/ibe/search/ for options.'))
24-
25-
dataset = _config.ConfigItem(
26-
'images',
27-
('Default data set. See, for example, '
28-
'https://irsa.ipac.caltech.edu/ibe/search/ptf for options.'))
29-
table = _config.ConfigItem(
30-
'level1',
31-
('Default table. See, for example, '
32-
'https://irsa.ipac.caltech.edu/ibe/search/ptf/images for options.'))
33-
timeout = _config.ConfigItem(
34-
120,
35-
'Time limit for connecting to the IRSA server.')
36-
37-
38-
conf = Conf()
39-
40-
41-
from .core import Ibe, IbeClass
42-
43-
__all__ = ['Ibe', 'IbeClass',
44-
'Conf', 'conf',
45-
]
9+
from astroquery.ipac.irsa.ibe import *
File renamed without changes.

astroquery/ipac/irsa/__init__.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
"""
3+
IRSA Query Tool
4+
===============
5+
6+
This module contains various methods for querying the
7+
IRSA Catalog Query Service(CatQuery).
8+
"""
9+
from astropy import config as _config
10+
11+
12+
class Conf(_config.ConfigNamespace):
13+
"""
14+
Configuration parameters for `astroquery.ipac.irsa`.
15+
"""
16+
17+
server = _config.ConfigItem(
18+
'https://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-query',
19+
'Name of the IRSA mirror to use.')
20+
gator_list_catalogs = _config.ConfigItem(
21+
'https://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-scan',
22+
'URL from which to list all the public catalogs in IRSA.')
23+
row_limit = _config.ConfigItem(
24+
500,
25+
'Maximum number of rows to retrieve in result')
26+
timeout = _config.ConfigItem(
27+
60,
28+
'Time limit for connecting to the IRSA server.')
29+
30+
31+
conf = Conf()
32+
33+
34+
from .core import Irsa, IrsaClass
35+
36+
__all__ = ['Irsa', 'IrsaClass',
37+
'Conf', 'conf',
38+
]

astroquery/irsa/core.py renamed to astroquery/ipac/irsa/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
from astroquery.query import BaseQuery
111111
from astroquery.utils import commons, async_to_sync
112-
from astroquery.irsa import conf
112+
from astroquery.ipac.irsa import conf
113113
from astroquery.exceptions import TableParseError, NoResultsWarning, InvalidQueryError
114114

115115

@@ -129,7 +129,7 @@ def query_region_async(self, coordinates=None, *, catalog=None,
129129
selcols=None, verbose=False, cache=True):
130130
"""
131131
This function serves the same purpose as
132-
:meth:`~astroquery.irsa.IrsaClass.query_region`, but returns the raw
132+
:meth:`~astroquery.ipac.irsa.IrsaClass.query_region`, but returns the raw
133133
HTTP response rather than the results in a `~astropy.table.Table`.
134134
135135
Parameters
@@ -144,7 +144,7 @@ def query_region_async(self, coordinates=None, *, catalog=None,
144144
if spatial is ``'Polygon'``.
145145
catalog : str
146146
The catalog to be used. To list the available catalogs, use
147-
:meth:`~astroquery.irsa.IrsaClass.print_catalogs`.
147+
:meth:`~astroquery.ipac.irsa.IrsaClass.print_catalogs`.
148148
spatial : str
149149
Type of spatial query: ``'Cone'``, ``'Box'``, ``'Polygon'``, and
150150
``'All-Sky'``. If missing then defaults to ``'Cone'``.

astroquery/ipac/irsa/ibe/__init__.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2+
"""
3+
IRSA Image Server program interface (IBE) Query Tool
4+
====================================================
5+
6+
This module contains various methods for querying the
7+
IRSA Image Server program interface (IBE).
8+
"""
9+
from astropy import config as _config
10+
11+
12+
class Conf(_config.ConfigNamespace):
13+
"""
14+
Configuration parameters for `astroquery.ipac.irsa.ibe`.
15+
"""
16+
17+
server = _config.ConfigItem(
18+
'https://irsa.ipac.caltech.edu/ibe/',
19+
'Name of the IBE server to use.')
20+
mission = _config.ConfigItem(
21+
'ptf',
22+
('Default mission. See, for example, '
23+
'https://irsa.ipac.caltech.edu/ibe/search/ for options.'))
24+
25+
dataset = _config.ConfigItem(
26+
'images',
27+
('Default data set. See, for example, '
28+
'https://irsa.ipac.caltech.edu/ibe/search/ptf for options.'))
29+
table = _config.ConfigItem(
30+
'level1',
31+
('Default table. See, for example, '
32+
'https://irsa.ipac.caltech.edu/ibe/search/ptf/images for options.'))
33+
timeout = _config.ConfigItem(
34+
120,
35+
'Time limit for connecting to the IRSA server.')
36+
37+
38+
conf = Conf()
39+
40+
41+
from .core import Ibe, IbeClass
42+
43+
__all__ = ['Ibe', 'IbeClass',
44+
'Conf', 'conf',
45+
]

astroquery/ibe/core.py renamed to astroquery/ipac/irsa/ibe/core.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@
1515

1616
import astropy.coordinates as coord
1717
from astropy.table import Table
18-
import six
1918

20-
from ..exceptions import InvalidQueryError
21-
from ..query import BaseQuery
22-
from ..utils import commons
23-
from . import conf
19+
from astroquery.exceptions import InvalidQueryError
20+
from astroquery.query import BaseQuery
21+
from astroquery.utils import commons
22+
from astroquery.ipac.irsa.ibe import conf
2423

2524
__all__ = ['Ibe', 'IbeClass']
2625

@@ -32,10 +31,9 @@ class IbeClass(BaseQuery):
3231
TABLE = conf.table
3332
TIMEOUT = conf.timeout
3433

35-
def query_region(
36-
self, coordinate=None, where=None, mission=None, dataset=None,
37-
table=None, columns=None, width=None, height=None,
38-
intersect='OVERLAPS', most_centered=False):
34+
def query_region(self, coordinate=None, where=None, mission=None, dataset=None,
35+
table=None, columns=None, width=None, height=None,
36+
intersect='OVERLAPS', most_centered=False):
3937
"""
4038
For certain missions, this function can be used to search for image and
4139
catalog files based on a point, a box (bounded by great circles) and/or
@@ -129,11 +127,9 @@ def query_region_sia(self, coordinate=None, mission=None,
129127
return commons.parse_votable(
130128
response.text).get_first_table().to_table()
131129

132-
def query_region_async(
133-
self, coordinate=None, where=None, mission=None, dataset=None,
134-
table=None, columns=None, width=None, height=None,
135-
action='search',
136-
intersect='OVERLAPS', most_centered=False):
130+
def query_region_async(self, coordinate=None, where=None, mission=None, dataset=None,
131+
table=None, columns=None, width=None, height=None,
132+
action='search', intersect='OVERLAPS', most_centered=False):
137133
"""
138134
For certain missions, this function can be used to search for image and
139135
catalog files based on a point, a box (bounded by great circles) and/or
@@ -243,7 +239,7 @@ def query_region_async(
243239
args['where'] = where
244240

245241
if columns:
246-
if isinstance(columns, six.string_types):
242+
if isinstance(columns, str):
247243
columns = columns.split()
248244
args['columns'] = ','.join(columns)
249245

@@ -291,7 +287,7 @@ def list_datasets(self, mission=None, cache=True):
291287
----------
292288
mission : str
293289
A mission name. Must be one of the valid missions from
294-
`~astroquery.ibe.IbeClass.list_missions`. Defaults to the
290+
`~astroquery.ipac.irsa.ibe.IbeClass.list_missions`. Defaults to the
295291
configured Mission
296292
cache : bool
297293
Cache the query result
@@ -323,9 +319,9 @@ def list_datasets(self, mission=None, cache=True):
323319
def list_tables(self, mission=None, dataset=None, cache=True):
324320
"""
325321
For a given mission and dataset (see
326-
`~.astroquery.ibe.IbeClass.list_missions`,
327-
`~astroquery.ibe.IbeClass.list_datasets`), return the list of valid
328-
table names to query.
322+
`~.astroquery.ipac.irsa.ibe.IbeClass.list_missions`,
323+
`~astroquery.ipac.irsa.ibe.IbeClass.list_datasets`),
324+
returns the list of valid table names to query.
329325
330326
Parameters
331327
----------

0 commit comments

Comments
 (0)