Skip to main content

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

structurefunction-1.1.1.tar.gz (196.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

structurefunction-1.1.1-py2.py3-none-any.whl (7.7 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: structurefunction-1.1.1.tar.gz
  • Upload date:
  • Size: 196.5 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.6

File hashes

Hashes for structurefunction-1.1.1.tar.gz
Algorithm Hash digest
SHA256 fa2df407bd18bc33371745969e408839bc9e212812bf634eb0fa1bb9e754bf67
MD5 c2c69fc35d2ecd52b7e33b2eb54fffa3
BLAKE2b-256 24ff0418bfe9d027320d061b3f5c6ae84a2f2cfa769df532fb52fbbed2a9a691

See more details on using hashes here.

File details

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

File metadata

  • Download URL: structurefunction-1.1.1-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.6

File hashes

Hashes for structurefunction-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4a7574bd88cf9f980d2019ec9e7fcf23aaf1fcef50483c7b82441eee012bf1b9
MD5 bdbb5a9af8b1fd851bc32451573bbab9
BLAKE2b-256 d30328adfe7b193d2cfacd746f9aee5bf0d2813567ef3e79682de727539eb066

See more details on using hashes here.

Supported by

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