11.. _astroquery.desi :
22
3- ************************************
3+ *********************************************
44DESI LegacySurvey Queries (`astroquery.desi `)
5- ************************************
5+ *********************************************
66
77Getting started
88===============
@@ -12,13 +12,13 @@ Presented below are examples that illustrate the different types of queries
1212that can be formulated.
1313
1414Query a region
15- ===============
15+ ==============
1616
1717This example shows how to query a certain region with DesiLegacySurvey.
1818We'll use a set of coordinates that define the region of interest,
1919and search within a 5 arcmin radius.
2020
21- .. code-block :: python
21+ .. doctest-remote-data ::
2222
2323 >>> from astroquery.desi import DESILegacySurvey
2424 >>> from astropy.coordinates import Angle, SkyCoord
@@ -28,41 +28,43 @@ and search within a 5 arcmin radius.
2828 >>> radius = Angle(5 , unit = ' arcmin' )
2929 >>> table_out = DESILegacySurvey.query_region(coordinates, radius, data_release = 9 )
3030 >>> print (table_out[:5 ])
31-
32- ls_id dec ra ... type wise_coadd_id
33- ---------------- ------------------ ------------------ ... ---- ------------ -
31+ ls_id dec ra ... type wise_coadd_id
32+ ...
33+ ---------------- ----------------- ------------------ ... ---- -------------
3434 9907734382838387 38.12628495570797 166.0838654387131 ... PSF 1667p378
3535 9907734382838488 38.12798336424771 166.0922968862182 ... PSF 1667p378
3636 9907734382838554 38.12858283671958 166.0980673954384 ... REX 1667p378
37- 9907734382838564 38.12840803351445 166.09921863682337 ... EXP 1667p378
38- 9907734382838584 38.12836885301038 166.10070750146636 ... REX 1667p378
37+ 9907734382838564 38.12840803351445 166.09921863682337 ... EXP 1667p378
38+ 9907734382838584 38.12836885301038 166.10070750146636 ... REX 1667p378
3939
4040The result is an astropy.Table.
4141
4242Get images
43- ===============
43+ ==========
4444
4545To download images for a certain region of interest,
4646we can define our region in the same way used in the example above.
4747
48- .. code-block :: python
48+ .. doctest-remote-data ::
4949
5050 >>> from astroquery.desi import DESILegacySurvey
5151 >>> from astropy.coordinates import Angle, SkyCoord
52+ >>>
5253 >>> ra = Angle(' 11h04m27s' , unit = ' hourangle' ).degree
5354 >>> dec = Angle(' +38d12m32s' , unit = ' hourangle' ).degree
54- >> > pos = SkyCoord(ra, dec, unit = ' degree' )
55- >> > radius = Angle(0.5 , unit = ' arcmin' )
55+ >>> radius_input = 0.5
5656 >>> pixels = 60
57- >> > im = DESILegacySurvey.get_images(pos, data_release = 9 , radius = radius, pixels = pixels)
57+ >>>
58+ >>> pos = SkyCoord(ra, dec, unit = ' degree' )
59+ >>> radius = Angle(radius_input, unit = ' arcmin' )
60+ >>> im = DESILegacySurvey.get_images(pos, pixels, radius, data_release = 9 )
5861
5962All the information we need can be found within the object "im".
6063
61- .. code-block :: python
64+ .. doctest-remote-data ::
6265
6366 >>> hdul = im[0 ]
6467 >>> hdul[0 ].header
65-
6668 SIMPLE = T / file does conform to FITS standard
6769 BITPIX = -32 / number of bits per data pixel
6870 NAXIS = 2 / number of data axes
@@ -88,24 +90,3 @@ All the information we need can be found within the object "im".
8890
8991The variable "im" is a list of `~astropy.io.fits.HDUList ` objects, one entry for
9092each corresponding object.
91-
92- In case a set of not valid coordinates is provided, then a `astroquery.exceptions.NoResultsWarning `
93- exception is raised, as shown in the example below.
94-
95- .. code-block :: python
96-
97- >> > from astroquery.desi import DESILegacySurvey
98- >> > from astropy.coordinates import Angle, SkyCoord
99- >> > ra = Angle(' 86.633212' , unit = ' degree' ).degree
100- >> > dec = Angle(' 22.01446' , unit = ' degree' ).degree
101- >> > radius_input = 3
102- >> > pixels = 1296000
103-
104- >> > pos = SkyCoord(ra, dec, unit = ' degree' )
105- >> > radius = Angle(radius_input, unit = ' arcmin' )
106- >> > pixels = 60
107- >> > im = DESILegacySurvey.get_images(pos, data_release = 9 , radius = radius, pixels = pixels)
108-
109- .. code-block :: python
110-
111- astroquery.exceptions.NoResultsWarning: HTTP Error 500 : Internal Server Error - Problem retrieving the file at the url: https:// www.legacysurvey.org/ viewer/ fits- cutout? ra= 86.633212 & dec= 22.01446 & size= 1296000 & layer= ls- dr9& pixscale= 0.0002777777777777778 & bands= g
0 commit comments