MCPcopy
hub / github.com/mne-tools/mne-python / get_data

Method get_data

mne/io/base.py:894–1059  ·  view source on GitHub ↗

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,
    )

Source from the content-addressed store, hash-verified

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"

Callers 15

resampleMethod · 0.95
_as_meg_type_instFunction · 0.45
test_as_meg_type_evokedFunction · 0.45
test_decimateFunction · 0.45
find_bad_channels_lofFunction · 0.45
_fit_rawMethod · 0.45
_fit_epochsMethod · 0.45
_transform_rawMethod · 0.45
_transform_epochsMethod · 0.45
_sources_as_rawMethod · 0.45

Calls 11

_getitemMethod · 0.95
_validate_typeFunction · 0.85
_picks_to_idxFunction · 0.85
_get_ch_factorsFunction · 0.85
_check_optionFunction · 0.85
_handle_tmin_tmaxMethod · 0.80
maximumMethod · 0.80
minimumMethod · 0.80
infoMethod · 0.80
sumMethod · 0.45

Tested by 15

test_as_meg_type_evokedFunction · 0.36
test_decimateFunction · 0.36
test_order_agnosticFunction · 0.36
test_xdawn_picksFunction · 0.36
test_fine_cal_systemsFunction · 0.36
test_fix_stim_artifactFunction · 0.36
test_csd_degenerateFunction · 0.36
test_csd_fifFunction · 0.36