Galaxy Science & Methods

The Science. The Math. The Methods.

TheGalaxyDB is built on real astrophysics. Here we explain the science behind our catalog, how we classify galaxies, where the data comes from, and the math that underpins every measurement.

Lesson 01
What Is a Galaxy?

A galaxy is a gravitationally bound system of stars, stellar remnants, interstellar gas, dust, and dark matter, all orbiting a common center of mass. The observable universe contains an estimated two trillion galaxies (Conselice et al. 2016), ranging from dwarf irregulars with a few hundred million stars to giant ellipticals hosting tens of trillions.

Galaxies are not distributed randomly. They cluster into galaxy groups (like the Local Group, which contains the Milky Way, Andromeda, and ~80 smaller members), galaxy clusters (hundreds to thousands of galaxies bound by gravity and hot intracluster gas), and superclusters, vast filaments and sheets separated by nearly empty cosmic voids.

~2T
Galaxies in observable universe
100–400B
Stars in the Milky Way
~28 Mpc
Diameter of local supercluster
~85%
Universe mass that is dark matter
Lesson 02
The Hubble Sequence, Morphological Classification

Edwin Hubble introduced the first systematic galaxy classification scheme in 1926. His tuning fork diagram separated galaxies into ellipticals (E0–E7, graded by ellipticity), lenticulars (S0), and spirals (Sa–Sd), with irregulars as a catch-all. Barred spirals (SBa–SBd) were added as a parallel sequence. The de Vaucouleurs extension added intermediate types (SAB), ring structures (R), and inner rings (r vs. s for regular vs. pseudoring arms).

The T-type parameter encodes this numerically: E = −5 to −4, S0 = −2 to 0, Sa = 1, Sb = 3, Sc = 5, Sd = 7, Sm = 9, Im = 10. This is stored in our database as the t_type column and was cross-matched from HyperLEDA (Makarov et al. 2014), covering ~1.6 million galaxies with measured morphology.

The Math

Ellipticity e = 1 - b/a where a is the semi-major axis and b the semi-minor axis. An E0 galaxy has b/a ≈ 1 (nearly circular); an E7 has b/a ≈ 0.3. Note: this is the projected ellipticity, a true sphere can appear elliptical depending on viewing angle.

Hubble TypeT-typeDescriptionExample
E0–E7−5 to −4Elliptical, featureless, red/old stars, little gasM87, NGC 1399
S0 / SB0−2 to 0Lenticular, disk + bulge, no spiral armsNGC 3115
Sa–Sd1–7Spiral, arms winding from central bulgeM81, Milky Way
SBa–SBd1–7Barred spiral, arms emanate from central barNGC 1300
Sm / Im9–10Magellanic / irregular, asymmetric, gas-richLMC, SMC
Lesson 03
Measuring Galaxy Distances, The Distance Ladder

Galaxy distances are the hardest measurement in observational astronomy. No single method works at all scales, so cosmologists build a distance ladder, each rung calibrates the next.

Rung 1, Parallax: For stars within ~10 kpc, the Earth's orbital motion produces a measurable angular shift (1 arcsecond at 1 parsec = 3.26 ly). Gaia measured parallaxes for 1.4 billion stars.

Rung 2, Cepheid Variables: Pulsating supergiants with a precise period–luminosity relation (L ∝ Pα). Usable to ~30 Mpc; calibrated by Hubble Space Telescope.

Rung 3, Type Ia Supernovae: "Standard candles", consistent peak luminosity (~MB = −19.3) after light-curve width correction. Usable to z ~ 2 (billions of light-years).

