#!/usr/bin/env python # coding: utf-8 # # Quickstart # If you have a working version of [Anaconda Python](https://www.anaconda.com/distribution) installed on your system, it is easy to install Lightkurve and its dependencies using the ``conda`` package manager. In a terminal window, type: # ``` # $ conda install --channel conda-forge lightkurve # ``` # # If you are using a different Python distribution, you can also install Lightkurve using `pip install lightkurve`. See our [installation instructions](about/install.html) page for details and troubleshooting information. # # With Lightkurve installed, it is easy to extract brightness time series data (astronomers call this a *light curve*) # from the tiny images of stars collected by NASA's Kepler and TESS planet-hunting telescopes. # # For example, let's download and display the pixels of a famous star named [KIC 8462852](https://en.wikipedia.org/wiki/KIC_8462852), also known as *Tabby's Star* or *Boyajian's Star*, which is known to show unusual light fluctuations. # # First, we start Python and use the `search_targetpixelfile` function to obtain the Kepler pixel data for the star from the [data archive](https://archive.stsci.edu/kepler/): # In[1]: from lightkurve import search_targetpixelfile pixelfile = search_targetpixelfile(8462852, quarter=16).download(quality_bitmask='hardest'); # Next, let's display the first image in this data set: # In[2]: pixelfile.plot(frame=1); # It looks like the star is an isolated object, so we can extract a lightcurve by simply summing up all the pixel values in each image: # In[3]: lc = pixelfile.to_lightcurve(aperture_mask='all'); # The above method returned a `KeplerLightCurve` object which gives us access to the flux over time, which are both available as array objects. The time is in units of *days* and the flux is in units *electrons/second*. # In[4]: lc.time, lc.flux # We can plot these data using the `plot()` method: # In[5]: lc.plot(); # The plot reveals a short-lived 20% dip in the brightness of the star. It looks like we re-discovered one of the [intriguing dips in Tabby's star](https://en.wikipedia.org/wiki/KIC_8462852#Luminosity). # # Congratulations, you are now able to make new discoveries in Kepler and TESS data! # # Next, head to our [tutorials section](https://docs.lightkurve.org/tutorials) to be guided through more detailed examples of carrying out science with Lightkurve!