Skip to content

Commit c9ebd67

Browse files
committed
setting moving_target option to bool instead of its own target name or ID input
1 parent 6aa80d0 commit c9ebd67

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

astroquery/mast/cutouts.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def __init__(self):
110110
}
111111
self._service_api_connection.set_service_params(services, "tesscut")
112112

113-
def get_sectors(self, coordinates=None, radius=0*u.deg, objectname=None, moving_target=None, mt_type=None):
113+
def get_sectors(self, coordinates=None, radius=0*u.deg, objectname=None, moving_target=False, mt_type=None):
114114
"""
115115
Get a list of the TESS data sectors whose footprints intersect
116116
with the given search area.
@@ -120,27 +120,36 @@ def get_sectors(self, coordinates=None, radius=0*u.deg, objectname=None, moving_
120120
coordinates : str or `astropy.coordinates` object, optional
121121
The target around which to search. It may be specified as a
122122
string or as the appropriate `astropy.coordinates` object.
123-
One and only one of coordinates, objectname, and moving_target must be supplied.
123+
124+
NOTE: If moving_targets or objectname is supplied, this argument cannot be used.
125+
124126
radius : str, float, or `~astropy.units.Quantity` object, optional
125127
Default 0 degrees.
126128
If supplied as a float degrees is the assumed unit.
127129
The string must be parsable by `~astropy.coordinates.Angle`. The
128130
appropriate `~astropy.units.Quantity` object from
129131
`astropy.units` may also be used.
130-
This argument is ignored if moving_target is supplied.
132+
133+
NOTE: If moving_target is supplied, this argument is ignored.
134+
131135
objectname : str, optional
132136
The target around which to search, by name (objectname="M104")
133-
or TIC ID (objectname="TIC 141914082").
134-
One and only one of coordinates, objectname, moving_target must be supplied.
135-
moving_target : str, optional
136-
The name or ID (as understood by the
137+
or TIC ID (objectname="TIC 141914082"). If moving_target is True, input must be the name or ID (as understood by the
137138
`JPL ephemerides service <https://ssd.jpl.nasa.gov/horizons.cgi>`__)
138139
of a moving target such as an asteroid or comet.
139-
One and only one of coordinates, objectname, and moving_target must be supplied.
140+
141+
NOTE: If coordinates is supplied, this argument cannot be used.
142+
143+
moving_target : bool, optional
144+
Indicate whether the object is a moving target or not. Default is set to False, in other words, not a moving target.
145+
146+
NOTE: If coordinates is supplied, this argument cannot be used.
147+
140148
mt_type : str, optional
141149
The moving target type, valid inputs are majorbody and smallbody. If not supplied
142150
first majorbody is tried and then smallbody if a matching majorbody is not found.
143-
This argument is ignored unless moving_target is supplied.
151+
152+
NOTE: If moving_target is supplied, this argument is ignored.
144153
145154
Returns
146155
-------
@@ -150,11 +159,14 @@ def get_sectors(self, coordinates=None, radius=0*u.deg, objectname=None, moving_
150159

151160
if moving_target:
152161

153-
# Check only ony object designator has been passed in
154-
if objectname or coordinates:
155-
raise InvalidQueryError("Only one of objectname, coordinates, and moving_target may be specified.")
162+
# Check that objectname has been passed in
163+
if coordinates:
164+
raise InvalidQueryError("Only one of moving_target and coordinates may be specified.")
165+
166+
if not objectname:
167+
raise InvalidQueryError("Please specify the object name or ID (as understood by the `JPL ephemerides service <https://ssd.jpl.nasa.gov/horizons.cgi>`__) of a moving target such as an asteroid or comet.")
156168

157-
params = {"obj_id": moving_target}
169+
params = {"obj_id": objectname}
158170

159171
# Add optional parameter is present
160172
if mt_type:

0 commit comments

Comments
 (0)