Rung 4, Redshift (Hubble's Law): Beyond ~300 Mpc, recession velocity v = H₀ × d gives distance. We use H₀ = 70 km/s/Mpc (a compromise between Planck CMB value 67.4 and SH0ES Cepheid value 73.0).

Redshift Formula

z = (λ_obs − λ_emit) / λ_emit. For small z: distance ≈ (c / H₀) × z. For cosmological distances we integrate the Friedmann equation with Ω_m = 0.315, Ω_Λ = 0.685 (Planck 2018). Our distance_mpc column stores the comoving distance in Megaparsecs.

Lesson 04
Active Galactic Nuclei, When Black Holes Feed

At the center of most large galaxies sits a supermassive black hole (SMBH) with mass 10⁶–10¹⁰ M☉. When material falls onto the SMBH via an accretion disk, the infalling matter radiates enormous energy, sometimes outshining the entire host galaxy. These are Active Galactic Nuclei (AGN).

AGN appear in several guises depending on orientation and accretion rate: Seyfert galaxies (low-luminosity AGN, broad vs. narrow emission lines distinguish Type 1 and 2), quasars (high-luminosity, high-redshift AGN; the most distant objects we can directly observe), and blazars (jet pointed directly at Earth, extreme variability, synchrotron radiation). Our agn_flag column marks galaxies with confirmed AGN activity.

Eddington Luminosity

The maximum luminosity before radiation pressure halts accretion: L_Edd = 4πGMm_p c / σ_T ≈ 1.26 × 10³⁸ (M / M☉) erg/s. A 10⁸ M☉ black hole accreting at the Eddington limit shines at ~10⁴⁶ erg/s, 10 trillion solar luminosities.

Lesson 05
Dark Matter, The Invisible Scaffold

Galaxy rotation curves were the first strong evidence for dark matter. Vera Rubin and Kent Ford (1970s) found that stars at the outer edges of spiral galaxies orbit just as fast as inner stars, defying Keplerian predictions (which require v ∝ r−1/2 at large radii). The only explanation: a massive invisible dark matter halo extending far beyond the visible disk.

Dark matter constitutes ~27% of the universe's energy density (Planck 2018) but does not emit, absorb, or reflect electromagnetic radiation. Its presence is inferred from gravitational lensing, cluster dynamics (Bullet Cluster), cosmic microwave background anisotropies, and large-scale structure formation. The leading candidate is WIMPs (Weakly Interacting Massive Particles), though detection remains elusive.

Our database stores stellar_mass_log (log₁₀ of stellar mass in M☉) from HECATE (Kovlakas et al. 2021) for ~51,000 galaxies. Total halo mass is typically 10–100× the stellar mass, the bulk of it dark.

Lesson 06
Galaxy Formation and Evolution

In the ΛCDM model (Lambda Cold Dark Matter), structure forms hierarchically: quantum fluctuations in the early universe seeded density perturbations, which gravity amplified. Dark matter collapsed first into halos; ordinary matter fell in afterward, forming stars. Small galaxies merged to build larger ones, hierarchical assembly.

Star formation rate (SFR) tells us how actively a galaxy is building new stars. Our log_sfr column stores log₁₀(SFR / M☉ yr⁻¹). The main sequence of star-forming galaxies (Elbaz et al. 2011) is a tight relation: log SFR ≈ 0.76 × log M★ − 7.65. Galaxies above this line are starbursts; below it are "quenched" (passive) ellipticals.

Quenching mechanisms include: AGN feedback (jets heating/expelling gas), stellar feedback (supernova winds), ram-pressure stripping (gas swept away as a galaxy moves through cluster medium), and strangulation (cutting off the cold gas supply from the cosmic web).

Key Timescale

The dynamical time of a galaxy: t_dyn ≈ 1 / √(G ρ̄). For the Milky Way disk (ρ̄ ~ 0.1 M☉/pc³), t_dyn ~ 30 Myr. The disk completes one rotation (~225 Myr at the Sun's radius) in about 7–8 dynamical times.

Lesson 07
How We Built TheGalaxyDB, The Math We Did

TheGalaxyDB contains 22.4 million galaxies drawn from five authoritative catalogs: SDSS DR18 (1.1M with velocity dispersions), HyperLEDA (52k morphological types), HECATE (51k with stellar mass and star formation rates), PGC2003 (1.6M with photometry), and Mangrove (enriched cross-matched set). Every galaxy has coordinates, redshift, and at minimum a magnitude estimate.

Coordinate crossmatching: We match across catalogs using angular separation: Δθ = 2 arcsin(√(sin²(Δδ/2) + cos(δ₁)cos(δ₂)sin²(Δα/2))), the Haversine formula, numerically stable at small angles. Match radius: 5 arcseconds for bright catalogs, 10 arcseconds for faint/extended sources.

Name resolution: Each galaxy may have a PGC number, NGC/IC designation, Messier number, UGC number, and multiple survey IDs. We resolve all to a canonical name using NASA/IPAC NED's naming conventions, stored in the name, hyperleda_name, gwgc_name, and twomass_name columns.

Distance computation: For galaxies with spectroscopic redshifts (z > 0.002), we integrate the comoving distance: D_C = (c/H₀) ∫₀ᶻ dz'/E(z') where E(z) = √(Ω_m(1+z)³ + Ω_Λ). We use Ω_m = 0.315, Ω_Λ = 0.685, H₀ = 70 km/s/Mpc, storing the result in Mpc.

22.4M
Total galaxies in database
5
Source catalogs merged
1.1M
Galaxies with velocity dispersion
51k
Galaxies with stellar mass + SFR
Lesson 08
GLEN, The Galaxy Layer Engine

GLEN (Galaxy Layer Engine) is the real-time WebGL rendering system that powers the TheGalaxyDB Explorer. Just as STEN renders individual stars, GLEN renders entire galaxies, their morphological profiles, colors based on type and redshift, and structural features like spiral arms and bulge-to-disk ratios, all computed on the GPU in real time.

Morphological color mapping: Ellipticals (E0–E7, T-type ≤ −3) render in warm amber/red tones reflecting their old stellar populations. Spirals (Sa–Sd) shift progressively bluer as the T-type increases, matching their increasing gas fraction and active star formation. Irregular galaxies get the bluest, most diffuse profiles. AGN-flagged galaxies receive a bright central core highlight.

GLEN is licensable as a stand-alone SDK. Embed a live-rendered galaxy explorer in your browser app, iOS app, or Android app, not a video, not a static image, a live WebGL render responding to real data from the TheGalaxyDB API. See Licensing for metered pricing.