rft1d
One-Dimensional Random Field Theory in Python.
rft1d is a Python package for exploring and validating Random Field Theory (RFT) expectations regarding upcrossings in univariate and multivariate 1D continua. These expectations can be used to make statistical inferences regarding signals observed in experimentally measured 1D continua including scalar and vector time series.
Please cite:
Pataky TC (2016) RFT1D: Smooth One-Dimensional Random Field Upcrossing Probabilities in Python. Journal of Statistical Software 71(7): 1-22. https://doi.org/10.18637/jss.v071.i07
Documentation is available at: www.spm1d.org/rft1d
Installation
pip install rft1d
rft1d requires Python 3.9 or later, along with numpy, scipy and matplotlib.
rft1d has been tested on Python 3.9 through 3.13.
Running examples:
The scripts in ./examples call import rft1d so they need the package importable. Either install rft1d, or add the ./src directory to your PYTHONPATH.
The scripts in ./examples/paper reproduce the figures and code examples from the Journal of Statistical Software paper. Run ./examples/paper/all_results.py to run generate everything in one pass.
Development
The package uses a src layout, and the test suite adds ./src to sys.path itself (see tests/conftest.py), so no installation step is needed to work on the source:
git clone https://github.com/0todd0000/rft1d.git
cd rft1d
pip install pytest numpy scipy matplotlib
Running tests:
pytest # the whole suite
pytest -m "not slow" # skip the 100,000-case validation (about 20 s)
pytest tests/test_p_RF.py # a single file
The tests are:
test_p_RF.pyandtest_uc_RF.pycheck rft1d's probabilities and critical thresholds against reference values computed with SPM12b, which are stored intests/data-spm12b. These establish that rft1d's probability calculations are correct.test_geom.pychecks cluster labeling, resel counts and cluster metrics against hand-calculated values.test_random_rng.pychecks that random fields are reproducible when a seed or generator is passed asrng.
Issues
Please report software bugs or other problems by searching existing issues or creating a new issue here.
Metadata
Release files for rft1d 0.2.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rft1d-0.2.8.tar.gz | 39.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rft1d-0.2.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 79.5 kB
Release files / rft1d-0.2.8.tar.gz
| Download URL | rft1d-0.2.8.tar.gz |
|---|---|
| Size | 39.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d10c56b40eb65fcb799d9e9b8a7ab11f33aa7b4d98571241e108e3aa8ffc53cd
|
|
BLAKE2b-256 checksum How to use checksums |
0242fe39cde205795ebb7b80ccb8db076d8e93861609a471cc043bb7ab6e4398
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / rft1d-0.2.8-py3-none-any.whl
| Download URL | rft1d-0.2.8-py3-none-any.whl |
|---|---|
| Size | 40.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b8aaaf66aa1069cf9836743434f11f5ddf0f106b93e344d15ddde8b78d7554f8
|
|
BLAKE2b-256 checksum How to use checksums |
8e83484a8f2daeaaf19f2d2850efe441809e915130d995472ae8c4419b0bfa91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|