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