Skip to main content

Stacked SEDs

CI/CD Pipeline Documentation Status PyPI Python 3.8+ License: MIT

A Python package for stacking faint galaxy images from multiple broadband filters and preparing them for Spectral Energy Distribution (SED) analysis.

Key Features

  • Galaxy Image Stacking: Robust stacking of hundreds of faint galaxy cutouts using trimmed mean statistics
  • Error Propagation: Automatic calculation of uncertainty maps using Median Absolute Deviation (MAD)
  • Radial Photometry: Azimuthally averaged surface brightness profiles with background subtraction
  • Publication-Ready Plots: Automated generation of multi-filter comparison plots
  • Command-Line Tools: Simple sed-stack and sed-photom commands for easy workflow execution

Installation

PyPI (Recommended)

pip install stacked-seds

Development Installation

For contributors or to get the latest features:

git clone https://github.com/ryantrainor/stacked-seds.git
cd stacked-seds
pip install -e ".[dev]"

Verify Your Installation

# Test command-line tools
sed-stack --help
sed-photom --help

# Test Python imports
python -c "import stacked_seds; print(f'Successfully installed version {stacked_seds.__version__}')"

Requirements

  • Python ≥ 3.8
  • NumPy ≥ 1.20.0
  • SciPy ≥ 1.7.0
  • Astropy ≥ 5.0.0
  • Matplotlib ≥ 3.5.0
  • PhotoUtils ≥ 1.5.0

All dependencies are automatically installed with pip.

Quick Start

Basic Usage

# 1. Create configuration file
cp config/params.yml my_config.yml

# 2. Edit my_config.yml with your data paths

# 3. Run stacking workflow
sed-stack my_config.yml
sed-photom my_config.yml

Python API Example

from stacked_seds import stacking, photometry

# Load and stack galaxy images
pixel_coords = stacking.get_galaxy_pixel_coords("image.fits", "galaxies.reg")
stamps = stacking.create_stamps(image_data, wcs_obj, pixel_coords)
stacked_image, error_map = stacking.stack_images(stamps)

# Perform radial photometry
radii, profile, errors = photometry.get_radial_profile(stacked_image, center)

Documentation

Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

git clone https://github.com/ryantrainor/stacked-seds.git
cd stacked-seds
pip install -e ".[dev]"
make test

Code Quality

This project uses modern Python development tools:

  • Black for code formatting
  • flake8 for linting
  • pytest for testing
  • GitHub Actions for CI/CD
# Run all quality checks
make check

# Format code
make format

# Run tests
make test

Citation

If you use this software in your research, please cite:

@software{stacked_seds,
  title={Stacked SEDs: Galaxy Image Stacking and Photometry},
  author={Abraham, O. and Chapman, C. and Garcia, E. and Trainor, R.},
  year={2025},
  url={https://github.com/ryantrainor/stacked-seds},
  doi={10.5281/zenodo.XXXXXX}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments

This project was developed at Franklin & Marshall College. We thank the astronomy community for their valuable feedback and contributions.

Metadata

Release files for stacked-seds 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stacked-seds 1.0.1
File Size Uploaded
stacked_seds-1.0.1.tar.gz 16.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stacked-seds 1.0.1
File Interpreter ABI Platform
stacked_seds-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 29.7 kB

Release files / stacked_seds-1.0.1.tar.gz

Download URL stacked_seds-1.0.1.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
787a50f10f4afa6f5d65d49819cd83722103f392e670f5bd2dbeaedfcfa280a8
BLAKE2b-256 checksum
How to use checksums
1a8b2b966ab7cfff8d73e605626d80d6dcbf29803f1fce86b8608145dd402015
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / stacked_seds-1.0.1-py3-none-any.whl

Download URL stacked_seds-1.0.1-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8143ede717e42b28550fadb2449da9882f803df5e541bcc1fa333aa28622cd56
BLAKE2b-256 checksum
How to use checksums
3cea601eb150db576384d55d8b80315f36275f76013c8eba542342f0b9e861ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page