Skip to content

Commit 924349a

Browse files
committed
changelog, docstrings
1 parent e3bddff commit 924349a

File tree

2 files changed

+56
-12
lines changed

2 files changed

+56
-12
lines changed

CHANGES.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ gaia
1919
- Rename datalink retrieval types EPOCH_SPECTRUM_RVS, EPOCH_SPECTRUM_XP_SSO, EPOCH_SPECTRUM_XP_CROWDING, MEAN_SPECTRUM_XP,
2020
EPOCH_SPECTRUM_XP and MEAN_SPECTRUM_XP_GRAVLENS. [#3382]
2121

22+
mast
23+
^^^^
24+
25+
- Deprecated the ``product`` parameter in the ``Tesscut.get_sectors``, ``Tesscut.get_cutouts``, and ``Tesscut.download_cutouts`` methods.
26+
Support for TESS Image Calibration (TICA) high-level science products has been removed; only Science Processing Operations Center (SPOC)
27+
products are now supported. [#3391]
28+
2229
Service fixes and enhancements
2330
------------------------------
2431

astroquery/mast/cutouts.py

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,30 @@ def __init__(self):
101101
self._service_api_connection.set_service_params(services, "tesscut")
102102

103103
def _validate_target_input(self, coordinates, objectname, moving_target):
104+
"""
105+
Validate the input parameters for target selection.
106+
107+
Parameters
108+
----------
109+
coordinates : str or `astropy.coordinates` object, optional
110+
The target around which to search. It may be specified as a
111+
string or as the appropriate `astropy.coordinates` object.
112+
objectname : str, optional
113+
The target around which to search, by name (objectname="M104")
114+
or TIC ID (objectname="TIC 141914082"). If moving_target is True, input must be the name or ID
115+
(as understood by the `JPL ephemerides service <https://ssd.jpl.nasa.gov/horizons/app.html>`__)
116+
of a moving target such as an asteroid or comet.
117+
moving_target : bool, optional
118+
Indicate whether the object is a moving target or not. Default is set to False, in other words,
119+
not a moving target.
120+
121+
Raises
122+
-------
123+
InvalidQueryError
124+
If ``moving_target`` is True and ``coordinates`` is provided.
125+
If ``moving_target`` is True and ``objectname`` is not provided.
126+
If both ``coordinates`` and ``objectname`` are provided.
127+
"""
104128
if moving_target:
105129
if coordinates:
106130
raise InvalidQueryError("Only one of moving_target and coordinates may be specified. "
@@ -115,17 +139,24 @@ def _validate_target_input(self, coordinates, objectname, moving_target):
115139
raise InvalidQueryError("Only one of objectname and coordinates may be specified. "
116140
"Please remove objectname if using coordinates.")
117141

118-
def _get_coordinates(self, coordinates, objectname, resolver):
119-
"""
120-
Get SkyCoord object for coordinates/objectname.
121-
"""
122-
return parse_input_location(coordinates=coordinates,
123-
objectname=objectname,
124-
resolver=resolver)
125-
126142
def _validate_product(self, product):
127143
"""
128-
Check if the product is valid.
144+
Validate the product type. "SPOC" is the only valid option.
145+
146+
Parameters
147+
----------
148+
product : str
149+
The product type to validate. Must be "SPOC".
150+
151+
Raises
152+
-------
153+
InvalidQueryError
154+
If the product is not "SPOC".
155+
156+
Returns
157+
-------
158+
str
159+
The validated product type, converted to uppercase.
129160
"""
130161
product = product.upper()
131162
if product != "SPOC":
@@ -198,7 +229,9 @@ def get_sectors(self, *, coordinates=None, radius=0*u.deg, product='SPOC', objec
198229
service = "mt_sector"
199230
else:
200231
# Get Skycoord object for coordinates/object
201-
coordinates = self._get_coordinates(coordinates, objectname, resolver)
232+
coordinates = parse_input_location(coordinates=coordinates,
233+
objectname=objectname,
234+
resolver=resolver)
202235
# If radius is just a number we assume degrees
203236
radius = Angle(radius, u.deg)
204237
params = {"ra": coordinates.ra.deg,
@@ -301,7 +334,9 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, product='SP
301334
params["obj_type"] = mt_type
302335
request_path = "moving_target/astrocut"
303336
else:
304-
coordinates = self._get_coordinates(coordinates, objectname, resolver)
337+
coordinates = parse_input_location(coordinates=coordinates,
338+
objectname=objectname,
339+
resolver=resolver)
305340
params.update({"ra": coordinates.ra.deg, "dec": coordinates.dec.deg})
306341
request_path = "astrocut"
307342

@@ -414,7 +449,9 @@ def get_cutouts(self, *, coordinates=None, size=5, product='SPOC', sector=None,
414449
service = "mt_astrocut"
415450
else:
416451
# Get Skycoord object for coordinates/object
417-
coordinates = self._get_coordinates(coordinates, objectname, resolver)
452+
coordinates = parse_input_location(coordinates=coordinates,
453+
objectname=objectname,
454+
resolver=resolver)
418455
params.update({"ra": coordinates.ra.deg, "dec": coordinates.dec.deg})
419456
service = "astrocut"
420457

0 commit comments

Comments
 (0)