Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Photometric redshift library that implements Generalised Linear Models.

Project Description

Homepage: GitHub Repository

CosmoPhotoz is a package that determines photometric redshifts from galaxies utilising their magnitudes. The method utilises Generalized Linear Models which reproduce the physical aspects of the output distribution. The rest of the methodology and testing of the technique is described in the associated Astronomy and Computing publication (link TBC).


  • Principle Component Anylsis and decomposition of input photometric catalogue
  • Generalized Linear Model family and link choice
  • Seaborn publication quality plots

Get it now

The package can be installed using the PyPI and pip.

$ pip install -U CosmoPhotoz

Or if the tarball or repository is downloaded, distutils can be

$ python install


Run from the command line.

$ --dataset sample.csv --num_components 3 --training_size 10000 --family Gamma --link log

Or import the library into python.

from CosmoPhotoz.photoz import PhotoSample # import the library
import numpy as np

# Instantiate the class
UserCatalogue = PhotoSample(filename="PHAT0", family="Gamma", link="log")

# Make a training size array to loop through
train_size_arr = np.arange(500,10000,500)
catastrophic_error = []

# Select your number of components
UserCatalogue.num_components = 4

for i in range(len(train_size_arr)):
    UserCatalogue.test_size = train_size_arr[i]

min_indx = np.array(catastrophic_error) < 5.937
optimum_train_size = train_size_arr[min_indx]
print optimum_train_size

See more examples within the Documentation.


  • The library documentation can be accessed at Read the Docs
  • The git repository can be accessed at GitHub
  • The PyPI package page can be accessed at PyPI


  • Python >= 2.7 or >= 3.3


  • GNU General Public License (GPL>=3)
Release History

Release History

This version
History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
CosmoPhotoz-0.1.tar.gz (2.6 MB) Copy SHA256 Checksum SHA256 Source Aug 23, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting