.. _runs_gama_lf_smf: GAMA DR4 validation: LF and SMF ================================= Script: ``scripts/measure_gama_lf_smf.py`` **Catalogues:** ``StellarMasses.fits.gz`` (Taylor+2011, BC03 + Chabrier IMF, per-galaxy ``zmax_19p8``) cross-matched with ``FULL_CATALOG_PROSPECT_MASSES.fits`` (RA/Dec). 116 235 galaxies after cuts (``nQ ≥ 3``, ``0.002 < z < 0.5``, valid mass and :math:`M_r`). Fields: G09, G12, G15 — area 182.2 deg² (HEALPix nside = 512). Cosmology: :math:`H_0 = 70`, :math:`\Omega_m = 0.30`. Mass completeness limits (Pozzetti+2010): 8.6 dex at z < 0.06 → 10.7 dex at z = 0.3–0.5. .. figure:: ../figures/runs/gama_smf_comparison.png :width: 100% :alt: GAMA SMF comparison 1/Vmax SMF (blue circles) in five redshift bins vs Baldry+2012 (red dashed, z < 0.06 panel) and Driver+2022 (green dash-dot). Agreement better than 0.05 dex at :math:`9.5 \lesssim \log_{10}M_\star \lesssim 11.5`. .. figure:: ../figures/runs/gama_lf_comparison.png :width: 90% :alt: GAMA r-band LF comparison 1/Vmax r-band LF (four redshift bins) vs Loveday+2012 (red dashed) and Loveday+2015 (orange dash-dot). Agreement < 0.05 dex at :math:`-21.5 \lesssim M_r \lesssim -19.5`. The 0.1–0.16 dex excess at :math:`M_r < -21` reflects the deeper limit (r < 19.8 vs r < 19.4 in both Loveday papers). **Outputs:** ``data/GAMA/gama_{smf,lf_r}_z{z1}_{z2}.fits``, ``gama_completeness.fits``.