In [1]:
import scope

Stellar Light Curves

Target objects can be instantiated by calling scope.generate_target(). By default, generate_target() uses the motion vectors of the target EPIC ID: 205998445, a fairly standard C3 K2 target. This can be changed with the ID parameter.

In [2]:
target = scope.generate_target()
target.plot()
100%|██████████| 1000/1000 [01:52<00:00,  8.79it/s]

generate_target() can take a stellar magnitude with the mag parameter (defaults to mag=12.0). We can easily access the following important parameters: target pixel file light curve (tpf), a 1-dimensional flux light curve (flux), and a light curve containing the error in each pixel (err).

In [3]:
tpf = target.targetpixelfile
flux = target.lightcurve
err = target.error
In [4]:
target.add_transit().plot()

To return a lightcurve de-trended with second order PLD, use the detrend() function.

In [5]:
detrended_target = target.detrend()
lc = detrended_target.lightcurve
tpf = detrended_target.targetpixelfile

Variability

Stellar variability can be injected into a light curve in a similar way to injecting transits. To add simple simusoidal variability, call the add_variability() function. add_variability() can take amplitude (var_amp) and frequency (freq).

Alternatively, a custom variability array of length target.ncadences can be passed into add_variability() with the custom_variability parameter.

In [6]:
target.add_variability().plot()

High Roll

To create a light curve with increased spacecraft roll, the roll parameter (default to 1.0) can be changed in the generate_target() function. Let's generate a light curve with 5.0x current spacecraft motion. To avoid flux loss off the edge of the aperture, the apsize parameter has been increased to 9 (from default 7).

In [7]:
scope.generate_target(roll=5, apsize=13).add_transit().plot()
100%|██████████| 1000/1000 [06:17<00:00,  2.78it/s]

Default Target Parameters

Alternatively, a Target can be instantiated with both variability and transits with default parameters by calling

In [8]:
scope.generate_target(transit=True, variable=True).plot()
100%|██████████| 1000/1000 [01:39<00:00, 10.07it/s]

Detector and Aperture

The CCD detector (with given parameters, or default if no parameters given) and aperture can be displayed with the display_detector() and display_aperture() functions.

In [9]:
target.display_detector()
In [10]:
target.display_aperture()