Galamo Documentation
Welcome to the official documentation for Galamo. This guide provides everything you need to get started with the package, from installation to advanced usage and API details.
Galamo is an open-source Python package for comprehensive galaxy analysis, integrating machine learning and statistical methods. It provides automated tools for morphology classification, kinematics, photometry, and spectral analysis to aid astrophysical research.
Installation
Galamo is available on the Python Package Index (PyPI) and can be installed with pip. We recommend installing it within a virtual environment.
pip install galamo
To get the latest development version, you can install it directly from the GitHub repository:
pip install git+https://github.com/galamo-org/galamo.git
Quick Start
Here's a simple example of how to use Galamo to classify the morphology of a galaxy from an SDSS Object ID.
# Import the necessary module
from galamo.galaxy_morph import classify_morphology
# Provide the SDSS Object ID of the galaxy you want to classify
sdss_obj_id = 1237657642924441642
# Get the classification
try:
classification_results = classify_morphology(sdss_obj_id)
# Print the primary classification
print(f"Galaxy Morphology Classification for ObjID: {sdss_obj_id}")
print(f"Primary Class: {classification_results['primary_class']}")
print(f"Confidence: {classification_results['confidence']:.2f}")
# Print detailed probabilities
print("\nDetailed Probabilities:")
for key, value in classification_results['detailed_probabilities'].items():
print(f"- {key}: {value:.3f}")
except Exception as e:
print(f"An error occurred: {e}")
API Reference
This section provides a detailed reference for Galamo's public API.
galamo.galaxy_morph
classify_morphology(sdss_obj_id: int) -> dict
Fetches an image from SDSS and classifies its morphology.
Parameters
sdss_obj_id
(int): The 18-digit SDSS DR16 object identifier.
Returns
dict
: A dictionary containing the primary class, confidence, and detailed probabilities.
galamo.bpt
classify_bpt(nii_ha_ratio: float, oiii_hb_ratio: float) -> str
Classifies a galaxy's nuclear activity based on emission line ratios.
Parameters
nii_ha_ratio
(float): The ratio of [NII] to H-alpha emission lines.
oiii_hb_ratio
(float): The ratio of [OIII] to H-beta emission lines.
Returns
str
: The classification ('AGN', 'Composite', or 'Star-forming').
galamo.psr
enhance_image(image_path: str, output_path: str) -> None
Applies enhancements to a low-light astronomical image.
Parameters
image_path
(str): Path to the input image file.
output_path
(str): Path to save the enhanced image.
Returns
None
Citing Galamo
If you use Galamo in your research, please cite the software to acknowledge the work that went into its development. Please use the following BibTeX entry:
@software{galamo_2025,
author = {Dingra, Jashanpreet Singh and Singh, Vikramjeet},
title = {Galamo: An open-source Python package for comprehensive galaxy analysis},
month = jul,
year = 2025,
publisher = {Zenodo},
version = {0.0.9},
doi = {10.5281/zenodo.XXXXXXX},
url = {https://doi.org/10.5281/zenodo.XXXXXXX}
}
Note: Please replace the DOI with the actual DOI from the Zenodo record for the specific version you used.