Photo-z-SQL: Integrated, flexible photometric redshift computation in a database

R. Beck, L. Dobos, T. Budavári, A. S. Szalay, I. Csabai

Research output: Contribution to journalArticle

2 Citations (Scopus)


We present a flexible template-based photometric redshift estimation framework, implemented in C#, that can be seamlessly integrated into a SQL database (or DB) server and executed on-demand in SQL. The DB integration eliminates the need to move large photometric datasets outside a database for redshift estimation, and utilizes the computational capabilities of DB hardware. The code is able to perform both maximum likelihood and Bayesian estimation, and can handle inputs of variable photometric filter sets and corresponding broad-band magnitudes. It is possible to take into account the full covariance matrix between filters, and filter zero points can be empirically calibrated using measurements with given redshifts. The list of spectral templates and the prior can be specified flexibly, and the expensive synthetic magnitude computations are done via lazy evaluation, coupled with a caching of results. Parallel execution is fully supported. For large upcoming photometric surveys such as the LSST, the ability to perform in-place photo-z calculation would be a significant advantage. Also, the efficient handling of variable filter sets is a necessity for heterogeneous databases, for example the Hubble Source Catalog, and for cross-match services such as SkyQuery. We illustrate the performance of our code on two reference photo-z estimation testing datasets, and provide an analysis of execution time and scalability with respect to different configurations. The code is available for download at

Original languageEnglish
Pages (from-to)34-44
Number of pages11
JournalAstronomy and Computing
Publication statusPublished - Apr 1 2017



  • Astronomical databases: miscellaneous
  • Galaxies: distances and redshifts
  • Techniques: photometric

ASJC Scopus subject areas

  • Astronomy and Astrophysics
  • Computer Science Applications

Cite this