autogalaxy


Nameautogalaxy JSON
Version 2025.10.21.1 PyPI version JSON
download
home_pageNone
SummaryOpen-Source Multi Wavelength Galaxy Structure & Morphology
upload_time2025-10-21 22:28:46
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyAutoGalaxy: Open-Source Multi Wavelength Galaxy Structure & Morphology
========================================================================

.. image:: https://mybinder.org/badge_logo.svg
   :target: https://mybinder.org/v2/gh/Jammy2211/autogalaxy_workspace/HEAD

.. image:: https://readthedocs.org/projects/pyautogalaxy/badge/?version=latest
   :target: https://pyautogalaxy.readthedocs.io/en/latest/?badge=latest
   :alt: Documentation Status

.. image:: https://github.com/Jammy2211/PyAutoGalaxy/actions/workflows/main.yml/badge.svg
   :target: https://github.com/Jammy2211/PyAutoGalaxy/actions

.. image:: https://github.com/Jammy2211/PyAutoBuild/actions/workflows/release.yml/badge.svg
   :target: https://github.com/Jammy2211/PyAutoBuild/actions

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black

.. image:: https://joss.theoj.org/papers/10.21105/joss.04475/status.svg
   :target: https://doi.org/10.21105/joss.04475

.. image:: https://www.repostatus.org/badges/latest/active.svg
    :target: https://www.repostatus.org/#active
    :alt: Project Status: Active

.. image:: https://img.shields.io/pypi/pyversions/autogalaxy
    :target: https://pypi.org/project/autogalaxy/
    :alt: Python Versions

.. image:: https://img.shields.io/pypi/v/autogalaxy.svg
    :target: https://pypi.org/project/autogalaxy/
    :alt: PyPI Version

`Installation Guide <https://pyautogalaxy.readthedocs.io/en/latest/installation/overview.html>`_ |
`readthedocs <https://pyautogalaxy.readthedocs.io/en/latest/index.html>`_ |
`Introduction on Binder <https://mybinder.org/v2/gh/Jammy2211/autogalaxy_workspace/release?filepath=start_here.ipynb>`_ |
`HowToGalaxy <https://pyautogalaxy.readthedocs.io/en/latest/howtogalaxy/howtogalaxy.html>`_

**PyAutoGalaxy** is software for analysing the morphologies and structures of galaxies:

.. image:: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/hstcombined.png?raw=true
        :target: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/hstcombined.png

**PyAutoGalaxy** also fits interferometer data from observatories such as ALMA:

.. image:: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/almacombined.png?raw=true
        :target: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/almacombined.png

Getting Started
---------------

The following links are useful for new starters:

- `The PyAutoGalaxy readthedocs <https://pyautogalaxy.readthedocs.io/en/latest>`_, which includes `an overview of PyAutoGalaxy's core features <https://pyautogalaxy.readthedocs.io/en/latest/overview/overview_1_start_here.html>`_, `a new user starting guide <https://pyautogalaxy.readthedocs.io/en/latest/overview/overview_2_new_user_guide.html>`_ and `an installation guide <https://pyautogalaxy.readthedocs.io/en/latest/installation/overview.html>`_.

- `The introduction Jupyter Notebook on Binder <https://mybinder.org/v2/gh/Jammy2211/autogalaxy_workspace/release?filepath=start_here.ipynb>`_, where you can try **PyAutoGalaxy** in a web browser (without installation).

- `The autogalaxy_workspace GitHub repository <https://github.com/Jammy2211/autogalaxy_workspace>`_, which includes example scripts and the `HowToGalaxy Jupyter notebook lectures <https://github.com/Jammy2211/autogalaxy_workspace/tree/main/notebooks/howtogalaxy>`_ which give new users a step-by-step introduction to **PyAutoGalaxy**.

Core Aims
---------

**PyAutoGalaxy** has three core aims:

- **Model Complexity**: Fitting complex galaxy morphology models (e.g. Multi Gaussian Expansion, Shapelets, Ellipse Fitting, Irregular Meshes) that go beyond just simple Sersic fitting (which is supported too!).

- **Data Variety**: Support for many data types (e.g. CCD imaging, interferometry, multi-band imaging) which can be fitted independently or simultaneously.

