18
18
19
19
class DESILegacySurveyClass (BaseQuery ):
20
20
21
- def query_region (self , coordinates , radius = 0.5 * u .arcmin , * , data_release = 9 ):
21
+ def query_region (self , coordinates , * , width = 0.5 * u .arcmin , data_release = 9 ):
22
22
"""
23
23
Queries a region around the specified coordinates.
24
24
25
25
Parameters
26
26
----------
27
27
coordinates : `~astropy.coordinates.SkyCoord`
28
28
coordinates around which to query.
29
- radius : `~astropy.units.Quantity`, optional
30
- the radius of the region. If missing, set to default
29
+ width : `~astropy.units.Quantity`, optional
30
+ the width of the region. If missing, set to default
31
31
value of 0.5 arcmin.
32
- data_release: int
32
+ data_release : int
33
33
the data release of the LegacySurvey to use.
34
34
35
35
Returns
@@ -41,9 +41,9 @@ def query_region(self, coordinates, radius=0.5*u.arcmin, *, data_release=9):
41
41
coordinates_transformed = coordinates .transform_to (coord .ICRS )
42
42
43
43
qstr = (f"SELECT all * FROM ls_dr{ data_release } .tractor WHERE "
44
- f"dec<{ (coordinates_transformed .dec + radius ).to_value (u .deg )} and "
45
- f"ra>{ coordinates_transformed .ra .to_value (u .deg ) - radius .to_value (u .deg ) / np .cos (coordinates_transformed .dec )} and "
46
- f"ra<{ coordinates_transformed .ra .to_value (u .deg ) + radius .to_value (u .deg ) / np .cos (coordinates_transformed .dec )} " )
44
+ f"dec<{ (coordinates_transformed .dec + width ).to_value (u .deg )} and "
45
+ f"ra>{ coordinates_transformed .ra .to_value (u .deg ) - width .to_value (u .deg ) / np .cos (coordinates_transformed .dec )} and "
46
+ f"ra<{ coordinates_transformed .ra .to_value (u .deg ) + width .to_value (u .deg ) / np .cos (coordinates_transformed .dec )} " )
47
47
48
48
tap_result = tap_service .run_sync (qstr )
49
49
tap_result = tap_result .to_table ()
@@ -53,32 +53,32 @@ def query_region(self, coordinates, radius=0.5*u.arcmin, *, data_release=9):
53
53
54
54
return filtered_table
55
55
56
- def get_images (self , position , pixels = None , radius = 0.5 * u .arcmin , * , data_release = 9 , show_progress = True , image_band = 'g' ):
56
+ def get_images (self , position , * , pixels = None , width = 0.5 * u .arcmin , data_release = 9 , show_progress = True , image_band = 'g' ):
57
57
"""
58
58
Downloads the images for a certain region of interest.
59
59
60
60
Parameters
61
- -------
62
- position: `astropy.coordinates`.
61
+ ----------
62
+ position : `astropy.coordinates`.
63
63
coordinates around which we define our region of interest.
64
- radius : `~astropy.units.Quantity`, optional
65
- the radius of our region of interest.
66
- data_release: int, optional
64
+ width : `~astropy.units.Quantity`, optional
65
+ the width of our region of interest.
66
+ data_release : int, optional
67
67
the data release of the LegacySurvey to use.
68
- show_progress: bool, optional
68
+ show_progress : bool, optional
69
69
Whether to display a progress bar if the file is downloaded
70
70
from a remote server. Default is True.
71
- image_band: str, optional
71
+ image_band : str, optional
72
72
Default to 'g'
73
73
74
74
Returns
75
75
-------
76
- list: A list of `~astropy.io.fits.HDUList` objects.
76
+ list : A list of `~astropy.io.fits.HDUList` objects.
77
77
"""
78
78
79
79
position_transformed = position .transform_to (coord .ICRS )
80
80
81
- image_size_arcsec = radius .arcsec
81
+ image_size_arcsec = width .arcsec
82
82
pixsize = 2 * image_size_arcsec / pixels
83
83
84
84
image_url = (f"{ conf .legacysurvey_service_url } ?"
0 commit comments