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 one:

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',
    search=af.DynestyStatic()
    )

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

Getting Started

Please contact us via email or on our SLACK channel if you are interested in using PyAutoGalaxy, as project is still a work in progress whilst we focus n PyAutoFit and PyAutoLens.

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.

Project details


Release history Release notifications | RSS feed

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.14.3.tar.gz (166.5 kB view details)

Uploaded Source

Built Distribution

autogalaxy-0.14.3-py3-none-any.whl (244.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autogalaxy-0.14.3.tar.gz
  • Upload date:
  • Size: 166.5 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.14.3.tar.gz
Algorithm Hash digest
SHA256 1b5fe816193a61fdf4bdb7e896139d9b2b3aabef490a3d87dae7f126be0b1d6d
MD5 1ff51b189d22b2667b5af29876056f02
BLAKE2b-256 7fb72d47f3cd1715057e93d7e984894e399990d92a0ec109f12733d8e082db12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: autogalaxy-0.14.3-py3-none-any.whl
  • Upload date:
  • Size: 244.8 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.14.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e06d8493a616478c7e66ba20b2af8f0bc320a31ed89c24f140f2cd3736a1a4cd
MD5 cb6b453ce84458b0cf6e72040560eb9e
BLAKE2b-256 ee0b2c6a7e261e45010dcd16a5cd6761a1a5749a89eb07ee8d5e1a93f94a54f5

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