Skip to main content

A toolkit for simulating and analyzing integral field spectroscopic data cubes of astronomical sources.

Project description

Rubix Logo

Welcome to RUBIX

Contributions welcome GitHub Workflow Status Documentation Status codecov pre-commit License: MIT Code style: black Imports: isort Type checking All Contributors

RUBIX is a versatile Integral Field Unit (IFU) tool designed for astrophysical simulations. It transforms any particle based galaxy model (e.g. cosmological hydrodynamical simulation outputs) into realistic mock IFU cubes, enabling both forward and inverse modeling. Built on JAX, RUBIX leverages GPU acceleration and automatic differentiation, allowing users to perform gradient-based optimization for inverse modeling alongside traditional forward modeling.

Key features include:

  • Mock IFU Cube Generation: Convert simulation data into realistic IFU cubes.
  • GPU-Accelerated Computations: Built on JAX for high-performance GPU support.
  • Gradient-Based Inverse Modeling: Utilize gradients for efficient inverse modeling techniques.
  • Flexible and Extensible: Designed to easily integrate with existing pipelines and astrophysical analysis tools.

Installation

Rubix is on PyPi. You can install it via

pip install astro-rubix

If you need GPU acceleration, you can install it via

pip install astro-rubix[cuda]

Alternatively, the Python package rubix is published on GitHub and can be installed alongside its runtime dependencies (including JAX) by choosing the relevant extras. For a CPU-only environment, install with:

git clone https://github.com/AstroAI-Lab/rubix.git
cd rubix
pip install .

If you need GPU acceleration, please add the optional dependence with [cuda] (or install jax[cuda] following the JAX instructions before installing Rubix).

Development installation

If you want to contribute to the development of rubix, we recommend the following editable installation from this repository:

git clone https://github.com/AstroAI-Lab/rubix.git
cd rubix
python -m pip install --editable .[tests,dev]

Having done so, the test suite can be run using pytest:

python -m pytest

This project depends on jax. For the pytests we only test the cpu version. For installation instructions with gpu support, please refer to here or simply use the cuda option when pip installing.

Configuration overview

Rubix ships with two YAML files in rubix/config/: rubix_config.yml (constants, SSP templates, dust recipes, handler mappings, etc.) and pipeline_config.yml (pipeline graphs such as calc_ifu and calc_dusty_ifu). There is no configuration wizard — your runtime settings must supply a dictionary with the following blocks:

  • pipeline.name: Identifies the pipeline from pipeline_config.yml (e.g., calc_ifu, calc_dusty_ifu, or calc_gradient).
  • galaxy: Must provide dist_z and a rotation section (type or explicit alpha, beta, gamma).
  • telescope: Requires name, psf (currently only the gaussian kernel with size and sigma), lsf (sigma), and noise (signal_to_noise plus noise_distribution, choose from normal or uniform).
  • ssp.dust: Must declare extinction_model and Rv before calling the dusty pipeline (see rubix/spectra/dust/extinction_models.py for the supported models such as Cardelli89).
  • data.args.particle_type: Should include "stars" (and "gas" if you want the gas branch) so the filters and rotation functions know which components exist.

The tutorials and notebooks assume square spaxels, so the default telescope factory currently only supports pixel_type: square. For a working example, inspect notebooks/rubix_pipeline_single_function_shard_map.ipynb, which runs the exact pipeline used in the tests.

Documentation

Sphinx Documentation of all the functions is currently available under this link.

Contribution

Contributions to rubix are welcome and greatly appreciated! Whether you're fixing bugs, improving documentation, or suggesting new features, your help is valuable to us.

Please see here for contribution guidelines.

Thank you for helping improve rubix!

Citation

