Skip to main content

Astro modelling

Project description

PyAutoGalaxy

The study of a galaxy's light, structure and dynamics is at the heart of modern day Astrophysical research. PyAutoGalaxy makes it simple to model galaxies, like this oidkne:

Missing for now :(

Example

With PyAutoGalaxy, you can begin modeling a galaxy in just a couple of minutes. The example below demonstrates a simple analysis which fits a galaxy's light.

.. code-block:: python

import autofit as af
import autogalaxy as ag

import os

# In this example, we'll fit an image of a single galaxy .
dataset_path = '{}/../data/'.format(os.path.dirname(os.path.realpath(__file__)))

galaxy_name = 'example_galaxy'

# Use the relative path to the dataset to load the imaging data.
imaging = ag.Imaging.from_fits(
    image_path=dataset_path + galaxy_name + '/image.fits',
    psf_path=dataset_path+galaxy_name+'/psf.fits',
    noise_map_path=dataset_path+galaxy_name+'/noise_map.fits',
    pixel_scales=0.1)

# Create a mask for the data, which we setup as a 3.0" circle.
mask = ag.Mask.circular(shape_2d=imaging.shape_2d, pixel_scales=imaging.pixel_scales, radius=3.0)

# We model our galaxy using a light profile (an elliptical Sersic).
light_profile = ag.lp.EllipticalSersic

# To setup our model galaxy, we use the GalaxyModel class, which represents a galaxy whose parameters
# are free & fitted for by PyAutoGalaxy. The galaxy is also assigned a redshift.
galaxy_model = ag.GalaxyModel(redshift=1.0, light=light_profile)

# To perform the analysis we set up a phase, which takes our galaxy model & fits its parameters using a non-linear
# search (in this case, MultiNest).
phase = ag.PhaseImaging(
    galaxies=dict(galaxy=galaxy_model),
    phase_name='example/phase_example',
    non_linear_class=af.MultiNest
    )

# We pass the imaging data and mask to the phase, thereby fitting it with the galaxy model & plot the resulting fit.
result = phase.run(data=imaging, mask=mask)
ag.plot.FitImaging.subplot_fit_imaging(fit=result.max_log_likelihood_fit)

Features

PyAutoGalaxy's advanced modeling features include:

  • Profiles - Use light & mass profiles to make galaxies & perform studies of galaxy light, structure and dynamics.
  • Pipelines - Write automated analysis pipelines to fit complex models to large samples of galaxies.
  • Pixelizations - Reconstruct complex galaxy morphologies on a variety of pixel-grids.
  • Adaption - Adapt the galaxy analysis to the features of the observed galaxy imaging.
  • Interferometry - Model radio / sub-mm interferometer data directly in the uv-plane.
  • Visualization - Custom visualization libraries for plotting physical galaxying quantities & modeling results.
  • PyAutoFit - Perform fits using many non-linear searches (MCMC, Nested Sampling) and manipulate large result outputs via the probablistic programming language PyAutoFit <https://github.com/rhayes777/PyAutoFit>_

HowToGalaxy

Included with PyAutoGalaxy is the HowToGalaxy lecture series, which provides an introduction to galaxy modeling with PyAutoGalaxy. It can be found in the workspace & consists of 5 chapters:

  • Introduction - An introduction to galaxy fitting & PyAutoGalaxy.
  • Galaxy Modeling - How to perform model fits of galaxies, including a primer on Bayesian non-linear analysis.
  • Pipelines - How to build model-fitting pipelines & tailor them to your own science case.
  • Inversions - How to perform pixelized reconstructions of a galaxy.
  • Hyper-Mode - How to use PyAutoGalaxy advanced modeling features that adapt the model to the galaxy being analysed.

Workspace

PyAutoGalaxy comes with a workspace, which can be found here <https://github.com/Jammy2211/autogalaxy_workspace>_ & which includes:

  • Aggregator - Manipulate large suites of modeling results via Jupyter notebooks, using PyAutoFit's in-built results database.
  • API - Illustrative scripts of the PyAutoGalaxy interface, for examples on how to make plots, perform galaxy calculations, etc.
  • Config - Configuration files which customize PyAutoGalaxy's behaviour.
  • Dataset - Where data is stored, including example datasets distributed with PyAutoGalaxy.
  • HowToGalaxy - The HowToGalaxy lecture series.
  • Output - Where the PyAutoGalaxy analysis and visualization are output.
  • Pipelines - Example pipelines for modeling galaxies.
  • Preprocess - Tools to preprocess data before an analysis (e.g. convert units, create masks).
  • Quick Start - A quick start guide, so you can begin modeling galaxies within hours.
  • Runners - Scripts for running PyAutoGalaxy pipelines.
  • Simulators - Scripts for simulating galaxy datasets with PyAutoGalaxy.

Slack

We're building a PyAutoGalaxy community on Slack, so you should contact us on our Slack channel <https://pyautogalaxy.slack.com/>_ before getting started. Here, I will give you the latest updates on the software & discuss how best to use PyAutoGalaxy for your science case.

Unfortunately, Slack is invitation-only, so first send me an email <https://github.com/Jammy2211>_ requesting an invite.

Documentation & Installation

The PyAutoGalaxy documentation can be found at our readthedocs <https://pyautogalaxy.readthedocs.io/en/master>, including instructions on installation <https://pyautogalaxy.readthedocs.io/en/master/installation.html>.

Contributing

If you have any suggestions or would like to contribute please get in touch.

Papers

A list of published articles using PyAutoGalaxy can be found here <https://pyautogalaxy.readthedocs.io/en/master/papers.html>_ .

Credits

Developers:

James Nightingale <https://github.com/Jammy2211>_ - Lead developer & PyAutoGalaxy guru.

Richard Hayes <https://github.com/rhayes777>_ - Lead developer & PyAutoFit <https://github.com/rhayes777/PyAutoFit>_ guru.

Ashley Kelly <https://github.com/AshKelly>_ - Developer of pyquad <https://github.com/AshKelly/pyquad>_ for fast numerical integration.

Amy Etherington <https://github.com/amyetherington>_ - Mass profile calcluation methods.

Xiaoyue Cao <https://github.com/caoxiaoyue>_ - Analytic Ellipitcal Power-Law Calculations.

Qiuhan He - NFW Profile Calculations.

Nan Li <https://github.com/linan7788626>_ - Docker integration & support.

Code Donors:

Mattia Negrello - Visibility models in the uv-plane via direct Fourier transforms.

Andrea Enia <https://github.com/AndreaEnia>_ - Voronoi source-plane plotting tools.

Aristeidis Amvrosiadis <https://github.com/Sketos>_ - ALMA imaging data loading.

Project details


Release history Release notifications | RSS feed

This version

0.9.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autogalaxy-0.9.0.tar.gz (155.1 kB view details)

Uploaded Source

Built Distribution

autogalaxy-0.9.0-py3-none-any.whl (213.5 kB view details)

Uploaded Python 3

File details

Details for the file autogalaxy-0.9.0.tar.gz.

File metadata

  • Download URL: autogalaxy-0.9.0.tar.gz
  • Upload date:
  • Size: 155.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.9

File hashes

Hashes for autogalaxy-0.9.0.tar.gz
Algorithm Hash digest
SHA256 854dc3bc906113c2c614ba651d5c413c8051d1fabd6350d2f28476f7deee67bc
MD5 c734dc99a9f21d7f15c2b79bcfac1e62
BLAKE2b-256 f302deb2351bf9def3e1ba2d87e04c8c5d8fa66d71038db767a855b87b4d45ed

See more details on using hashes here.

File details

Details for the file autogalaxy-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: autogalaxy-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 213.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.9

File hashes

Hashes for autogalaxy-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b3c9f15d5e660cf6b6b331ee29b1f66983a02dc50f06b4ac12df766ec085978
MD5 2a0fc351ce3ece76b205208c989ecbd1
BLAKE2b-256 957f44d6b18d3b4ca02dc451bf0d15ade746043259f189e0ff0356e0780cc64f

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