Data Analysis Plugins#
Metadata Viewer#
This plugin allows viewing of any metadata associated with the selected data.
User API Example
See the MetadataViewer user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
metadata = lcviz.plugins['Metadata']
print(f"dataset choices: {metadata.dataset.choices}")
metadata.dataset = metadata.dataset.choices[0]
print(metadata.meta)
See also
- Jdaviz Metadata Viewer
Jdaviz documentation on the Metadata Viewer plugin.
Flux Column#
This plugin allows choosing which column in the underlying data should be used as the flux column (origin) throughout the app (when plotting and in any data analysis plugins).
User API Example
See the FluxColumn user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
flux_col = lcviz.plugins['Flux Column']
print(flux_col.flux_column.choices)
flux_col.flux_column = 'sap_flux'
See also
This plugin reproduces the behavior also available in lightkurve as:
lightkurve.LightCurve.select_flux()
Plot Options#
This plugin gives access to per-viewer and per-layer plotting options.
User API Example
See the PlotOptions user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
po = lcviz.plugins['Plot Options']
print(f"viewer choices: {po.viewer.choices}")
po.viewer = po.viewer.choices[0]
print(f"layer choices: {po.layer.choices}")
po.layer = po.layer.choices[0]
po.marker_size = 4
po.marker_color = 'blue'
See also
- Jdaviz Plot Options
Jdaviz documentation on the Plot Options plugin.
Subset Tools#
This plugin allows viewing and modifying defined subsets.
User API Example
See the SubsetTools user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
subset_tools = lcviz.plugins['Subset Tools']
subset_tools.open_in_tray()
See also
- Jdaviz Subset Tools
Jdaviz documentation on the Subset Tools plugin.
Markers#
This plugin allows for interactively creating markers in any viewer and logging information about the location of that marker along with the applicable data and viewer labels into a table.
With the plugin open in the tray, mouse over any viewer and press the “m” key to log the information displayed in the app toolbar into the table. The markers remain at that fixed pixel-position in the viewer they were created (regardless of changes to the underlying data or linking) and are only visible when the plugin is opened.
User API Example
See the Markers user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
markers = lcviz.plugins['Markers']
markers.open_in_tray()
# interactively mark by mousing over the viewer and pressing "M"
table = markers.export_table()
print(table)
markers.clear_table()
See also
- Jdaviz Markers
Jdaviz documentation on the Markers plugin.
Time Selector#
The time selector plugin allows defining the time indicated in all light curve viewers (time and phase viewers) as well as the time at which all image cubes are displayed.
User API Example
See the TimeSelector user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
ts = lcviz.plugins['Time Selector']
ts.open_in_tray()
See also
- Jdaviz Slice Plugin
Jdaviz documentation on the Slice plugin.
Photometric Extraction#
Note that this plugin is only available if TPF data is loaded into the app.
User API Example
See the PhotometricExtraction user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_targetpixelfile
tpf = search_targetpixelfile("KIC 001429092",
mission="Kepler",
cadence="long",
quarter=10).download()
lcviz = LCviz()
lcviz.load(tpf)
lcviz.show()
ext = lcviz.plugins['Photometric Extraction']
ext.open_in_tray()
See also
This plugin uses the following lightkurve implementations:
lightkurve.KeplerTargetPixelFile.extract_aperture_photometry()
Stitch#
This plugin allows for combining multiple light curves into a single entry. Note that this plugin is only available if there are at least two light curves loaded into a light curve viewer.
User API Example
See the Stitch user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc1 = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=9).download()
lc2 = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download()
lcviz = LCviz()
lcviz.load(lc1, data_label='lc1')
lcviz.load(lc2, data_label='lc2')
lcviz.show()
stitch = lcviz.plugins['Stitch']
stitch.open_in_tray()
stitch.dataset.select_all()
stitched_lc = stitch.stitch()
print(stitched_lc)
See also
This plugin uses the following lightkurve implementations:
lightkurve.LightCurveCollection.stitch()
Flatten#
This plugin allows for flattening the light curve by removing trends. By default, the resulting flattened light curve is “unnormalized” by multiplying the flattened light curve by the median of the trend, but this can be disabled through the plugin settings.
User API Example
See the Flatten user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
flatten = lcviz.plugins['Flatten']
flatten.open_in_tray()
flatten.polyorder = 4
flattened_lc = flatten.flatten(add_data=True)
print(flattened_lc)
See also
This plugin uses the following lightkurve implementations:
lightkurve.LightCurve.flatten()
Frequency Analysis#
This plugin exposes the periodogram (in period or frequency space) for an input light curve.
User API Example
See the FrequencyAnalysis user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
freq = lcviz.plugins['Frequency Analysis']
freq.open_in_tray()
freq.method = 'Lomb-Scargle'
freq.xunit = 'period'
periodogram = freq.periodogram
print(periodogram)
See also
This plugin uses the following lightkurve implementations:
lightkurve.periodogram.LombScarglePeriodogram.from_lightcurve()lightkurve.periodogram.BoxLeastSquaresPeriodogram.from_lightcurve()
Ephemeris#
The ephemeris plugin allows for setting, finding, and refining the ephemeris or ephemerides used for phase-folding.
User API Example
See the Ephemeris user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
ephem = lcviz.plugins['Ephemeris']
ephem.period = 4.88780258
ephem.t0 = 2.43
ephem.rename_component('default', 'my component name')
Binning#
This plugin supports binning a light curve in time or phase-space.
User API Example
See the Binning user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
binning = lcviz.plugins['Binning']
binning.n_bins = 150
binned_lc = binning.bin(add_data=True)
print(binned_lc)
See also
This plugin uses the following lightkurve implementations:
lightkurve.LightCurve.bin()
Export#
This plugin allows exporting the plot in a given viewer to various image formats.
User API Example
See the Export user API documentation for more details.
from lcviz import LCviz
from lightkurve import search_lightcurve
lc = search_lightcurve("HAT-P-11", mission="Kepler",
cadence="long", quarter=10).download().flatten()
lcviz = LCviz()
lcviz.load(lc)
lcviz.show()
export = lcviz.plugins['Export']
export.export('test.png')
See also
- Jdaviz Export Plot
Jdaviz documentation on the Export plugin.