|
10 | 10 | from zipfile import ZipFile
|
11 | 11 | from pathlib import Path
|
12 | 12 |
|
| 13 | +from astropy import units as u |
13 | 14 | from astropy.coordinates import Angle
|
14 | 15 | from astropy.io import fits
|
15 | 16 | from astropy.utils.console import ProgressBar
|
16 | 17 | from astroquery import log
|
17 |
| -import astropy.units |
18 | 18 | from requests import HTTPError
|
19 | 19 | from requests import ConnectionError
|
20 | 20 |
|
@@ -51,7 +51,7 @@ class ESASkyClass(BaseQuery):
|
51 | 51 | __ACCESS_URL_STRING = "access_url"
|
52 | 52 | __USE_INTERSECT_STRING = "useIntersectPolygonInsteadOfContainsPoint"
|
53 | 53 | __ZERO_ARCMIN_STRING = "0 arcmin"
|
54 |
| - __MIN_RADIUS_CATALOG_DEG = Angle(5*astropy.units.arcsec).to_value(astropy.units.deg) |
| 54 | + __MIN_RADIUS_CATALOG_DEG = Angle(5 * u.arcsec).to_value(u.deg) |
55 | 55 |
|
56 | 56 | __HERSCHEL_STRING = 'herschel'
|
57 | 57 | __HST_STRING = 'hst'
|
@@ -114,7 +114,7 @@ def query(self, query, *, output_file=None, output_format="votable", verbose=Fal
|
114 | 114 | if not verbose:
|
115 | 115 | with warnings.catch_warnings():
|
116 | 116 | commons.suppress_vo_warnings()
|
117 |
| - warnings.filterwarnings("ignore", category=astropy.units.core.UnitsWarning) |
| 117 | + warnings.filterwarnings("ignore", category=u.UnitsWarning) |
118 | 118 | job = self._tap.launch_job(query=query, output_file=output_file, output_format=output_format,
|
119 | 119 | verbose=False, dump_to_file=output_file is not None)
|
120 | 120 | else:
|
@@ -1347,8 +1347,7 @@ def get_spectra_from_table(self, query_table_list, missions=__ALL_STRING,
|
1347 | 1347 | return spectra
|
1348 | 1348 |
|
1349 | 1349 | def _sanitize_input_radius(self, radius):
|
1350 |
| - if (isinstance(radius, str) or isinstance(radius, |
1351 |
| - astropy.units.Quantity)): |
| 1350 | + if isinstance(radius, (str, u.Quantity)): |
1352 | 1351 | return radius
|
1353 | 1352 | else:
|
1354 | 1353 | raise ValueError("Radius must be either a string or "
|
@@ -1554,7 +1553,7 @@ def _open_fits(self, path, verbose=False):
|
1554 | 1553 | if verbose:
|
1555 | 1554 | return fits.open(path)
|
1556 | 1555 | with warnings.catch_warnings():
|
1557 |
| - warnings.filterwarnings("ignore", category=astropy.io.fits.verify.VerifyWarning) |
| 1556 | + warnings.filterwarnings("ignore", category=fits.verify.VerifyWarning) |
1558 | 1557 | return fits.open(path)
|
1559 | 1558 |
|
1560 | 1559 | def _ends_with_fits_like_extentsion(self, name):
|
@@ -1709,7 +1708,7 @@ def _query(self, name, json, verbose=False, **kwargs):
|
1709 | 1708 | def _build_region_query(self, coordinates, radius, row_limit, json):
|
1710 | 1709 | ra = coordinates.transform_to('icrs').ra.deg
|
1711 | 1710 | dec = coordinates.transform_to('icrs').dec.deg
|
1712 |
| - radius_deg = Angle(radius).to_value(astropy.units.deg) |
| 1711 | + radius_deg = Angle(radius).to_value(u.deg) |
1713 | 1712 |
|
1714 | 1713 | select_query = "SELECT "
|
1715 | 1714 | if row_limit > 0:
|
|
0 commit comments