Please cite both of the following papers (Cakir et al. 2024, Schaible et al. 2025) if you use Rubix in your research:

  @ARTICLE{2024arXiv241208265C,
       author = {{{\c{C}}ak{\i}r}, Ufuk and {Schaible}, Anna Lena and {Buck}, Tobias},
        title = "{Fast GPU-Powered and Auto-Differentiable Forward Modeling of IFU Data Cubes}",
      journal = {arXiv e-prints},
     keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Astrophysics of Galaxies, Physics - Computational Physics, Physics - Data Analysis, Statistics and Probability},
         year = 2024,
        month = dec,
          eid = {arXiv:2412.08265},
        pages = {arXiv:2412.08265},
          doi = {10.48550/arXiv.2412.08265},
        archivePrefix = {arXiv},
       eprint = {2412.08265},
        primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2024arXiv241208265C},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
  }

  @ARTICLE{2025arXiv251117110S,
       author = {{Schaible}, Anna Lena and {{\c{C}}ak{\i}r}, Ufuk and {Buck}, Tobias and {Mack}, Harald and {Obreja}, Aura and {Oguz}, Nihat and {Oliver}, William H. and {C{\u{a}}r{\u{a}}mizaru}, Horea-Alexandru},
        title = "{RUBIX: Differentiable forward modelling of galaxy spectral data cubes for gradient-based parameter estimation}",
      journal = {arXiv e-prints},
     keywords = {Astrophysics of Galaxies},
         year = 2025,
        month = nov,
          eid = {arXiv:2511.17110},
        pages = {arXiv:2511.17110},
          doi = {10.48550/arXiv.2511.17110},
        archivePrefix = {arXiv},
       eprint = {2511.17110},
      primaryClass = {astro-ph.GA},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2025arXiv251117110S},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
  }

Contributors

Ufuk Çakır
Ufuk Çakır

💻 🖋 🔣 📖 🎨 💡 🤔 🚇 🚧 🔌 📆 💬 🔬 👀 🔧 ⚠️ 📢 📓
anschaible
anschaible

💻 🖋 🔣 📖 🎨 💡 🤔 🚇 🚧 🔌 📆 💬 🔬 👀 🔧 ⚠️ 📢 📓
Tobias Buck
Tobias Buck

💻 🖋 🔣 📖 🎨 💡 🤔 🚇 🚧 🔌 📆 💬 🔬 👀 🔧 ⚠️ 📢 📓 🧑‍🏫
Robin Janssen
Robin Janssen

💻
nihatog
nihatog

💻 📖 💡 🔬 👀 ⚠️ 📓
Aura Obreja
Aura Obreja

💬 👀 🔧 📓
Harald Mack
Harald Mack

💻 📖 🎨 🚇 💬 👀 🔧 ⚠️ 📓
Horea Caramizaru
Horea Caramizaru

💻 🎨 🚇 💬
Will
Will

💬 📓

Licence

MIT License

Acknowledgments

This repository was set up using the SSC Cookiecutter for Python Packages.

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

astro_rubix-0.0.4.tar.gz (71.3 MB view details)

Uploaded Source

Built Distribution

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

astro_rubix-0.0.4-py3-none-any.whl (7.6 MB view details)

Uploaded Python 3

File details

Details for the file astro_rubix-0.0.4.tar.gz.

File metadata

  • Download URL: astro_rubix-0.0.4.tar.gz
  • Upload date:
  • Size: 71.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for astro_rubix-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d67fd4013a06a318828396c57603f8fafbc034907d748bfe5de8b35ba845f8a9
MD5 1e0b0b00b5988f563f732470b1c9d647
BLAKE2b-256 95d2c5a90c1f62b4a8280606f73e42d8de29f278314927116c8c3096af946c12

See more details on using hashes here.

File details

Details for the file astro_rubix-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: astro_rubix-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 7.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for astro_rubix-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2092a484bfc6ef781e5a997d31285792bdf27e93ac46606a5a78b9aedb781089
MD5 596ec49cbdf2cbfd654a7816cf3fd2cc
BLAKE2b-256 66dce32226760efab1f526b4317431f3684b057b74a87b46bbdfb98cd606cfc5

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