- **Big Data**: Scaling automated analysis to extremely large datasets, using tools like an SQL database to build a scalable scientific workflow.

A complete overview of the software's aims is provided in our `Journal of Open Source Software paper <https://joss.theoj.org/papers/10.21105/joss.04475>`_.

API Overview
------------

Galaxy morphology calculations are performed in **PyAutoGalaaxy** by building a ``Plane`` object from ``LightProfile``
and ``Galaxy`` objects. We create a simple galaxy system where a redshift 0.5
``Galaxy`` with an ``Sersic`` ``LightProfile`` representing a bulge and an ``Exponential`` ``LightProfile``
representing a disk.

.. code-block:: python

    import autogalaxy as ag
    import autogalaxy.plot as aplt

    """
    To describe the galaxy emission two-dimensional grids of (y,x) Cartesian
    coordinates are used.
    """
    grid = ag.Grid2D.uniform(
        shape_native=(50, 50),
        pixel_scales=0.05,  # <- Conversion from pixel units to arc-seconds.
    )

    """
    The galaxy has an elliptical sersic light profile representing its bulge.
    """
    bulge=ag.lp.Sersic(
        centre=(0.0, 0.0),
        ell_comps=ag.convert.ell_comps_from(axis_ratio=0.9, angle=45.0),
        intensity=1.0,
        effective_radius=0.6,
        sersic_index=3.0,
    )

    """
    The galaxy also has an elliptical exponential disk
    """
    disk = ag.lp.Exponential(
        centre=(0.0, 0.0),
        ell_comps=ag.convert.ell_comps_from(axis_ratio=0.7, angle=30.0),
        intensity=0.5,
        effective_radius=1.6,
    )

    """
    We combine the above light profiles to compose a galaxy at redshift 1.0.
    """
    galaxy = ag.Galaxy(redshift=1.0, bulge=bulge, disk=disk)

    """
    We create a Plane, which in this example has just one galaxy but can
    be extended for datasets with many galaxies.
    """
    plane = ag.Plane(
        galaxies=[galaxy],
    )

    """
    We can use the Grid2D and Plane to perform many calculations, for example
    plotting the image of the galaxyed source.
    """
    plane_plotter = aplt.GalaxiesPlotter(plane=plane, grid=grid)
    plane_plotter.figures_2d(image=True)


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

    """
    Load Imaging data of the strong galaxy from the dataset folder of the workspace.
    """
    dataset = ag.Imaging.from_fits(
        data_path="/path/to/dataset/image.fits",
        noise_map_path="/path/to/dataset/noise_map.fits",
        psf_path="/path/to/dataset/psf.fits",
        pixel_scales=0.1,
    )

    """
    Create a mask for the data, which we setup as a 3.0" circle.
    """
    mask = ag.Mask2D.circular(
        shape_native=dataset.shape_native,
        pixel_scales=dataset.pixel_scales,
        radius=3.0
    )

    """
    We model the galaxy using an Sersic LightProfile.
    """
    light_profile = ag.lp.Sersic

    """
    We next setup this profile as model components whose parameters are free & fitted for
    by setting up a Galaxy as a Model.
    """
    galaxy_model = af.Model(ag.Galaxy, redshift=1.0, light=light_profile)
    model = af.Collection(galaxy=galaxy_model)

    """
    We define the non-linear search used to fit the model to the data (in this case, Dynesty).
    """
    search = af.Nautilus(name="search[example]", n_live=50)
    
    """
    We next set up the `Analysis`, which contains the `log likelihood function` that the
    non-linear search calls to fit the galaxy model to the data.
    """
    analysis = ag.AnalysisImaging(dataset=masked_dataset)

    """
    To perform the model-fit we pass the model and analysis to the search's fit method. This will
    output results (e.g., dynesty samples, model parameters, visualization) to hard-disk.
    """
    result = search.fit(model=model, analysis=analysis)

    """
    The results contain information on the fit, for example the maximum likelihood
    model from the Dynesty parameter space search.
    """
    print(result.samples.max_log_likelihood())


Support
-------

Support for installation issues, help with galaxy modeling and using **PyAutoGalaxy** is available by
`raising an issue on the GitHub issues page <https://github.com/Jammy2211/PyAutoGalaxy/issues>`_.

