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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file structurefunction-1.1.3.tar.gz.

File metadata

  • Download URL: structurefunction-1.1.3.tar.gz
  • Upload date:
  • Size: 867.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for structurefunction-1.1.3.tar.gz
Algorithm Hash digest
SHA256 60e47e93e518c5dab742fda387871bea16789ce78295eff2c83d38662c16a86b
MD5 80e1175476e5716f8edf5c299bde87ff
BLAKE2b-256 a6e36b7ae1a988df2b50dbad011c5d17cd6974dae799b81f5d8bc06fbe2a3775

See more details on using hashes here.

File details

Details for the file structurefunction-1.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: structurefunction-1.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for structurefunction-1.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ae6433fd6e90e7f6f557aeea419d46607836ef7d32f0dbd3869d2c6b0a1487ae
MD5 5021b0e2a06e0525b0c42f627f93ed19
BLAKE2b-256 da669e788cfbc0b620830d75e66d541979f3171240488657064df87b2b724b92

See more details on using hashes here.

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