@@ -407,6 +407,49 @@ def query_criteria_count(self, *, pagesize=None, page=None, **criteria):
407
407
408
408
return self ._portal_api_connection .service_request (service , params )[0 ][0 ].astype (int )
409
409
410
+ def _filter_ffi_observations (self , observations ):
411
+ """
412
+ Given a `~astropy.table.Row` or `~astropy.table.Table` of observations, filter out full-frame images (FFIs)
413
+ from TESS and TICA. If any observations are filtered, warn the user.
414
+
415
+ Parameters
416
+ ----------
417
+ observations : `~astropy.table.Row` or `~astropy.table.Table`
418
+ Row/Table of MAST query results (e.g. output from `query_object`)
419
+
420
+ Returns
421
+ -------
422
+ filtered_obs_table : filtered observations Table
423
+ """
424
+ obs_table = Table (observations )
425
+ tess_ffis = obs_table [obs_table ['target_name' ] == 'TESS FFI' ]['obs_id' ]
426
+ tica_ffis = obs_table [obs_table ['target_name' ] == 'TICA FFI' ]['obs_id' ]
427
+
428
+ if tess_ffis .size :
429
+ # Warn user if TESS FFIs exist
430
+ log .warning ("Because of their large size, Astroquery should not be used to "
431
+ "download TESS FFI products.\n "
432
+ "If you are looking for TESS image data for a specific target, "
433
+ "please use TESScut at https://mast.stsci.edu/tesscut/.\n "
434
+ "If you need a TESS image for an entire field, please see our "
435
+ "dedicated page for downloading larger quantities of TESS data at \n "
436
+ "https://archive.stsci.edu/tess/. Data products will not be fetched "
437
+ "for the following observations IDs: \n "
438
+ + "\n " .join (tess_ffis ))
439
+
440
+ if tica_ffis .size :
441
+ # Warn user if TICA FFIs exist
442
+ log .warning ("Because of their large size, Astroquery should not be used to "
443
+ "download TICA FFI products.\n "
444
+ "Please see our dedicated page for downloading larger quantities of "
445
+ "TICA data: https://archive.stsci.edu/hlsp/tica.\n "
446
+ "Data products will not be fetched for the following observation IDs: \n "
447
+ + "\n " .join (tica_ffis ))
448
+
449
+ # Filter out FFIs with a mask
450
+ mask = (obs_table ['target_name' ] != 'TESS FFI' ) & (obs_table ['target_name' ] != 'TICA FFI' )
451
+ return obs_table [mask ]
452
+
410
453
@class_or_instance
411
454
def get_product_list_async (self , observations ):
412
455
"""
@@ -423,15 +466,16 @@ def get_product_list_async(self, observations):
423
466
424
467
Returns
425
468
-------
426
- response : list of `~requests.Response`
469
+ response : list of `~requests.Response`
427
470
"""
428
471
429
472
# getting the obsid list
430
- if isinstance (observations , Row ):
431
- observations = observations ["obsid" ]
432
473
if np .isscalar (observations ):
433
474
observations = np .array ([observations ])
434
- if isinstance (observations , Table ):
475
+ if isinstance (observations , Table ) or isinstance (observations , Row ):
476
+ # Filter out TESS FFIs and TICA FFIs
477
+ # Can only perform filtering on Row or Table because of access to `target_name` field
478
+ observations = self ._filter_ffi_observations (observations )
435
479
observations = observations ['obsid' ]
436
480
if isinstance (observations , list ):
437
481
observations = np .array (observations )
0 commit comments