Skip to main content

Compute the second-order structure function

Project description

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.

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

structurefunction-1.1.3.tar.gz (867.6 kB view hashes)

Uploaded Source

Built Distribution

structurefunction-1.1.3-py2.py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page