Skip to main content

Documentation Status

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)

Source distribution for structurefunction 1.1.3
File Size Uploaded
structurefunction-1.1.3.tar.gz 867.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for structurefunction 1.1.3
File Interpreter ABI Platform
structurefunction-1.1.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

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

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page