import scope
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.
target = scope.generate_target()
target.plot()
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
).
tpf = target.targetpixelfile
flux = target.lightcurve
err = target.error
target.add_transit().plot()
To return a lightcurve de-trended with second order PLD, use the detrend()
function.
detrended_target = target.detrend()
lc = detrended_target.lightcurve
tpf = detrended_target.targetpixelfile
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.
target.add_variability().plot()
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).
scope.generate_target(roll=5, apsize=13).add_transit().plot()
Alternatively, a Target
can be instantiated with both variability and transits with default parameters by calling
scope.generate_target(transit=True, variable=True).plot()
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.
target.display_detector()
target.display_aperture()