In [1]:
import lightkurve as lk
/Users/kabathpetr/anaconda3/lib/python3.11/site-packages/lightkurve/config/__init__.py:119: UserWarning: The default Lightkurve cache directory, used by download(), etc., has been moved to /Users/kabathpetr/.lightkurve/cache. Please move all the files in the legacy directory /Users/kabathpetr/.lightkurve-cache to the new location and remove the legacy directory. Refer to https://docs.lightkurve.org/reference/config.html#default-cache-directory-migration for more information.
  warnings.warn(
In [2]:
search_result = lk.search_targetpixelfile('TOI-503', mission='TESS')
# searching for all available data for TOI-503 from the TESS mission
In [3]:
search_result
# print the result of the search of all available data for TOI-503 from the TESS mission 
Out[3]:
SearchResult containing 15 data products.
#missionyearauthorexptimetarget_namedistance
sarcsec
0TESS Sector 072019SPOC1201868125300.0
1TESS Sector 072019TESS-SPOC18001868125300.0
2TESS Sector 342021SPOC201868125300.0
3TESS Sector 342021SPOC1201868125300.0
4TESS Sector 342021TESS-SPOC6001868125300.0
5TESS Sector 442021SPOC1201868125300.0
6TESS Sector 442021TESS-SPOC6001868125300.0
7TESS Sector 452021SPOC1201868125300.0
8TESS Sector 452021TESS-SPOC6001868125300.0
9TESS Sector 462021SPOC1201868125300.0
10TESS Sector 462021TESS-SPOC6001868125300.0
11TESS Sector 712023SPOC1201868125300.0
12TESS Sector 712023TESS-SPOC2001868125300.0
13TESS Sector 722023SPOC1201868125300.0
14TESS Sector 722023TESS-SPOC2001868125300.0
In [4]:
from lightkurve import search_targetpixelfile
#pixelfile = search_targetpixelfile("KIC 8462852", quarter=16).download();

pixelfile = lk.search_targetpixelfile('TOI-503', mission='TESS')#.download();
pixelfile.table["dataURL"]=pixelfile.table["dataURI"]

tes = pixelfile.download()
tes.plot(frame=1);

#searching the TPF file for TOI-503 Brown dwarf
/Users/kabathpetr/anaconda3/lib/python3.11/site-packages/lightkurve/search.py:423: LightkurveWarning: Warning: 15 files available to download. Only the first file has been downloaded. Please use `download_all()` or specify additional criteria (e.g. quarter, campaign, or sector) to limit your search.
  warnings.warn(
In [5]:
tpf = search_result.download()
/Users/kabathpetr/anaconda3/lib/python3.11/site-packages/lightkurve/search.py:423: LightkurveWarning: Warning: 15 files available to download. Only the first file has been downloaded. Please use `download_all()` or specify additional criteria (e.g. quarter, campaign, or sector) to limit your search.
  warnings.warn(
In [23]:
%matplotlib inline
tes.plot(aperture_mask=tes.pipeline_mask);

# defining the apertures
In [6]:
lc = tes.to_lightcurve()
In [7]:
lc.errorbar();
In [26]:
aperture_mask = tes.create_threshold_mask(threshold=10)

# Plot that aperture
tes.plot(aperture_mask=aperture_mask);
In [27]:
lc = tes.to_lightcurve(aperture_mask=aperture_mask)
In [28]:
lc.errorbar();
#plotting the choosen aperture light curve
In [8]:
flat_lc = lc.flatten(window_length=1001)
flat_lc.errorbar();
In [30]:
folded_lc = flat_lc.fold(period=3.6772, epoch_time=1500.0)
folded_lc.errorbar();
In [9]:
import astropy.units as u
binned_lc = folded_lc.bin(time_bin_size=1*u.minute)
binned_lc.errorbar();
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[9], line 2
      1 import astropy.units as u
----> 2 binned_lc = folded_lc.bin(time_bin_size=1*u.minute)
      3 binned_lc.errorbar()

NameError: name 'folded_lc' is not defined
In [24]:
binned_lc.scatter(s=0.9)
Out[24]:
<AxesSubplot:xlabel='Phase [JD]', ylabel='Flux [$\\mathrm{e^{-}\\,s^{-1}}$]'>
In [11]: