<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 .. _tut_raw_objects
The 
Step1:  Continuous data is stored in objects of type 
Step2:  Information about the channels contained in the 
Step3:  You can also pass an index directly to the 
Step4:  Selecting subsets of channels and samples
It is possible to use more intelligent indexing to extract data, using
channel names, types or time ranges.
Step5:  Notice the different scalings of these types
Step6:  You can restrict the data to a specific time range
Step7:  And drop channels by name
Step8:  Concatenating 
<ASSISTANT_TASK:>
Python Code:
from __future__ import print_function
import mne
import os.path as op
from matplotlib import pyplot as plt
Explanation: .. _tut_raw_objects
The :class:Raw &lt;mne.io.RawFIF&gt; data structure: continuous data
End of explanation
# Load an example dataset, the preload flag loads the data into memory now
data_path = op.join(mne.datasets.sample.data_path(), 'MEG',
                    'sample', 'sample_audvis_raw.fif')
raw = mne.io.RawFIF(data_path, preload=True, verbose=False)
# Give the sample rate
print('sample rate:', raw.info['sfreq'], 'Hz')
# Give the size of the data matrix
print('channels x samples:', raw._data.shape)
Explanation: Continuous data is stored in objects of type :class:Raw &lt;mne.io.RawFIF&gt;.
The core data structure is simply a 2D numpy array (channels × samples,
._data) combined with an :class:Info &lt;mne.io.meas_info.Info&gt; object
(.info) (:ref:tut_info_objects.
The most common way to load continuous data is from a .fif file. For more
information on :ref:loading data from other formats &lt;ch_raw&gt;, or creating
it :ref:from scratch &lt;tut_creating_data_structures&gt;.
Loading continuous data
End of explanation
print('Shape of data array:', raw._data.shape)
array_data = raw._data[0, :1000]
_ = plt.plot(array_data)
Explanation: Information about the channels contained in the :class:Raw &lt;mne.io.RawFIF&gt;
object is contained in the :class:Info &lt;mne.io.meas_info.Info&gt; attribute.
This is essentially a dictionary with a number of relevant fields (see
:ref:tut_info_objects).
Indexing data
There are two ways to access the data stored within :class:Raw
&lt;mne.io.RawFIF&gt; objects. One is by accessing the underlying data array, and
the other is to index the :class:Raw &lt;mne.io.RawFIF&gt; object directly.
To access the data array of :class:Raw &lt;mne.io.Raw&gt; objects, use the
_data attribute. Note that this is only present if preload==True.
End of explanation
# Extract data from the first 5 channels, from 1 s to 3 s.
sfreq = raw.info['sfreq']
data, times = raw[:5, int(sfreq * 1):int(sfreq * 3)]
_ = plt.plot(times, data.T)
_ = plt.title('Sample channels')
Explanation: You can also pass an index directly to the :class:Raw &lt;mne.io.RawFIF&gt;
object. This will return an array of times, as well as the data representing
those timepoints. This may be used even if the data is not preloaded:
End of explanation
# Pull all MEG gradiometer channels:
# Make sure to use copy==True or it will overwrite the data
meg_only = raw.pick_types(meg=True, copy=True)
eeg_only = raw.pick_types(meg=False, eeg=True, copy=True)
# The MEG flag in particular lets you specify a string for more specificity
grad_only = raw.pick_types(meg='grad', copy=True)
# Or you can use custom channel names
pick_chans = ['MEG 0112', 'MEG 0111', 'MEG 0122', 'MEG 0123']
specific_chans = raw.pick_channels(pick_chans, copy=True)
print(meg_only, eeg_only, grad_only, specific_chans, sep='\n')
Explanation: Selecting subsets of channels and samples
It is possible to use more intelligent indexing to extract data, using
channel names, types or time ranges.
End of explanation
f, (a1, a2) = plt.subplots(2, 1)
eeg, times = eeg_only[0, :int(sfreq * 2)]
meg, times = meg_only[0, :int(sfreq * 2)]
a1.plot(times, meg[0])
a2.plot(times, eeg[0])
Explanation: Notice the different scalings of these types
End of explanation
restricted = raw.crop(5, 7)  # in seconds
print('New time range from', restricted.times.min(), 's to',
      restricted.times.max(), 's')
Explanation: You can restrict the data to a specific time range
End of explanation
restricted = restricted.drop_channels(['MEG 0241', 'EEG 001'])
print('Number of channels reduced from', raw.info['nchan'], 'to',
      restricted.info['nchan'])
Explanation: And drop channels by name
End of explanation
# Create multiple :class:`Raw <mne.io.RawFIF>` objects
raw1 = raw.copy().crop(0, 10)
raw2 = raw.copy().crop(10, 20)
raw3 = raw.copy().crop(20, 100)
# Concatenate in time (also works without preloading)
raw1.append([raw2, raw3])
print('Time extends from', raw1.times.min(), 's to', raw1.times.max(), 's')
Explanation: Concatenating :class:Raw &lt;mne.io.RawFIF&gt; objects
:class:Raw &lt;mne.io.RawFIF&gt; objects can be concatenated in time by using the
:func:append &lt;mne.io.RawFIF.append&gt; function. For this to work, they must
have the same number of channels and their :class:Info
&lt;mne.io.meas_info.Info&gt; structures should be compatible.
End of explanation
<END_TASK>