Get data in the given range. Parameters ---------- %(picks_all)s start : int The first sample to include. Defaults to 0. stop : int | None End sample (first not to include). If None (default), the end of the data is used.
(
self,
picks=None,
start=0,
stop=None,
reject_by_annotation=None,
return_times=False,
units=None,
*,
tmin=None,
tmax=None,
verbose=None,
)
| 892 | |
| 893 | @verbose |
| 894 | def get_data( |
| 895 | self, |
| 896 | picks=None, |
| 897 | start=0, |
| 898 | stop=None, |
| 899 | reject_by_annotation=None, |
| 900 | return_times=False, |
| 901 | units=None, |
| 902 | *, |
| 903 | tmin=None, |
| 904 | tmax=None, |
| 905 | verbose=None, |
| 906 | ): |
| 907 | """Get data in the given range. |
| 908 | |
| 909 | Parameters |
| 910 | ---------- |
| 911 | %(picks_all)s |
| 912 | start : int |
| 913 | The first sample to include. Defaults to 0. |
| 914 | stop : int | None |
| 915 | End sample (first not to include). If None (default), the end of |
| 916 | the data is used. |
| 917 | reject_by_annotation : None | 'omit' | 'NaN' |
| 918 | Whether to reject by annotation. If None (default), no rejection is |
| 919 | done. If 'omit', segments annotated with description starting with |
| 920 | 'bad' are omitted. If 'NaN', the bad samples are filled with NaNs. |
| 921 | return_times : bool |
| 922 | Whether to return times as well. Defaults to False. |
| 923 | %(units)s |
| 924 | tmin : int | float | None |
| 925 | Start time of data to get in seconds. The ``tmin`` parameter is |
| 926 | ignored if the ``start`` parameter is bigger than 0. |
| 927 | |
| 928 | .. versionadded:: 0.24.0 |
| 929 | tmax : int | float | None |
| 930 | End time of data to get in seconds. The ``tmax`` parameter is |
| 931 | ignored if the ``stop`` parameter is defined. |
| 932 | |
| 933 | .. versionadded:: 0.24.0 |
| 934 | %(verbose)s |
| 935 | |
| 936 | Returns |
| 937 | ------- |
| 938 | data : ndarray, shape (n_channels, n_times) |
| 939 | Copy of the data in the given range. |
| 940 | times : ndarray, shape (n_times,) |
| 941 | Times associated with the data samples. Only returned if |
| 942 | return_times=True. |
| 943 | |
| 944 | Notes |
| 945 | ----- |
| 946 | .. versionadded:: 0.14.0 |
| 947 | """ |
| 948 | # validate types |
| 949 | _validate_type(start, types=("int-like"), item_name="start", type_name="int") |
| 950 | _validate_type( |
| 951 | stop, types=("int-like", None), item_name="stop", type_name="int, None" |