SearchResult¶
-
class
lightkurve.search.
SearchResult
(table=None)¶ Bases:
object
Container for the results returned by
search_targetpixelfile
,search_lightcurvefile
, orsearch_tesscut
.The purpose of this class is to provide a convenient way to inspect and download products that have been identified using one of the data search functions.
- Parameters
- table
astropy.table.Table
object Astropy table returned by a join of the astroquery
Observations.query_criteria()
andObservations.get_product_list()
methods.
- table
Attributes Summary
Returns an array of dec values for targets in search
Returns an array of MAST observation IDs
Returns an array of RA values for targets in search
Returns an array of target names
Returns a table of targets and their RA & dec values produced by search
Methods Summary
download
(self[, quality_bitmask, …])Returns a single
KeplerTargetPixelFile
orKeplerLightCurveFile
object.download_all
(self[, quality_bitmask, …])Returns a
TargetPixelFileCollection
orLightCurveFileCollection
.Attributes Documentation
-
dec
¶ Returns an array of dec values for targets in search
-
obsid
¶ Returns an array of MAST observation IDs
-
ra
¶ Returns an array of RA values for targets in search
-
target_name
¶ Returns an array of target names
-
unique_targets
¶ Returns a table of targets and their RA & dec values produced by search
Methods Documentation
-
download
(self, quality_bitmask='default', download_dir=None, cutout_size=None)¶ Returns a single
KeplerTargetPixelFile
orKeplerLightCurveFile
object.If multiple files are present in
SearchResult.table
, only the first will be downloaded.- Parameters
- quality_bitmaskstr or int
Bitmask (integer) which identifies the quality flag bitmask that should be used to mask out bad cadences. If a string is passed, it has the following meaning:
“none”: no cadences will be ignored (
quality_bitmask=0
).“default”: cadences with severe quality issues will be ignored (
quality_bitmask=1130799
).“hard”: more conservative choice of flags to ignore (
quality_bitmask=1664431
). This is known to remove good data.“hardest”: removes all data that has been flagged (
quality_bitmask=2096639
). This mask is not recommended.
See the
KeplerQualityFlags
class for details on the bitmasks.- download_dirstr
Location where the data files will be stored. Defaults to “~/.lightkurve-cache” if
None
is passed.- cutout_sizeint, float or tuple
Side length of cutout in pixels. Tuples should have dimensions (y, x). Default size is (5, 5)
- Returns
- data
TargetPixelFile
orLightCurveFile
object The first entry in the products table.
- data
- Raises
- HTTPError
If the TESSCut service times out (i.e. returns HTTP status 504).
- SearchError
If any other error occurs.
-
download_all
(self, quality_bitmask='default', download_dir=None, cutout_size=None)¶ Returns a
TargetPixelFileCollection
orLightCurveFileCollection
.- Parameters
- quality_bitmaskstr or int
Bitmask (integer) which identifies the quality flag bitmask that should be used to mask out bad cadences. If a string is passed, it has the following meaning:
“none”: no cadences will be ignored (
quality_bitmask=0
).“default”: cadences with severe quality issues will be ignored (
quality_bitmask=1130799
).“hard”: more conservative choice of flags to ignore (
quality_bitmask=1664431
). This is known to remove good data.“hardest”: removes all data that has been flagged (
quality_bitmask=2096639
). This mask is not recommended.
See the
KeplerQualityFlags
class for details on the bitmasks.- download_dirstr
Location where the data files will be stored. Defaults to “~/.lightkurve-cache” if
None
is passed.- cutout_sizeint, float or tuple
Side length of cutout in pixels. Tuples should have dimensions (y, x). Default size is (5, 5)
- Returns
- collection
Collection
object Returns a
LightCurveFileCollection
orTargetPixelFileCollection
, containing all entries in the products table
- collection
- Raises
- HTTPError
If the TESSCut service times out (i.e. returns HTTP status 504).
- SearchError
If any other error occurs.