Skip to content

Commit cacb6e2

Browse files
committed
get_images doc
2 parents db9c401 + ce3ba90 commit cacb6e2

File tree

3 files changed

+31
-17
lines changed

3 files changed

+31
-17
lines changed

astroquery/desi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
DESI LegacySurvery
55
66
https://www.legacysurvey.org/
7-
-------------------------
7+
-----------------------------
88
99
:author: Gabriele Barni ([email protected])
1010
"""

astroquery/desi/core.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,30 @@ def query_region(self, coordinates, radius=None, *, data_release=9):
2626
Parameters
2727
----------
2828
coordinates : `~astropy.coordinates.SkyCoord`
29-
coordinates around which to query.
29+
coordinates around which we define our region of interest.
3030
radius : `~astropy.units.Quantity`, optional
31-
the radius of the region. If missing, set to default
32-
value of 0.5 arcmin.
33-
data_release: int
31+
the radius of the region to search.
32+
Default to a value of 0.5 arcmin.
33+
data_release: int, optional
3434
the data release of the LegacySurvey to use.
35+
Default to 9.
3536
3637
Returns
3738
-------
3839
response : `~astropy.table.Table`
3940
"""
4041

4142
if radius is None:
42-
radius = Quantity(0.5, unit='arcmin')
43+
radius = Quantity(0.5, u.arcmin)
4344

4445
tap_service = vo.dal.TAPService(conf.tap_service_url)
4546
coordinates_transformed = coordinates.transform_to(coord.ICRS)
4647

4748
qstr = (f"SELECT all * FROM ls_dr{data_release}.tractor WHERE "
48-
f"dec>{(coordinates_transformed.dec - radius).to(u.deg).value} and "
49-
f"dec<{(coordinates_transformed.dec + radius).to(u.deg).value} and "
50-
f"ra>{coordinates_transformed.ra.to(u.deg).value - radius.to(u.deg).value / np.cos(coordinates_transformed.dec.to(u.deg).value * np.pi / 180.)} and "
51-
f"ra<{coordinates_transformed.ra.to(u.deg).value + radius.to(u.deg).value / np.cos(coordinates_transformed.dec.to(u.deg).value * np.pi / 180)}")
49+
f"dec>{(coordinates_transformed.dec - radius).to_value(u.deg)} and "
50+
f"dec<{(coordinates_transformed.dec + radius).to_value(u.deg)} and "
51+
f"ra>{coordinates_transformed.ra.to_value(u.deg) - radius.to_value(u.deg) / np.cos(coordinates_transformed.dec.to_value(u.deg) * np.pi / 180.)} and "
52+
f"ra<{coordinates_transformed.ra.to_value(u.deg) + radius.to_value(u.deg) / np.cos(coordinates_transformed.dec.to_value(u.deg) * np.pi / 180)}")
5253

5354
tap_result = tap_service.run_sync(qstr)
5455
tap_result = tap_result.to_table()
@@ -58,23 +59,29 @@ def query_region(self, coordinates, radius=None, *, data_release=9):
5859

5960
return filtered_table
6061

61-
def get_images(self, position, pixels, radius=None, *, data_release=9, show_progress=True, image_band='g'):
62+
def get_images(self, position, pixels=None, radius=None, *, data_release=9, show_progress=True, image_band='g'):
6263
"""
6364
Downloads the images for a certain region of interest.
6465
6566
Parameters
66-
-------
67-
position: `~astropy.coordinates`.
67+
----------
68+
position: `~astropy.coordinates.SkyCoord`
6869
coordinates around which we define our region of interest.
69-
radius: `~astropy.units.Quantity`, optional
70+
pixels: 'int', optional
71+
pixel dimensions of the image to be produced.
72+
Default to 60.
73+
radius: `~astropy.units.Quantity`, optional
7074
the radius of our region of interest.
75+
Default to a value of 0.5 arcmin.
7176
data_release: int, optional
7277
the data release of the LegacySurvey to use.
78+
Default to 9.
7379
show_progress: bool, optional
74-
Whether to display a progress bar if the file is downloaded
75-
from a remote server. Default is True.
80+
whether to display a progress bar if the file is downloaded from a remote server.
81+
Default to True.
7682
image_band: str, optional
77-
Default to 'g'
83+
indicates the desired band.
84+
Default to 'g'.
7885
7986
Returns
8087
-------

docs/desi/desi.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,10 @@ All the information we need can be found within the object "im".
9090

9191
The variable "im" is a list of `~astropy.io.fits.HDUList` objects, one entry for
9292
each corresponding object.
93+
94+
95+
Reference/API
96+
=============
97+
98+
.. automodapi:: astroquery.desi
99+
:no-inheritance-diagram:

0 commit comments

Comments
 (0)