@@ -106,7 +106,8 @@ def __init__(self):
106
106
}
107
107
self ._service_api_connection .set_service_params (services , "tesscut" )
108
108
109
- def get_sectors (self , * , coordinates = None , radius = 0 * u .deg , objectname = None , moving_target = False , mt_type = None ):
109
+ def get_sectors (self , * , coordinates = None , radius = 0 * u .deg , product = 'SPOC' , objectname = None ,
110
+ moving_target = False , mt_type = None ):
110
111
"""
111
112
Get a list of the TESS data sectors whose footprints intersect
112
113
with the given search area.
@@ -126,6 +127,14 @@ def get_sectors(self, *, coordinates=None, radius=0*u.deg, objectname=None, movi
126
127
`astropy.units` may also be used.
127
128
128
129
NOTE: If moving_target is supplied, this argument is ignored.
130
+ product : str
131
+ Default is 'SPOC'.
132
+ The product whose sectors will be returned. Options are: 'SPOC' or 'TICA', for the Science Processing
133
+ Operations Center (SPOC) products, and the TESS Image CAlibration (TICA) high-level science products,
134
+ respectively. TICA products will usually be available for the latest sectors sooner than their SPOC
135
+ counterparts, but are not available for sectors 1-26.
136
+
137
+ NOTE: TICA is currently not available for moving targets.
129
138
objectname : str, optional
130
139
The target around which to search, by name (objectname="M104")
131
140
or TIC ID (objectname="TIC 141914082"). If moving_target is True, input must be the name or ID
@@ -152,6 +161,10 @@ def get_sectors(self, *, coordinates=None, radius=0*u.deg, objectname=None, movi
152
161
153
162
if moving_target :
154
163
164
+ # The Moving Targets service is currently only available for SPOC
165
+ if product .upper () != "SPOC" :
166
+ raise InvalidQueryError ("Only SPOC is available for moving targets queries." )
167
+
155
168
# Check that objectname has been passed in and coordinates
156
169
# is not
157
170
if coordinates :
@@ -163,7 +176,7 @@ def get_sectors(self, *, coordinates=None, radius=0*u.deg, objectname=None, movi
163
176
"`JPL ephemerides service <https://ssd.jpl.nasa.gov/horizons.cgi>`__) "
164
177
"of a moving target such as an asteroid or comet." )
165
178
166
- params = {"obj_id" : objectname }
179
+ params = {"product" : product . upper (), " obj_id" : objectname }
167
180
168
181
# Add optional parameter is present
169
182
if mt_type :
@@ -179,9 +192,14 @@ def get_sectors(self, *, coordinates=None, radius=0*u.deg, objectname=None, movi
179
192
# If radius is just a number we assume degrees
180
193
radius = Angle (radius , u .deg )
181
194
195
+ # Making sure input product is either SPOC or TICA
196
+ if product .upper () not in ['TICA' , 'SPOC' ]:
197
+ raise InvalidQueryError ("Input product must either be SPOC or TICA." )
198
+
182
199
params = {"ra" : coordinates .ra .deg ,
183
200
"dec" : coordinates .dec .deg ,
184
- "radius" : radius .deg }
201
+ "radius" : radius .deg ,
202
+ "product" : product .upper ()}
185
203
186
204
response = self ._service_api_connection .service_request_async ("sector" , params )
187
205
@@ -204,8 +222,8 @@ def get_sectors(self, *, coordinates=None, radius=0*u.deg, objectname=None, movi
204
222
warnings .warn ("Coordinates are not in any TESS sector." , NoResultsWarning )
205
223
return Table (sector_dict )
206
224
207
- def download_cutouts (self , * , coordinates = None , size = 5 , sector = None , path = "." , inflate = True ,
208
- objectname = None , moving_target = False , mt_type = None , verbose = False ):
225
+ def download_cutouts (self , * , coordinates = None , size = 5 , sector = None , product = 'SPOC' , path = "." ,
226
+ inflate = True , objectname = None , moving_target = False , mt_type = None , verbose = False ):
209
227
"""
210
228
Download cutout target pixel file(s) around the given coordinates with indicated size.
211
229
@@ -228,6 +246,14 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, path=".", i
228
246
Optional.
229
247
The TESS sector to return the cutout from. If not supplied, cutouts
230
248
from all available sectors on which the coordinate appears will be returned.
249
+ product : str
250
+ Default is 'SPOC'.
251
+ The product that the cutouts will be made out of. Options are: 'SPOC' or 'TICA', for the Science Processing
252
+ Operations Center (SPOC) products, and the TESS Image CAlibration (TICA) high-level science products,
253
+ respectively. TICA products will usually be available for the latest sectors sooner than their SPOC
254
+ counterparts, but are not available for sectors 1-26.
255
+
256
+ NOTE: TICA is currently not available for moving targets.
231
257
path : str
232
258
Optional.
233
259
The directory in which the cutouts will be saved.
@@ -262,6 +288,10 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, path=".", i
262
288
263
289
if moving_target :
264
290
291
+ # The Moving Targets service is currently only available for SPOC
292
+ if product .upper () != "SPOC" :
293
+ raise InvalidQueryError ("Only SPOC is available for moving targets queries." )
294
+
265
295
# Check that objectname has been passed in and coordinates
266
296
# is not
267
297
if coordinates :
@@ -273,7 +303,7 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, path=".", i
273
303
"`JPL ephemerides service <https://ssd.jpl.nasa.gov/horizons.cgi>`__) "
274
304
"of a moving target such as an asteroid or comet." )
275
305
276
- astrocut_request = f"moving_target/astrocut?obj_id={ objectname } "
306
+ astrocut_request = f"moving_target/astrocut?obj_id={ objectname } &product= { product . upper () } "
277
307
if mt_type :
278
308
astrocut_request += f"&obj_type={ mt_type } "
279
309
@@ -288,6 +318,12 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, path=".", i
288
318
size_dict = _parse_cutout_size (size )
289
319
astrocut_request += f"&y={ size_dict ['y' ]} &x={ size_dict ['x' ]} &units={ size_dict ['units' ]} "
290
320
321
+ # Making sure input product is either SPOC or TICA,
322
+ # and adding the argument to the request URL
323
+ if product .upper () not in ['TICA' , 'SPOC' ]:
324
+ raise InvalidQueryError ("Input product must either be SPOC or TICA." )
325
+ astrocut_request += f"&product={ product .upper ()} "
326
+
291
327
if sector :
292
328
astrocut_request += "§or={}" .format (sector )
293
329
@@ -322,7 +358,7 @@ def download_cutouts(self, *, coordinates=None, size=5, sector=None, path=".", i
322
358
localpath_table ['Local Path' ] = [path + x for x in cutout_files ]
323
359
return localpath_table
324
360
325
- def get_cutouts (self , * , coordinates = None , size = 5 , sector = None ,
361
+ def get_cutouts (self , * , coordinates = None , size = 5 , product = 'SPOC' , sector = None ,
326
362
objectname = None , moving_target = False , mt_type = None ):
327
363
"""
328
364
Get cutout target pixel file(s) around the given coordinates with indicated size,
@@ -343,6 +379,14 @@ def get_cutouts(self, *, coordinates=None, size=5, sector=None,
343
379
``(ny, nx)`` order. Scalar numbers in ``size`` are assumed to be in
344
380
units of pixels. `~astropy.units.Quantity` objects must be in pixel or
345
381
angular units.
382
+ product : str
383
+ Default is 'SPOC'.
384
+ The product that the cutouts will be made out of. Options are: 'SPOC' or 'TICA', for the Science Processing
385
+ Operations Center (SPOC) products, and the TESS Image CAlibration (TICA) high-level science products,
386
+ respectively. TICA products will usually be available for the latest sectors sooner than their SPOC
387
+ counterparts, but are not available for sectors 1-26.
388
+
389
+ NOTE: TICA is currently not available for moving targets.
346
390
sector : int
347
391
Optional.
348
392
The TESS sector to return the cutout from. If not supplied, cutouts
@@ -379,6 +423,12 @@ def get_cutouts(self, *, coordinates=None, size=5, sector=None,
379
423
380
424
if moving_target :
381
425
426
+ # The Moving Targets service is currently only available for SPOC
427
+ if product .upper () != "SPOC" :
428
+ raise InvalidQueryError ("Only SPOC is available for moving targets queries." )
429
+
430
+ param_dict ['product' ] = product .upper ()
431
+
382
432
# Check that objectname has been passed in and coordinates
383
433
# is not
384
434
if coordinates :
@@ -400,6 +450,12 @@ def get_cutouts(self, *, coordinates=None, size=5, sector=None,
400
450
401
451
else :
402
452
453
+ # Making sure input product is either SPOC or TICA, then add the `product` param
454
+ if product .upper () not in ['TICA' , 'SPOC' ]:
455
+ raise InvalidQueryError ("Input product must either be SPOC or TICA." )
456
+
457
+ param_dict ['product' ] = product .upper ()
458
+
403
459
# Get Skycoord object for coordinates/object
404
460
coordinates = parse_input_location (coordinates , objectname )
405
461
0 commit comments