U
    f»{j‘  ã                   @   sL   d Z ddlZddlmZ ddlmZmZmZm	Z	m
Z
 e	G dd„ deƒƒZdS )	z1Tools for creating Raw objects from numpy arrays.é    Né   )ÚBaseRawé   )ÚverboseÚloggerÚ_validate_typeÚfill_docÚ_check_optionc                       s&   e Zd ZdZed‡ fdd„	ƒZ‡  ZS )ÚRawArrayaÙ  Raw object from numpy array.

    Parameters
    ----------
    data : array, shape (n_channels, n_times)
        The channels' time series. See notes for proper units of measure.
    %(info_not_none)s Consider using :func:`mne.create_info` to populate
        this structure. This may be modified in place by the class.
    first_samp : int
        First sample offset used during recording (default 0).

        .. versionadded:: 0.12
    copy : {'data', 'info', 'both', 'auto', None}
        Determines what gets copied on instantiation. "auto" (default)
        will copy info, and copy "data" only if necessary to get to
        double floating point precision.

        .. versionadded:: 0.18
    %(verbose)s

    See Also
    --------
    mne.EpochsArray
    mne.EvokedArray
    mne.create_info

    Notes
    -----
    Proper units of measure:
    * V: eeg, eog, seeg, dbs, emg, ecg, bio, ecog
    * T: mag
    * T/m: grad
    * M: hbo, hbr
    * Am: dipole
    * AU: misc
    r   ÚautoNc              	      sv  t |ddƒ td|dƒ t t |¡¡r.tjntj}|}tj||d�}|jdkr`t	d|j
f ƒ‚t|ƒt|d ƒkr�t	dt|ƒt|d ƒf ƒ‚t|d ƒ|d	 ks¨t‚|d
kr¸| ¡ }|dkrÒ||krð| ¡ }n|dkrð||k	rðt	d|f ƒ‚t d|j|j
d |j
d f ¡ tt| ƒj||t|ƒf||d� t d| j| jt| jƒ|d  t| jƒ|d  f ¡ t d¡ d S )NÚinfoÚcopy)Údatar   Úbothr   N)Údtyper   zFData must be a 2D array of shape (n_channels, n_samples), got shape %sZch_namesz8len(data) (%s) does not match len(info["ch_names"]) (%s)Znchan)r   r   r   )r   r   r   zgdata copying was not requested by copy=%r but it was required to get to double floating point precisionz9Creating RawArray with %s data, n_channels=%s, n_times=%sr   é   )Zfirst_sampsr   r   z-    Range : %d ... %d =  %9.3f ... %9.3f secsZsfreqzReady.)r   r	   ÚnpÚanyZ	iscomplexZ
complex128Zfloat64Z
asanyarrayÚndimÚ
ValueErrorÚshapeÚlenÚAssertionErrorr   r   r   Ú__name__Úsuperr
   Ú__init__ÚintÚ
first_sampZ	last_sampÚfloat)Úselfr   r   r   r   r   r   Z	orig_data©Ú	__class__© úQ/var/www/html/bwave/python/venv/lib/python3.8/site-packages/mne/io/array/array.pyr   4   sL    
ÿþ
þÿ þ ýzRawArray.__init__)r   r   N)r   Ú
__module__Ú__qualname__Ú__doc__r   r   Ú__classcell__r"   r"   r    r#   r
      s
   %  ÿr
   )r&   Únumpyr   Úbaser   Úutilsr   r   r   r   r	   r
   r"   r"   r"   r#   Ú<module>   s
   