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.2.tar.gz
.
File metadata
- Download URL: structurefunction-1.1.2.tar.gz
- Upload date:
- Size: 196.6 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.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf2b8503c29d39d249de6a71eb97aa85bda60650e6d76510d3ee87c9f95cc3d6 |
|
MD5 | cdd7832b0029f655f5a1fc2fdb0c1888 |
|
BLAKE2b-256 | dd3c74a033b988174e6e76429b880a4e4f138a77f8639eb4e48740a0fb32a1bf |
File details
Details for the file structurefunction-1.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: structurefunction-1.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 7.7 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.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3ab8598cc790833f97e97e84561e946b1049d9ea25f2eeb76a3483b1b0a5076 |
|
MD5 | 07a878dde1e2b20dedfc67397fb52320 |
|
BLAKE2b-256 | 46391b9cee4c8a489fe126adfe468cfd1fec25e1e3829c17b2743e900b7242db |