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:
SF_{\text{RM},\text{obs}}(\delta\theta) = \langle[\text{RM}{(\theta)} - \text{RM}{(\theta + \delta\theta)}]^2\rangle
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:
SF_{\text{RM}}(\delta\theta) = SF_{\text{RM},\text{obs}}(\delta\theta) - SF_{\sigma_\text{RM}}(\delta\theta)
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.
Documentation
The documentation is available here.
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.
Metadata
Release files for structurefunction 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| structurefunction-1.1.3.tar.gz | 867.6 kB | Without provenance | Details for structurefunction-1.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| structurefunction-1.1.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for structurefunction-1.1.3-py2.py3-none-any.whl |
Total release size: 877.5 kB
Release files / structurefunction-1.1.3.tar.gz
| Download URL | structurefunction-1.1.3.tar.gz |
|---|---|
| Size | 867.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60e47e93e518c5dab742fda387871bea16789ce78295eff2c83d38662c16a86b
|
|
BLAKE2b-256 checksum How to use checksums |
a6e36b7ae1a988df2b50dbad011c5d17cd6974dae799b81f5d8bc06fbe2a3775
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.11.4 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.13
|
Release files / structurefunction-1.1.3-py2.py3-none-any.whl
| Download URL | structurefunction-1.1.3-py2.py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ae6433fd6e90e7f6f557aeea419d46607836ef7d32f0dbd3869d2c6b0a1487ae
|
|
BLAKE2b-256 checksum How to use checksums |
da669e788cfbc0b620830d75e66d541979f3171240488657064df87b2b724b92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.11.4 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.13
|
Security for structurefunction 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.