We also offer support on the **PyAutoGalaxy** `Slack channel <https://pyautogalaxy.slack.com/>`_, where we also provide the
latest updates on **PyAutoGalaxy**. Slack is invitation-only, so if you'd like to join send
an `email <https://github.com/Jammy2211>`_ requesting an invite.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "autogalaxy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "cli",
    "author": null,
    "author_email": "James Nightingale <James.Nightingale@newcastle.ac.uk>, Richard Hayes <richard@rghsoftware.co.uk>",
    "download_url": "https://files.pythonhosted.org/packages/d4/36/e4d56bbc662bef0c11b5181b13e82125b359936d34ad5c917f622ca03401/autogalaxy-2025.10.21.1.tar.gz",
    "platform": null,
    "description": "PyAutoGalaxy: Open-Source Multi Wavelength Galaxy Structure & Morphology\n========================================================================\n\n.. image:: https://mybinder.org/badge_logo.svg\n   :target: https://mybinder.org/v2/gh/Jammy2211/autogalaxy_workspace/HEAD\n\n.. image:: https://readthedocs.org/projects/pyautogalaxy/badge/?version=latest\n   :target: https://pyautogalaxy.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n\n.. image:: https://github.com/Jammy2211/PyAutoGalaxy/actions/workflows/main.yml/badge.svg\n   :target: https://github.com/Jammy2211/PyAutoGalaxy/actions\n\n.. image:: https://github.com/Jammy2211/PyAutoBuild/actions/workflows/release.yml/badge.svg\n   :target: https://github.com/Jammy2211/PyAutoBuild/actions\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n\n.. image:: https://joss.theoj.org/papers/10.21105/joss.04475/status.svg\n   :target: https://doi.org/10.21105/joss.04475\n\n.. image:: https://www.repostatus.org/badges/latest/active.svg\n    :target: https://www.repostatus.org/#active\n    :alt: Project Status: Active\n\n.. image:: https://img.shields.io/pypi/pyversions/autogalaxy\n    :target: https://pypi.org/project/autogalaxy/\n    :alt: Python Versions\n\n.. image:: https://img.shields.io/pypi/v/autogalaxy.svg\n    :target: https://pypi.org/project/autogalaxy/\n    :alt: PyPI Version\n\n`Installation Guide <https://pyautogalaxy.readthedocs.io/en/latest/installation/overview.html>`_ |\n`readthedocs <https://pyautogalaxy.readthedocs.io/en/latest/index.html>`_ |\n`Introduction on Binder <https://mybinder.org/v2/gh/Jammy2211/autogalaxy_workspace/release?filepath=start_here.ipynb>`_ |\n`HowToGalaxy <https://pyautogalaxy.readthedocs.io/en/latest/howtogalaxy/howtogalaxy.html>`_\n\n**PyAutoGalaxy** is software for analysing the morphologies and structures of galaxies:\n\n.. image:: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/hstcombined.png?raw=true\n        :target: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/hstcombined.png\n\n**PyAutoGalaxy** also fits interferometer data from observatories such as ALMA:\n\n.. image:: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/almacombined.png?raw=true\n        :target: https://github.com/Jammy2211/PyAutoGalaxy/blob/main/paper/almacombined.png\n\nGetting Started\n---------------\n\nThe following links are useful for new starters:\n\n- `The PyAutoGalaxy readthedocs <https://pyautogalaxy.readthedocs.io/en/latest>`_, which includes `an overview of PyAutoGalaxy's core features <https://pyautogalaxy.readthedocs.io/en/latest/overview/overview_1_start_here.html>`_, `a new user starting guide <https://pyautogalaxy.readthedocs.io/en/latest/overview/overview_2_new_user_guide.html>`_ and `an installation guide <https://pyautogalaxy.readthedocs.io/en/latest/installation/overview.html>`_.\n\n- `The introduction Jupyter Notebook on Binder <https://mybinder.org/v2/gh/Jammy2211/autogalaxy_workspace/release?filepath=start_here.ipynb>`_, where you can try **PyAutoGalaxy** in a web browser (without installation).\n\n- `The autogalaxy_workspace GitHub repository <https://github.com/Jammy2211/autogalaxy_workspace>`_, which includes example scripts and the `HowToGalaxy Jupyter notebook lectures <https://github.com/Jammy2211/autogalaxy_workspace/tree/main/notebooks/howtogalaxy>`_ which give new users a step-by-step introduction to **PyAutoGalaxy**.\n\nCore Aims\n---------\n\n**PyAutoGalaxy** has three core aims:\n\n- **Model Complexity**: Fitting complex galaxy morphology models (e.g. Multi Gaussian Expansion, Shapelets, Ellipse Fitting, Irregular Meshes) that go beyond just simple Sersic fitting (which is supported too!).\n\n- **Data Variety**: Support for many data types (e.g. CCD imaging, interferometry, multi-band imaging) which can be fitted independently or simultaneously.\n\n- **Big Data**: Scaling automated analysis to extremely large datasets, using tools like an SQL database to build a scalable scientific workflow.\n\nA complete overview of the software's aims is provided in our `Journal of Open Source Software paper <https://joss.theoj.org/papers/10.21105/joss.04475>`_.\n\nAPI Overview\n------------\n\nGalaxy morphology calculations are performed in **PyAutoGalaaxy** by building a ``Plane`` object from ``LightProfile``\nand ``Galaxy`` objects. We create a simple galaxy system where a redshift 0.5\n``Galaxy`` with an ``Sersic`` ``LightProfile`` representing a bulge and an ``Exponential`` ``LightProfile``\nrepresenting a disk.\n\n.. code-block:: python\n\n    import autogalaxy as ag\n    import autogalaxy.plot as aplt\n\n    \"\"\"\n    To describe the galaxy emission two-dimensional grids of (y,x) Cartesian\n    coordinates are used.\n    \"\"\"\n    grid = ag.Grid2D.uniform(\n        shape_native=(50, 50),\n        pixel_scales=0.05,  # <- Conversion from pixel units to arc-seconds.\n    )\n\n    \"\"\"\n    The galaxy has an elliptical sersic light profile representing its bulge.\n    \"\"\"\n    bulge=ag.lp.Sersic(\n        centre=(0.0, 0.0),\n        ell_comps=ag.convert.ell_comps_from(axis_ratio=0.9, angle=45.0),\n        intensity=1.0,\n        effective_radius=0.6,\n        sersic_index=3.0,\n    )\n\n    \"\"\"\n    The galaxy also has an elliptical exponential disk\n    \"\"\"\n    disk = ag.lp.Exponential(\n        centre=(0.0, 0.0),\n        ell_comps=ag.convert.ell_comps_from(axis_ratio=0.7, angle=30.0),\n        intensity=0.5,\n        effective_radius=1.6,\n    )\n\n    \"\"\"\n    We combine the above light profiles to compose a galaxy at redshift 1.0.\n    \"\"\"\n    galaxy = ag.Galaxy(redshift=1.0, bulge=bulge, disk=disk)\n\n    \"\"\"\n    We create a Plane, which in this example has just one galaxy but can\n    be extended for datasets with many galaxies.\n    \"\"\"\n    plane = ag.Plane(\n        galaxies=[galaxy],\n    )\n\n    \"\"\"\n    We can use the Grid2D and Plane to perform many calculations, for example\n    plotting the image of the galaxyed source.\n    \"\"\"\n    plane_plotter = aplt.GalaxiesPlotter(plane=plane, grid=grid)\n    plane_plotter.figures_2d(image=True)\n\n\nWith **PyAutoGalaxy**, you can begin modeling a galaxy in just a couple of minutes. The example below demonstrates a\nsimple analysis which fits a galaxy's light.\n\n.. code-block:: python\n\n    import autofit as af\n    import autogalaxy as ag\n\n    import os\n\n    \"\"\"\n    Load Imaging data of the strong galaxy from the dataset folder of the workspace.\n    \"\"\"\n    dataset = ag.Imaging.from_fits(\n        data_path=\"/path/to/dataset/image.fits\",\n        noise_map_path=\"/path/to/dataset/noise_map.fits\",\n        psf_path=\"/path/to/dataset/psf.fits\",\n        pixel_scales=0.1,\n    )\n\n    \"\"\"\n    Create a mask for the data, which we setup as a 3.0\" circle.\n    \"\"\"\n    mask = ag.Mask2D.circular(\n        shape_native=dataset.shape_native,\n        pixel_scales=dataset.pixel_scales,\n        radius=3.0\n    )\n\n    \"\"\"\n    We model the galaxy using an Sersic LightProfile.\n    \"\"\"\n    light_profile = ag.lp.Sersic\n\n    \"\"\"\n    We next setup this profile as model components whose parameters are free & fitted for\n    by setting up a Galaxy as a Model.\n    \"\"\"\n    galaxy_model = af.Model(ag.Galaxy, redshift=1.0, light=light_profile)\n    model = af.Collection(galaxy=galaxy_model)\n\n    \"\"\"\n    We define the non-linear search used to fit the model to the data (in this case, Dynesty).\n    \"\"\"\n    search = af.Nautilus(name=\"search[example]\", n_live=50)\n    \n    \"\"\"\n    We next set up the `Analysis`, which contains the `log likelihood function` that the\n    non-linear search calls to fit the galaxy model to the data.\n    \"\"\"\n    analysis = ag.AnalysisImaging(dataset=masked_dataset)\n\n    \"\"\"\n    To perform the model-fit we pass the model and analysis to the search's fit method. This will\n    output results (e.g., dynesty samples, model parameters, visualization) to hard-disk.\n    \"\"\"\n    result = search.fit(model=model, analysis=analysis)\n\n    \"\"\"\n    The results contain information on the fit, for example the maximum likelihood\n    model from the Dynesty parameter space search.\n    \"\"\"\n    print(result.samples.max_log_likelihood())\n\n\nSupport\n-------\n\nSupport for installation issues, help with galaxy modeling and using **PyAutoGalaxy** is available by\n`raising an issue on the GitHub issues page <https://github.com/Jammy2211/PyAutoGalaxy/issues>`_.\n\nWe also offer support on the **PyAutoGalaxy** `Slack channel <https://pyautogalaxy.slack.com/>`_, where we also provide the\nlatest updates on **PyAutoGalaxy**. Slack is invitation-only, so if you'd like to join send\nan `email <https://github.com/Jammy2211>`_ requesting an invite.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Open-Source Multi Wavelength Galaxy Structure & Morphology",
    "version": "2025.10.21.1",
    "project_urls": {
        "Homepage": "https://github.com/Jammy2211/PyAutoGalaxy"
    },
    "split_keywords": [
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d93129db5c57aaba05e682fc6b74472d902b1edac02bcc2f19e63fbfd8db9d0",
                "md5": "6cf165d773989d69f4032f8f81fad92d",
                "sha256": "93b1e1e01ddde2f03756904d09e4cbe08934be3fa7591e96c5e4c569de8a675d"
            },
            "downloads": -1,
            "filename": "autogalaxy-2025.10.21.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6cf165d773989d69f4032f8f81fad92d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 5574738,
            "upload_time": "2025-10-21T22:28:43",
            "upload_time_iso_8601": "2025-10-21T22:28:43.370577Z",
            "url": "https://files.pythonhosted.org/packages/9d/93/129db5c57aaba05e682fc6b74472d902b1edac02bcc2f19e63fbfd8db9d0/autogalaxy-2025.10.21.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d436e4d56bbc662bef0c11b5181b13e82125b359936d34ad5c917f622ca03401",
                "md5": "2078b0a34cc7d3d876bd9a8cc3b4d630",
                "sha256": "8dd1a8179f7361067729ce28a63c44aeba53ddf0f28846971c484b7491a25bf4"
            },
            "downloads": -1,
            "filename": "autogalaxy-2025.10.21.1.tar.gz",
            "has_sig": false,
            "md5_digest": "2078b0a34cc7d3d876bd9a8cc3b4d630",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5424649,
            "upload_time": "2025-10-21T22:28:46",
            "upload_time_iso_8601": "2025-10-21T22:28:46.979584Z",
            "url": "https://files.pythonhosted.org/packages/d4/36/e4d56bbc662bef0c11b5181b13e82125b359936d34ad5c917f622ca03401/autogalaxy-2025.10.21.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-21 22:28:46",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Jammy2211",
    "github_project": "PyAutoGalaxy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "autogalaxy"
}
        
Elapsed time: 1.95659s