§
    fŠtj´  ã                   ó6  — d dl Z d dlmZmZmZ ddlmZmZ d dlm	Z	 	 d dl
Z
 e
j         e
j        d¦  «        dee¬¦  «        Zn# e$ r dZ
dZY nw xY wefd	„Z e	d
¬¦  «        d„ ¦   «         Z e	d
¬¦  «        d„ ¦   «         Z e	d
¬¦  «        dd„¦   «         ZdS )é    N)ÚarrayÚ
frombufferÚloadé   )ÚregistryÚregistry_urls)Úxp_capabilitiesz
scipy-datazhttps://github.com/scipy/)ÚpathÚbase_urlr   Úurlsc                 ó°   — |€t          d¦  «        ‚t          j        ddt          j        d         j        › �i¬¦  «        }|                     | |¬¦  «        S )NzsMissing optional dependency 'pooch' required for scipy.datasets module. Please use pip or conda to install 'pooch'.z
User-AgentzSciPy Úscipy)Úheaders)Ú
downloader)ÚImportErrorÚpoochÚHTTPDownloaderÚsysÚmodulesÚ__version__Úfetch)Údataset_nameÚdata_fetcherr   s      úV/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/scipy/datasets/_fetchers.pyÚ
fetch_datar      sn   € ØÐÝð 6ñ 7ô 7ð 	7õ Ô%ØÐJ­¬°GÔ(<Ô(HÐJÐJÐKðñ ô €Jð ×Ò˜l°zÐÑBÔBÐBó    T)Úout_of_scopec                  óÀ   — ddl } t          d¦  «        }t          |d¦  «        5 }t          |                      |¦  «        ¦  «        }ddd¦  «         n# 1 swxY w Y   |S )aX  
    Get an 8-bit grayscale bit-depth, 512 x 512 derived image for easy
    use in demos.

    The image is derived from
    https://pixnio.com/people/accent-to-the-top

    Parameters
    ----------
    None

    Returns
    -------
    ascent : ndarray
       convenient image to use for testing and demonstration

    Examples
    --------
    >>> import scipy.datasets
    >>> ascent = scipy.datasets.ascent()
    >>> ascent.shape
    (512, 512)
    >>> ascent.max()
    np.uint8(255)

    >>> import matplotlib.pyplot as plt
    >>> plt.gray()
    >>> plt.imshow(ascent)
    >>> plt.show()

    r   Nz
ascent.datÚrb)Úpickler   Úopenr   r   )r    ÚfnameÚfÚascents       r   r$   r$   *   s›   € ðB €M€M€Mõ
 �|Ñ$Ô$€Eå	ˆe�TÑ	Ô	ð '˜aÝ�v—{’{ 1‘~”~Ñ&Ô&ˆð'ð 'ð 'ñ 'ô 'ð 'ð 'ð 'ð 'ð 'ð 'øøøð 'ð 'ð 'ð 'à€Ms   ¤#AÁAÁAc                  óÂ   — t          d¦  «        } t          | ¦  «        5 }|d                              t          ¦  «        }ddd¦  «         n# 1 swxY w Y   |dz
  dz  }|S )aŒ  
    Load an electrocardiogram as an example for a 1-D signal.

    The returned signal is a 5 minute long electrocardiogram (ECG), a medical
    recording of the heart's electrical activity, sampled at 360 Hz.

    Returns
    -------
    ecg : ndarray
        The electrocardiogram in millivolt (mV) sampled at 360 Hz.

    Notes
    -----
    The provided signal is an excerpt (19:35 to 24:35) from the `record 208`_
    (lead MLII) provided by the MIT-BIH Arrhythmia Database [1]_ on
    PhysioNet [2]_. The excerpt includes noise induced artifacts, typical
    heartbeats as well as pathological changes.

    .. _record 208: https://physionet.org/physiobank/database/html/mitdbdir/records.htm#208

    .. versionadded:: 1.1.0

    References
    ----------
    .. [1] Moody GB, Mark RG. The impact of the MIT-BIH Arrhythmia Database.
           IEEE Eng in Med and Biol 20(3):45-50 (May-June 2001).
           (PMID: 11446209); :doi:`10.13026/C2F305`
    .. [2] Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh,
           Mark RG, Mietus JE, Moody GB, Peng C-K, Stanley HE. PhysioBank,
           PhysioToolkit, and PhysioNet: Components of a New Research Resource
           for Complex Physiologic Signals. Circulation 101(23):e215-e220;
           :doi:`10.1161/01.CIR.101.23.e215`

    Examples
    --------
    >>> from scipy.datasets import electrocardiogram
    >>> ecg = electrocardiogram()
    >>> ecg
    array([-0.245, -0.215, -0.185, ..., -0.405, -0.395, -0.385], shape=(108000,))
    >>> ecg.shape, ecg.mean(), ecg.std()
    ((108000,), -0.16510875, 0.5992473991177294)

    As stated the signal features several areas with a different morphology.
    E.g., the first few seconds show the electrical activity of a heart in
    normal sinus rhythm as seen below.

    >>> import numpy as np
    >>> import matplotlib.pyplot as plt
    >>> fs = 360
    >>> time = np.arange(ecg.size) / fs
    >>> plt.plot(time, ecg)
    >>> plt.xlabel("time in s")
    >>> plt.ylabel("ECG in mV")
    >>> plt.xlim(9, 10.2)
    >>> plt.ylim(-1, 1.5)
    >>> plt.show()

    After second 16, however, the first premature ventricular contractions,
    also called extrasystoles, appear. These have a different morphology
    compared to typical heartbeats. The difference can easily be observed
    in the following plot.

    >>> plt.plot(time, ecg)
    >>> plt.xlabel("time in s")
    >>> plt.ylabel("ECG in mV")
    >>> plt.xlim(46.5, 50)
    >>> plt.ylim(-2, 1.5)
    >>> plt.show()

    At several points large artifacts disturb the recording, e.g.:

    >>> plt.plot(time, ecg)
    >>> plt.xlabel("time in s")
    >>> plt.ylabel("ECG in mV")
    >>> plt.xlim(207, 215)
    >>> plt.ylim(-2, 3.5)
    >>> plt.show()

    Finally, examining the power spectrum reveals that most of the biosignal is
    made up of lower frequencies. At 60 Hz the noise induced by the mains
    electricity can be clearly observed.

    >>> from scipy.signal import welch
    >>> f, Pxx = welch(ecg, fs=fs, nperseg=2048, scaling="spectrum")
    >>> plt.semilogy(f, Pxx)
    >>> plt.xlabel("Frequency in Hz")
    >>> plt.ylabel("Power spectrum of the ECG in mV**2")
    >>> plt.xlim(f[[0, -1]])
    >>> plt.show()
    zecg.datÚecgNé   g      i@)r   r   ÚastypeÚint)r"   Úfiler&   s      r   Úelectrocardiogramr+   W   sœ   € õx �yÑ!Ô!€EÝ	ˆe‰Œð &˜Ø�5Œk× Ò ¥Ñ%Ô%ˆð&ð &ð &ñ &ô &ð &ð &ð &ð &ð &ð &øøøð &ð &ð &ð &ð �‰:˜Ñ
