Sovereign 8s.is mirror of standardgalactic/flex-base
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Michael Petersen 7b81bf3f65
Some checks failed
Tests / test (macos-latest, 3.10) (push) Has been cancelled
Tests / test (macos-latest, 3.11) (push) Has been cancelled
Tests / test (macos-latest, 3.12) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.10) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.11) (push) Has been cancelled
Tests / test (ubuntu-latest, 3.12) (push) Has been cancelled
Tests / test (windows-latest, 3.10) (push) Has been cancelled
Tests / test (windows-latest, 3.11) (push) Has been cancelled
Tests / test (windows-latest, 3.12) (push) Has been cancelled
Merge pull request #2 from michael-petersen/main
Add automatic tests for checking
2025-11-25 17:32:08 +00:00
.github/workflows Update .github/workflows/test.yaml 2025-11-25 17:29:13 +00:00
src/flex simplify base flex structure 2025-11-10 15:53:14 +00:00
tests Update tests/test_flex.py 2025-11-25 17:29:26 +00:00
.gitignore finish example application 2025-11-07 10:39:57 +00:00
LICENSE first commit 2025-08-02 14:19:50 +01:00
pyproject.toml add compiled cython draft option 2025-09-01 14:31:14 +01:00
README.md add coverage badge 2025-11-25 17:21:49 +00:00
setup.py Update setup.py 2025-11-10 16:00:02 +00:00
test_requirements.txt find compatible numba version 2025-11-07 10:57:10 +00:00

flex

Fourier-Laguerre expansions for images of galaxies.

License: MIT

Coverage Status

Installation

Installation of flex currently proceeds from local builds after cloning this repository:

git clone https://github.com/ObservationalExpansions/flex.git
pip install .

Quickstart Example

Drawing from a uniform disc.

import numpy as np
import flex

N = 10_000_000

# Generate uniformly in polar coordinates
r = np.sqrt(np.random.uniform(0, 4, N)) 
theta = np.random.uniform(0, 2*np.pi, N)
mass = np.random.uniform(0, 1, N)

# set expansion parameters
rscl,mmax,nmax = 1.0,2,10

F = flex.FLEX(rscl,mmax,nmax,r,theta)

# to compute the total power in each harmonic,
totalm = np.linalg.norm(np.sqrt(F.coscoefs**2 + F.sincoefs**2), axis=1)

# and them compute a ratio
eta = totalm[2]/totalm[0]
print('ratio of m=2 to m=0:',eta)

Documentation

More complete documentation will be available at at this URL.

Contributing

The flex maintainers welcome contributions to software, examples, and documentation. The maintainers are actively monitoring pull requests and would be happy to collaborate on contributions or ideas. If you have any requests for additional information or find any bugs, please open an issue directly.

License

flex is available under the MIT license. See the LICENSE file for specifics.