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