€CØ€Js   Ÿ!AÁAÁAFc                 ó´  — ddl }t          d¦  «        }t          |d¦  «        5 }|                     ¦   «         }ddd¦  «         n# 1 swxY w Y   |                     |¦  «        }t          |d¬¦  «                             d¦  «        }| du rKd	|dd…dd…df         z  d
|dd…dd…df         z  z   d|dd…dd…df         z  z                        d¦  «        }|S )a‚  
    Get a 1024 x 768, color image of a raccoon face.

    The image is derived from
    https://pixnio.com/fauna-animals/raccoons/raccoon-procyon-lotor

    Parameters
    ----------
    gray : bool, optional
        If True return 8-bit grey-scale image, otherwise return a color image

    Returns
    -------
    face : ndarray
        image of a raccoon face

    Examples
    --------
    >>> import scipy.datasets
    >>> face = scipy.datasets.face()
    >>> face.shape
    (768, 1024, 3)
    >>> face.max()
    np.uint8(255)

    >>> import matplotlib.pyplot as plt
    >>> plt.gray()
    >>> plt.imshow(face)
    >>> plt.show()

    r   Nzface.datr   Úuint8)Údtype)i   r'   é   Tgáz®GáÊ?g¸…ëQ¸æ?r   gìQ¸…ë±?é   )Úbz2r   r!   ÚreadÚ
decompressr   Úreshaper(   )Úgrayr1   r"   r#   ÚrawdataÚ	face_dataÚfaces          r   r8   r8   »   s.  € ðB €J€J€JÝ�zÑ"Ô"€EÝ	ˆe�TÑ	Ô	ð ˜aØ—&’&‘(”(ˆðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð à—’˜wÑ'Ô'€IÝ�i wÐ/Ñ/Ô/×7Ò7¸ÑGÔG€DØˆt€|€|Ø�t˜A˜A˜A˜q˜q˜q !˜G”}Ñ$ t¨d°1°1°1°a°a°a¸°7¬mÑ';Ñ;Ø�t˜A˜A˜A˜q˜q˜q !˜G”}Ñ$ñ%ß&,¢f¨W¡o¤oð 	à€Ks   ¤AÁA	ÁA	)F)r   Únumpyr   r   r   Ú	_registryr   r   Úscipy._lib._array_apir	   r   ÚcreateÚos_cacher   r   r   r$   r+   r8   © r   r   ú<module>r?      ss  ðØ 
€
€
€
à )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ð )Ø .Ð .Ð .Ð .Ð .Ð .Ð .Ð .à 1Ð 1Ð 1Ð 1Ð 1Ð 1ðØ€L€L€Lð
  �5”<ð ˆUŒ^˜LÑ)Ô)ð
 -ØØðñ ô €L€Løð	 ð ð ð Ø€EØ€L€L€Lðøøøð& +7ð 
Cð 
Cð 
Cð 
Cð €˜dÐ#Ñ#Ô#ð)ð )ñ $Ô#ð)ðX €˜dÐ#Ñ#Ô#ð`ð `ñ $Ô#ð`ðF €˜dÐ#Ñ#Ô#ð)ð )ð )ñ $Ô#ð)ð )ð )s   žA Á	AÁA