summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-17 02:56:26 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-17 02:56:26 +0000
commit50ac11febf960f1ccaeb55132dee8b9494877c80 (patch)
tree5dff5cbb5ca72d04864b27eca47bdd460379db2c
parentcb17c343725f48f67c6adc5045d69694da078b8e (diff)
automatic import of python-stockwell
-rw-r--r--.gitignore1
-rw-r--r--python-stockwell.spec552
-rw-r--r--sources1
3 files changed, 554 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..3d7ebf5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/stockwell-1.0.7.tar.gz
diff --git a/python-stockwell.spec b/python-stockwell.spec
new file mode 100644
index 0000000..e0f13e6
--- /dev/null
+++ b/python-stockwell.spec
@@ -0,0 +1,552 @@
+%global _empty_manifest_terminate_build 0
+Name: python-stockwell
+Version: 1.0.7
+Release: 1
+Summary: Time-frequency analysis through Stockwell transform
+License: CeCILL Free Software License Agreement, Version 2.1
+URL: https://github.com/claudiodsf/stockwell
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f0/42/23ffa0b654a374aff902ac3ca11bfc083f59ca3c8fbf04c236868068a70d/stockwell-1.0.7.tar.gz
+
+Requires: python3-numpy
+
+%description
+# Stockwell
+
+Python package for time-frequency analysis through Stockwell transform.
+
+Based on original code from [NIMH MEG Core Facility].
+
+[![cf-badge]][cf-link]
+[![PyPI-badge]][PyPI-link]
+[![license-badge]][license-link]
+
+
+## Installation
+
+### Using Anaconda
+
+If you use [Anaconda], the latest release of Stockwell is available via
+[conda-forge][cf-link].
+
+To install, simply run:
+
+ conda install -c conda-forge stockwell
+
+
+### Using pip and PyPI
+
+The latest release of Stockwell is available on the
+[Python Package Index][PyPI-link].
+
+You can install it easily through `pip`:
+
+ pip install stockwell
+
+
+### Installation from source
+
+If no precompiled package is available for you architecture on PyPI, or if you
+want to work on the source code, you will need to compile this package from
+source.
+
+To obtain the source code, download the latest release from the
+[releases page][releases-link], or clone the GitHub project.
+
+#### C compiler
+
+Part of Stockwell is written in C, so you will need a C compiler.
+
+On Linux (Debian or Ubuntu), install the `build-essential` package:
+
+ sudo apt install build-essential
+
+On macOS, install the XCode Command Line Tools:
+
+ xcode-select --install
+
+On Windows, install the [Microsoft C++ Build Tools].
+
+#### FFTW
+
+To compile Stockwell, you will need to have [FFTW]
+installed.
+
+If you use [Anaconda]&nbsp;(Linux, macOS, Windows):
+
+ conda install fftw
+
+If you use Homebrew (macOS)
+
+ brew install fftw
+
+If you use `apt` (Debian or Ubuntu)
+
+ sudo apt install libfftw3-dev
+
+#### Install the Python package from source
+
+Finally, install this Python package using pip:
+
+ pip install .
+
+Or, alternatively, in "editable" mode:
+
+ pip install -e .
+
+
+## Usage
+
+Example usage:
+
+```python
+import numpy as np
+from scipy.signal import chirp
+import matplotlib.pyplot as plt
+from stockwell import st
+
+t = np.linspace(0, 10, 5001)
+w = chirp(t, f0=12.5, f1=2.5, t1=10, method='linear')
+
+fmin = 0 # Hz
+fmax = 25 # Hz
+df = 1./(t[-1]-t[0]) # sampling step in frequency domain (Hz)
+fmin_samples = int(fmin/df)
+fmax_samples = int(fmax/df)
+stock = st.st(w, fmin_samples, fmax_samples)
+extent = (t[0], t[-1], fmin, fmax)
+
+fig, ax = plt.subplots(2, 1, sharex=True)
+ax[0].plot(t, w)
+ax[0].set(ylabel='amplitude')
+ax[1].imshow(np.abs(stock), origin='lower', extent=extent)
+ax[1].axis('tight')
+ax[1].set(xlabel='time (s)', ylabel='frequency (Hz)')
+plt.show()
+```
+You should get the following output:
+
+![stockwell.png](https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/stockwell.png)
+
+You can also compute the inverse Stockwell transform, ex:
+
+```python
+inv_stock = st.ist(stock, fmin_samples, fmax_samples)
+fig, ax = plt.subplots(2, 1, sharex=True)
+ax[0].plot(t, w, label='original signal')
+ax[0].plot(t, inv_stock, label='inverse Stockwell')
+ax[0].set(ylabel='amplitude')
+ax[0].legend(loc='upper right')
+ax[1].plot(t, w - inv_stock)
+ax[1].set_xlim(0, 10)
+ax[1].set(xlabel='time (s)', ylabel='amplitude difference')
+plt.show()
+```
+![inv_stockwell.png](https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/inv_stockwell.png)
+
+
+## References
+
+Stockwell, R.G., Mansinha, L. & Lowe, R.P., 1996. Localization of the complex
+spectrum: the S transform, IEEE Trans. Signal Process., 44(4), 998–1001,
+doi:[10.1109/78.492555](https://doi.org/10.1109/78.492555)
+
+[S transform on Wikipedia].
+
+
+
+[NIMH MEG Core Facility]: https://kurage.nimh.nih.gov/meglab/Meg/Stockwell
+
+[cf-badge]: http://img.shields.io/conda/vn/conda-forge/stockwell.svg
+[cf-link]: https://anaconda.org/conda-forge/stockwell
+[PyPI-badge]: http://img.shields.io/pypi/v/stockwell.svg
+[PyPI-link]: https://pypi.python.org/pypi/stockwell
+[license-badge]: https://img.shields.io/badge/license-CeCILL--2.1-green
+[license-link]: http://www.cecill.info/licences.en.html
+[releases-link]: https://github.com/claudiodsf/stockwell/releases
+
+[Anaconda]: https://www.anaconda.com/products/individual
+[Microsoft C++ Build Tools]:
+https://visualstudio.microsoft.com/visual-cpp-build-tools
+[FFTW]: http://www.fftw.org
+[S transform on Wikipedia]: https://en.wikipedia.org/wiki/S_transform
+
+
+%package -n python3-stockwell
+Summary: Time-frequency analysis through Stockwell transform
+Provides: python-stockwell
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+BuildRequires: python3-cffi
+BuildRequires: gcc
+BuildRequires: gdb
+%description -n python3-stockwell
+# Stockwell
+
+Python package for time-frequency analysis through Stockwell transform.
+
+Based on original code from [NIMH MEG Core Facility].
+
+[![cf-badge]][cf-link]
+[![PyPI-badge]][PyPI-link]
+[![license-badge]][license-link]
+
+
+## Installation
+
+### Using Anaconda
+
+If you use [Anaconda], the latest release of Stockwell is available via
+[conda-forge][cf-link].
+
+To install, simply run:
+
+ conda install -c conda-forge stockwell
+
+
+### Using pip and PyPI
+
+The latest release of Stockwell is available on the
+[Python Package Index][PyPI-link].
+
+You can install it easily through `pip`:
+
+ pip install stockwell
+
+
+### Installation from source
+
+If no precompiled package is available for you architecture on PyPI, or if you
+want to work on the source code, you will need to compile this package from
+source.
+
+To obtain the source code, download the latest release from the
+[releases page][releases-link], or clone the GitHub project.
+
+#### C compiler
+
+Part of Stockwell is written in C, so you will need a C compiler.
+
+On Linux (Debian or Ubuntu), install the `build-essential` package:
+
+ sudo apt install build-essential
+
+On macOS, install the XCode Command Line Tools:
+
+ xcode-select --install
+
+On Windows, install the [Microsoft C++ Build Tools].
+
+#### FFTW
+
+To compile Stockwell, you will need to have [FFTW]
+installed.
+
+If you use [Anaconda]&nbsp;(Linux, macOS, Windows):
+
+ conda install fftw
+
+If you use Homebrew (macOS)
+
+ brew install fftw
+
+If you use `apt` (Debian or Ubuntu)
+
+ sudo apt install libfftw3-dev
+
+#### Install the Python package from source
+
+Finally, install this Python package using pip:
+
+ pip install .
+
+Or, alternatively, in "editable" mode:
+
+ pip install -e .
+
+
+## Usage
+
+Example usage:
+
+```python
+import numpy as np
+from scipy.signal import chirp
+import matplotlib.pyplot as plt
+from stockwell import st
+
+t = np.linspace(0, 10, 5001)
+w = chirp(t, f0=12.5, f1=2.5, t1=10, method='linear')
+
+fmin = 0 # Hz
+fmax = 25 # Hz
+df = 1./(t[-1]-t[0]) # sampling step in frequency domain (Hz)
+fmin_samples = int(fmin/df)
+fmax_samples = int(fmax/df)
+stock = st.st(w, fmin_samples, fmax_samples)
+extent = (t[0], t[-1], fmin, fmax)
+
+fig, ax = plt.subplots(2, 1, sharex=True)
+ax[0].plot(t, w)
+ax[0].set(ylabel='amplitude')
+ax[1].imshow(np.abs(stock), origin='lower', extent=extent)
+ax[1].axis('tight')
+ax[1].set(xlabel='time (s)', ylabel='frequency (Hz)')
+plt.show()
+```
+You should get the following output:
+
+![stockwell.png](https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/stockwell.png)
+
+You can also compute the inverse Stockwell transform, ex:
+
+```python
+inv_stock = st.ist(stock, fmin_samples, fmax_samples)
+fig, ax = plt.subplots(2, 1, sharex=True)
+ax[0].plot(t, w, label='original signal')
+ax[0].plot(t, inv_stock, label='inverse Stockwell')
+ax[0].set(ylabel='amplitude')
+ax[0].legend(loc='upper right')
+ax[1].plot(t, w - inv_stock)
+ax[1].set_xlim(0, 10)
+ax[1].set(xlabel='time (s)', ylabel='amplitude difference')
+plt.show()
+```
+![inv_stockwell.png](https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/inv_stockwell.png)
+
+
+## References
+
+Stockwell, R.G., Mansinha, L. & Lowe, R.P., 1996. Localization of the complex
+spectrum: the S transform, IEEE Trans. Signal Process., 44(4), 998–1001,
+doi:[10.1109/78.492555](https://doi.org/10.1109/78.492555)
+
+[S transform on Wikipedia].
+
+
+
+[NIMH MEG Core Facility]: https://kurage.nimh.nih.gov/meglab/Meg/Stockwell
+
+[cf-badge]: http://img.shields.io/conda/vn/conda-forge/stockwell.svg
+[cf-link]: https://anaconda.org/conda-forge/stockwell
+[PyPI-badge]: http://img.shields.io/pypi/v/stockwell.svg
+[PyPI-link]: https://pypi.python.org/pypi/stockwell
+[license-badge]: https://img.shields.io/badge/license-CeCILL--2.1-green
+[license-link]: http://www.cecill.info/licences.en.html
+[releases-link]: https://github.com/claudiodsf/stockwell/releases
+
+[Anaconda]: https://www.anaconda.com/products/individual
+[Microsoft C++ Build Tools]:
+https://visualstudio.microsoft.com/visual-cpp-build-tools
+[FFTW]: http://www.fftw.org
+[S transform on Wikipedia]: https://en.wikipedia.org/wiki/S_transform
+
+
+%package help
+Summary: Development documents and examples for stockwell
+Provides: python3-stockwell-doc
+%description help
+# Stockwell
+
+Python package for time-frequency analysis through Stockwell transform.
+
+Based on original code from [NIMH MEG Core Facility].
+
+[![cf-badge]][cf-link]
+[![PyPI-badge]][PyPI-link]
+[![license-badge]][license-link]
+
+
+## Installation
+
+### Using Anaconda
+
+If you use [Anaconda], the latest release of Stockwell is available via
+[conda-forge][cf-link].
+
+To install, simply run:
+
+ conda install -c conda-forge stockwell
+
+
+### Using pip and PyPI
+
+The latest release of Stockwell is available on the
+[Python Package Index][PyPI-link].
+
+You can install it easily through `pip`:
+
+ pip install stockwell
+
+
+### Installation from source
+
+If no precompiled package is available for you architecture on PyPI, or if you
+want to work on the source code, you will need to compile this package from
+source.
+
+To obtain the source code, download the latest release from the
+[releases page][releases-link], or clone the GitHub project.
+
+#### C compiler
+
+Part of Stockwell is written in C, so you will need a C compiler.
+
+On Linux (Debian or Ubuntu), install the `build-essential` package:
+
+ sudo apt install build-essential
+
+On macOS, install the XCode Command Line Tools:
+
+ xcode-select --install
+
+On Windows, install the [Microsoft C++ Build Tools].
+
+#### FFTW
+
+To compile Stockwell, you will need to have [FFTW]
+installed.
+
+If you use [Anaconda]&nbsp;(Linux, macOS, Windows):
+
+ conda install fftw
+
+If you use Homebrew (macOS)
+
+ brew install fftw
+
+If you use `apt` (Debian or Ubuntu)
+
+ sudo apt install libfftw3-dev
+
+#### Install the Python package from source
+
+Finally, install this Python package using pip:
+
+ pip install .
+
+Or, alternatively, in "editable" mode:
+
+ pip install -e .
+
+
+## Usage
+
+Example usage:
+
+```python
+import numpy as np
+from scipy.signal import chirp
+import matplotlib.pyplot as plt
+from stockwell import st
+
+t = np.linspace(0, 10, 5001)
+w = chirp(t, f0=12.5, f1=2.5, t1=10, method='linear')
+
+fmin = 0 # Hz
+fmax = 25 # Hz
+df = 1./(t[-1]-t[0]) # sampling step in frequency domain (Hz)
+fmin_samples = int(fmin/df)
+fmax_samples = int(fmax/df)
+stock = st.st(w, fmin_samples, fmax_samples)
+extent = (t[0], t[-1], fmin, fmax)
+
+fig, ax = plt.subplots(2, 1, sharex=True)
+ax[0].plot(t, w)
+ax[0].set(ylabel='amplitude')
+ax[1].imshow(np.abs(stock), origin='lower', extent=extent)
+ax[1].axis('tight')
+ax[1].set(xlabel='time (s)', ylabel='frequency (Hz)')
+plt.show()
+```
+You should get the following output:
+
+![stockwell.png](https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/stockwell.png)
+
+You can also compute the inverse Stockwell transform, ex:
+
+```python
+inv_stock = st.ist(stock, fmin_samples, fmax_samples)
+fig, ax = plt.subplots(2, 1, sharex=True)
+ax[0].plot(t, w, label='original signal')
+ax[0].plot(t, inv_stock, label='inverse Stockwell')
+ax[0].set(ylabel='amplitude')
+ax[0].legend(loc='upper right')
+ax[1].plot(t, w - inv_stock)
+ax[1].set_xlim(0, 10)
+ax[1].set(xlabel='time (s)', ylabel='amplitude difference')
+plt.show()
+```
+![inv_stockwell.png](https://cdn.jsdelivr.net/gh/claudiodsf/stockwell/inv_stockwell.png)
+
+
+## References
+
+Stockwell, R.G., Mansinha, L. & Lowe, R.P., 1996. Localization of the complex
+spectrum: the S transform, IEEE Trans. Signal Process., 44(4), 998–1001,
+doi:[10.1109/78.492555](https://doi.org/10.1109/78.492555)
+
+[S transform on Wikipedia].
+
+
+
+[NIMH MEG Core Facility]: https://kurage.nimh.nih.gov/meglab/Meg/Stockwell
+
+[cf-badge]: http://img.shields.io/conda/vn/conda-forge/stockwell.svg
+[cf-link]: https://anaconda.org/conda-forge/stockwell
+[PyPI-badge]: http://img.shields.io/pypi/v/stockwell.svg
+[PyPI-link]: https://pypi.python.org/pypi/stockwell
+[license-badge]: https://img.shields.io/badge/license-CeCILL--2.1-green
+[license-link]: http://www.cecill.info/licences.en.html
+[releases-link]: https://github.com/claudiodsf/stockwell/releases
+
+[Anaconda]: https://www.anaconda.com/products/individual
+[Microsoft C++ Build Tools]:
+https://visualstudio.microsoft.com/visual-cpp-build-tools
+[FFTW]: http://www.fftw.org
+[S transform on Wikipedia]: https://en.wikipedia.org/wiki/S_transform
+
+
+%prep
+%autosetup -n stockwell-1.0.7
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-stockwell -f filelist.lst
+%dir %{python3_sitearch}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 17 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.7-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..037203f
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+4624ecfa5ac8a147ef28071507b3692b stockwell-1.0.7.tar.gz