OrionPy is a Python-based workflow to process astronomical FITS images, starting with the Orion Nebula (M42). It provides tools to load, calibrate, stretch, and combine stacked FITS frames into stunning grayscale and RGB composites. The workflow balances scientific accuracy with astrophotography aesthetics.
- Load and visualize FITS files
- Apply multiple stretch methods:
- Logarithmic
- Arcsinh (asinh)
- Histogram equalization
- Combine multi-filter FITS images (R, V, B) into RGB composites
- Save outputs as PNG for quick previews or publication
- Pre-configured for Ruff linting, pre-commit hooks, and GitHub Actions CI
- Clone the repository
git clone https://github.com/Parikshith-S/OrionPy.git
cd OrionPy- Install Poetry (if not installed)
pip install poetry- Install dependencies
poetry install- Activate Poetry shell (optional)
poetry shell- Place your FITS files inside data/M42/:
- Run the processing script
poetry run python src/process.py- Outputs will appear in the output/ folder:
- Grayscale previews per channel:
- M42_red_log.png, M42_green_asinh.png, etc.
- Color composites:
- M42_rgb_asinh.png, M42_rgb_log.png, M42_rgb_hist.png
RGB Composite (Arcsinh Stretch):
Grayscale Previews:
- Red channel:
- Green channel:
- Blue channel:
Replace the image paths above with actual screenshots from your /output folder.
This project uses Ruff for linting and formatting, and pre-commit hooks for code quality.
- Install hooks:
poetry run pre-commit install- Manually check all files:
poetry run pre-commit run --all-filesThe repo is pre-configured with GitHub Actions to run:
- Ruff lint and formatting checks
- Pytest unit tests
MIT License Β© Parikshith-S
