Compute the second-order structure function
Project description
StructureFunction
Efficient computation of structure functions for astronomical data with errors.
Structure functions
I follow the definitions laid out by Haverkorn et al. 2004. Whilst structure functions can be computed for any value on a sparse grid, here I focus on rotation meaures (RM) from astronomical sources. As such, data points are distributed on a spherical surface.
The second-order structure function of RM is given by:
That is, the ensemble average of the squared-difference in RM for sources with angular seperation $\delta\theta$. We also need to correct for the impact of errors by:
Computing the error on the structure function is diffifcult. Here I use Monte-Carlo error propagation to compute the errors numerically.
I provide the ability to fit a broken power-law to the data using both standard least-squares, and full-blown MCMC fitting powered by bilby.
Installation
To get the latest version from this repo
pip install git+https://github.com/AlecThomson/structurefunction
Or, install from PyPi
pip install structurefunction
Usage
See the notebook included in the examples. There I repoduce the results of Mao et al. 2010.
Project details
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
File details
Details for the file structurefunction-1.1.0.tar.gz
.
File metadata
- Download URL: structurefunction-1.1.0.tar.gz
- Upload date:
- Size: 196.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f16b510fc3bf0abc1cd976adf4289ef41f106779c5872514a663bea938b93a20 |
|
MD5 | bef3936a64d59cb75d777b6b9fdb2f2a |
|
BLAKE2b-256 | b3113704067691c43336e7f355e56a9cdef20b8cc6ab6f445d85677224a63e7f |
File details
Details for the file structurefunction-1.1.0-py2.py3-none-any.whl
.
File metadata
- Download URL: structurefunction-1.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 7.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/3.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37f0be6511b7e32182294cdf4a3f618c93d3727af4f5fb5da589704e47daf8a7 |
|
MD5 | 9c5cb10c4423ca668af4493473811004 |
|
BLAKE2b-256 | 1f691ee5291971f3d26298906652cba05b5c5ada7a26e74980f39b63d129d362 |