Skip to main content

Scikit-Qfit is a package that supports fitting gradient orthogonal Q-polynomials to 2D data.

Description

This package implements the algorithm described in:

Additional project documentation and references for Q- freeform polynomials can be found at: http://scikit-qfit.readthedocs.org/.

Installation

The package can be installed through pip:

> pip install scikit-qfit

Usage

To generate a Q-freeform spectrum from a data map, pass the coordinate arrays x and y and 2-D array of data with shape (x.size,y.size) as arguments to the method qspec(). The azimuthal and radial spectrum limits are set by m_max and n_max respectively.

>>> import skqfit.qspectre as qf
>>> ...
>>> qspec = qf.qspec(x, y, zmap, m_max=500, n_max=500)

To observe the contribution of spectrum components it is necessary to use the sine and cosine elements in the forward processing step. After modifying the spectrum, an inverse process creates a data map along with the x and y derivatives.

>>> qs = qf.QSpectrum()
>>> qs.data_map(x, y, zmap)
>>> a_nm, b_nm = qs.q_fit(mmax, nmax)
>>> ... # modify spectrum
>>> nmap, dfdx, dfdy = qs.build_map(x, y, a_nm, b_nm, inc_deriv=True)

A 1D trace across the fitted data can also be generated by passing a set of xv, yv arrays that represent the (x, y) coordinates.

>>> zv, dfdx, dfdy = qs.build_profile(xv, yv, a_nm, b_nm, inc_deriv=True)

Limitations

The Jacobian polynomial calculation required by the algorithm can generate very large numbers which limits spectral resolution to a maximum of 1500 for the radial and azimuthal terms (n, m). Using values greater than this can lead to an overflow. If the nominal spectral resolution for a datamap is greater than this limit the data should be filtered prior to processing to avoid aliasing.

Note that the process is an N^2 algorithm, so doubling the number of radial and azimuthal terms takes four times as long.

Dependencies

The package requires numpy and scipy and was tested on Linux with:

  • Python 2.7.6

  • numpy 1.14.5

  • scipy 1.0.0

These python, numpy and scipy versions were available on the Ubuntu 18.04 Linux release at the time of testing. The package has been informally tested with python 3.6 successfully and I am not aware of reason it should not work with later releases of these packages.

Acknowledge

  • Greg Forbes for support with the implementation and validation of the algorithm.

  • Andreas Beutler, Mahr GmbH, for choosing to make this work available as open source.

Note

This project has been set up using PyScaffold 3.2.1. For details and usage information on PyScaffold see https://pyscaffold.org/.

Release files for Scikit-Qfit 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Scikit-Qfit 0.1.5
File Size Uploaded
Scikit-Qfit-0.1.5.tar.gz 2.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for Scikit-Qfit 0.1.5
File Interpreter ABI Platform
Scikit_Qfit-0.1.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 2.5 MB

Release files / Scikit-Qfit-0.1.5.tar.gz

Download URL Scikit-Qfit-0.1.5.tar.gz
Size 2.4 MB
Tags Source
SHA-256 checksum
How to use checksums
17f719f8482ef336c7cd4e492b8ee61f8972b3c58be9c106db8595485dc6236e
BLAKE2b-256 checksum
How to use checksums
d2d5e45979c6c8e07b313273c198800848036b6b98fee1252cf78bca7765e531
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

Release files / Scikit_Qfit-0.1.5-py2.py3-none-any.whl

Download URL Scikit_Qfit-0.1.5-py2.py3-none-any.whl
Size 18.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
895f2b7b6bd482b78ec41fe6818884a7194a229d3ff183ed4a4ffd97be0e804f
BLAKE2b-256 checksum
How to use checksums
fb4b5298a71005854b7b5c2802c3cb10e690ecbf6fbc94b6f296d9fc84f4ffb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page