A Python module that implements the Numerical Analysis of Fundamental Frequencies (NAFF) algorithm
Project description
PyNAFF
Authors:
- Foteini Asvesta (fasvesta .at. cern .dot. ch)
- Nikos Karastathis (nkarast .at. cern .dot. ch)
- Panagiotis Zisopoulos (pzisopou .at. cern .dot. ch)
A Python module that implements the Numerical Analysis of Fundamental Frequencies method of J. Laskar. The code works either as a script (as the original code of Laskar) or loaded as a module in Python/Julia code or jupyter-like notebooks (i.e. SWAN).
Installation:
The module is ported in PyPi so the user can simply run:
pip install --user PyNAFF
or from Git:
pip install --user git+https://github.com/nkarast/PyNAFF.git
Example of Usage
import PyNAFF as pnf
import numpy as np
t = np.linspace(1, 3000, num=3000, endpoint=True)
Q = 0.12345
signal = np.sin(2.0*np.pi*Q*t)
# Signature: pnf.naff(data, turns=300, nterms=1, skipTurns=0, getFullSpectrum=False, window=1)
# Docstring:
# The driving function for the NAFF algorithm.
# Inputs :
# * data : NumPy array with TbT data
# * turns : number of points to consider from the input data
# * nterms : maximum number of harmonics to search for in the data sample
# * skipTurns : number of observations (data points) to skip from the start of the input iterable
# * getFullSpectrum : [True | False]
# If True, a normal FFT is used (both negative and positive freq.)
# If False, an rFFT is used (only positive frequencies)
# * window : the order of window to be applied on the input data (default =1)
# Returns : Array with frequencies and amplitudes in the format:
# [order of harmonic, frequency, Amplitude, Re{Amplitude}, Im{Amplitude}]
pnf.naff(signal, turns=500, nterms=1, skipTurns=0, getFullSpectrum=False, window=1)
# outputs an array of arrays for each frequency. Each sub-array includes:
# [order of harmonic, frequency, Amplitude, Re{Amplitude}, Im{Amplitude]
# My frequency is simply
pnf.naff(signal, 500, 1, 0 , False)[0][1]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pynaff-1.1.7.tar.gz.
File metadata
- Download URL: pynaff-1.1.7.tar.gz
- Upload date:
- Size: 17.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4390e315d2f0aec9b62141197ab92db31f378c85385b0555099463b053ca471e
|
|
| MD5 |
9ee9d4367b7c145b9d7bcecc167bd93e
|
|
| BLAKE2b-256 |
75b02a3ccfeab38b03605e10336daa4aea7524a7747b7c806e68764a19968f6a
|
Provenance
The following attestation bundles were made for pynaff-1.1.7.tar.gz:
Publisher:
publish-to-prod-pypi.yml on nkarast/PyNAFF
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynaff-1.1.7.tar.gz -
Subject digest:
4390e315d2f0aec9b62141197ab92db31f378c85385b0555099463b053ca471e - Sigstore transparency entry: 188270664
- Sigstore integration time:
-
Permalink:
nkarast/PyNAFF@e1f4493719946f8cafff2a514eb4751e94da2c8e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/nkarast
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-prod-pypi.yml@e1f4493719946f8cafff2a514eb4751e94da2c8e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pynaff-1.1.7-py3-none-any.whl.
File metadata
- Download URL: pynaff-1.1.7-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f7dafe02d721e3efde1a584fda1d612106adf4f2ec13c8901c09e9b9dad48c7
|
|
| MD5 |
2fe1bcb1ca0ccb82c9b6577b7617674e
|
|
| BLAKE2b-256 |
d77ff3de55d56b41d0a74f85d60d3aa7eba96a14a8c9b5769f1d1ae9d6e0e200
|
Provenance
The following attestation bundles were made for pynaff-1.1.7-py3-none-any.whl:
Publisher:
publish-to-prod-pypi.yml on nkarast/PyNAFF
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pynaff-1.1.7-py3-none-any.whl -
Subject digest:
7f7dafe02d721e3efde1a584fda1d612106adf4f2ec13c8901c09e9b9dad48c7 - Sigstore transparency entry: 188270665
- Sigstore integration time:
-
Permalink:
nkarast/PyNAFF@e1f4493719946f8cafff2a514eb4751e94da2c8e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/nkarast
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-prod-pypi.yml@e1f4493719946f8cafff2a514eb4751e94da2c8e -
Trigger Event:
workflow_dispatch
-
Statement type: