Skip to content

Commit

Permalink
tpf.interact(): docstring for return_selection_mask param
Browse files Browse the repository at this point in the history
  • Loading branch information
orionlee committed Feb 26, 2024
1 parent 4e6be34 commit 2fafc0f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/lightkurve/targetpixelfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1291,6 +1291,7 @@ def interact(
exported_filename=None,
transform_func=None,
ylim_func=None,
return_selection_mask=False,
**kwargs,
):
"""Display an interactive Jupyter Notebook widget to inspect the pixel data.
Expand Down Expand Up @@ -1348,6 +1349,16 @@ def interact(
A function that returns ylimits (low, high) given a LightCurve object.
The default is to return a window approximately around 5 sigma-clipped
lightcurve flux values.
return_selection_mask: bool
Optional, if set to `True`, return the pixel selection as an aperture mask.
Returns
-------
If ``return_selection_mask`` is set to ``True``, this method will return:
selection_mask : array-like
The mask representing the pixels the user has currently selected.
The user should copy the result after pixel selection is finalized, because the values
of the return array change dynamically as the user changes the pixel selection.
Examples
--------
Expand All @@ -1365,6 +1376,13 @@ def interact(
>>> transform_func = lambda lc: lc.normalize() # doctest: +SKIP
>>> tpf.interact(ylim_func=ylim_func, transform_func=transform_func) # doctest: +SKIP
the lightcurve after each pixel selection::
>>> interact_mask = tpf.interact(return_selection_mask=True) # doctest: +SKIP
>>> # Once the desired pixels have been selected, save the result in
>>> # a separate variable to "freeze" the selection.
>>> my_custom_mask = interact_mask.copy()
"""
from .interact import show_interact_widget

Expand All @@ -1378,6 +1396,7 @@ def interact(
exported_filename=exported_filename,
transform_func=transform_func,
ylim_func=ylim_func,
return_selection_mask=return_selection_mask,
**kwargs,
)

Expand Down

0 comments on commit 2fafc0f

Please sign in to comment.