# lsstdesc/photozdc1 architecture

> Architecture diagram of the GitHub repository lsstdesc/photozdc1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lsstdesc/photozdc1
- Repository: https://github.com/lsstdesc/photozdc1

## Overview

This is a Python toolkit for generating galaxy photometry/catalogs from mock-galaxy properties and studying photo-z performance under configurable systematic effects. The intended workflow is to read a mock catalog, assign or generate SEDs, model perturbations, compute observed magnitudes, and assess resulting photo-z statistics. The README describes some stages as planned rather than implemented; links for those capabilities are documented or left unverified. Source excerpts and the index establish only a subset of runtime wiring.

Main entry points: [`src/sedMapper.py`](https://github.com/lsstdesc/photozdc1/blob/master/src/sedMapper.py) (SED mapping), [`src/interface.py`](https://github.com/lsstdesc/photozdc1/blob/master/src/interface.py) (Catalog interface), [`src/photometry.py`](https://github.com/lsstdesc/photozdc1/blob/master/src/photometry.py) (Magnitude calculation), [`src/sedFilter.py`](https://github.com/lsstdesc/photozdc1/blob/master/src/sedFilter.py) (SED and filters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Catalog and Templates"]
  node_catalog[("Mock catalog")]
  node_catalog_io["Catalog interface<br/>[interface.py]"]
  node_sed_data[("SED library")]
  node_filter_data[("Filter curves")]
end

subgraph group_models["Galaxy and SED Models"]
  node_sed_filter["SED and filters<br/>[sedFilter.py]"]
  node_sed_mapper["SED mapping<br/>[sedMapper.py]"]
  node_galaxy["Galaxy properties<br/>[galaxy.py]"]
  node_sed_generator["SED generation<br/>[sedGenerator.py]"]
  node_continuum["Continuum fitting"]
  node_emission["Emission lines<br/>[emLineGenerator.py]"]
  node_reddening["Dust reddening<br/>[reddening.py]"]
  node_igm["IGM absorption<br/>[igmModel.py]"]
  node_astro["Atomic calculations<br/>[genAstro.py]"]
end

subgraph group_observation["Photometry Simulation"]
  node_photometry["Magnitude calculation<br/>[photometry.py]"]
  node_cosmo["Cosmology<br/>[cosmo.py]"]
  node_errors["Photometric errors<br/>[photErrorModel.py]"]
  node_constants["Physical constants<br/>[const.py]"]
  node_observed[("Observed catalog")]
end

subgraph group_analysis["Photo-z Analysis"]
  node_pz_format["Photo-z formatting"]
  node_photoz["Photo-z metrics<br/>[photo_z.py]"]
  node_color_analysis["Color distributions<br/>[plot_color.py]"]
end

node_user(("Simulation user"))

node_user -->|"loads inputs"| node_catalog_io
node_catalog -->|"provides data"| node_catalog_io
node_catalog_io -.->|"maps properties"| node_sed_mapper
node_sed_data -->|"provides templates"| node_sed_mapper
node_filter_data -.->|"provides curves"| node_sed_filter
node_sed_mapper -->|"uses SEDs"| node_sed_filter
node_catalog_io -->|"uses mapper"| node_sed_mapper
node_sed_mapper -->|"uses calculations"| node_photometry
node_sed_mapper -->|"uses filters"| node_sed_filter
node_galaxy -.->|"supplies properties"| node_sed_mapper
node_sed_generator -.->|"supplies SEDs"| node_sed_mapper
node_continuum -.->|"parameterizes SEDs"| node_sed_mapper
node_emission -.->|"perturbs SEDs"| node_sed_mapper
node_reddening -.->|"perturbs SEDs"| node_sed_mapper
node_igm -.->|"absorbs light"| node_sed_mapper
node_igm -->|"uses atomic calculations"| node_astro
node_photometry -.->|"uses distances"| node_cosmo
node_photometry -.->|"applies noise"| node_errors
node_cosmo -->|"uses constants"| node_constants
node_astro -->|"uses constants"| node_constants
node_photometry -.->|"computes magnitudes"| node_observed
node_observed -->|"formats catalog"| node_pz_format
node_pz_format -->|"reads catalog"| node_catalog_io
node_observed -.->|"evaluates estimates"| node_photoz
node_photoz -->|"uses plotting"| node_color_analysis

click node_catalog_io "https://github.com/lsstdesc/photozdc1/blob/master/src/interface.py"
click node_sed_data "https://github.com/lsstdesc/photozdc1/tree/master/sed_data"
click node_filter_data "https://github.com/lsstdesc/photozdc1/tree/master/filter_data"
click node_sed_filter "https://github.com/lsstdesc/photozdc1/blob/master/src/sedFilter.py"
click node_sed_mapper "https://github.com/lsstdesc/photozdc1/blob/master/src/sedMapper.py"
click node_galaxy "https://github.com/lsstdesc/photozdc1/blob/master/src/galaxy.py"
click node_sed_generator "https://github.com/lsstdesc/photozdc1/blob/master/src/sedGenerator.py"
click node_continuum "https://github.com/lsstdesc/photozdc1/blob/master/src/continuum_pc_emlines.py"
click node_emission "https://github.com/lsstdesc/photozdc1/blob/master/src/emLineGenerator.py"
click node_reddening "https://github.com/lsstdesc/photozdc1/blob/master/src/reddening.py"
click node_igm "https://github.com/lsstdesc/photozdc1/blob/master/src/igmModel.py"
click node_astro "https://github.com/lsstdesc/photozdc1/blob/master/src/genAstro.py"
click node_photometry "https://github.com/lsstdesc/photozdc1/blob/master/src/photometry.py"
click node_cosmo "https://github.com/lsstdesc/photozdc1/blob/master/src/cosmo.py"
click node_errors "https://github.com/lsstdesc/photozdc1/blob/master/src/photErrorModel.py"
click node_constants "https://github.com/lsstdesc/photozdc1/blob/master/src/const.py"
click node_pz_format "https://github.com/lsstdesc/photozdc1/blob/master/src/convert_file_to_pzformat.py"
click node_photoz "https://github.com/lsstdesc/photozdc1/blob/master/validation/photo_z.py"
click node_color_analysis "https://github.com/lsstdesc/photozdc1/blob/master/validation/plot_color.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_catalog,node_catalog_io,node_sed_data,node_filter_data,node_user toneBlue
class node_sed_filter,node_sed_mapper,node_galaxy,node_sed_generator,node_continuum,node_emission,node_reddening,node_igm,node_astro toneAmber
class node_photometry,node_cosmo,node_errors,node_constants,node_observed toneMint
class node_pz_format,node_photoz,node_color_analysis toneRose
```

## Components

### Catalog and Templates

- **Mock catalog**
- [Catalog interface](https://github.com/lsstdesc/photozdc1/blob/master/src/interface.py): `src/interface.py`
- [SED library](https://github.com/lsstdesc/photozdc1/tree/master/sed_data): `sed_data`
- [Filter curves](https://github.com/lsstdesc/photozdc1/tree/master/filter_data): `filter_data`

### Galaxy and SED Models

- [SED and filters](https://github.com/lsstdesc/photozdc1/blob/master/src/sedFilter.py): `src/sedFilter.py`
- [SED mapping](https://github.com/lsstdesc/photozdc1/blob/master/src/sedMapper.py): `src/sedMapper.py`
- [Galaxy properties](https://github.com/lsstdesc/photozdc1/blob/master/src/galaxy.py): `src/galaxy.py`
- [SED generation](https://github.com/lsstdesc/photozdc1/blob/master/src/sedGenerator.py): `src/sedGenerator.py`
- [Continuum fitting](https://github.com/lsstdesc/photozdc1/blob/master/src/continuum_pc_emlines.py): `src/continuum_pc_emlines.py`
- [Emission lines](https://github.com/lsstdesc/photozdc1/blob/master/src/emLineGenerator.py): `src/emLineGenerator.py`
- [Dust reddening](https://github.com/lsstdesc/photozdc1/blob/master/src/reddening.py): `src/reddening.py`
- [IGM absorption](https://github.com/lsstdesc/photozdc1/blob/master/src/igmModel.py): `src/igmModel.py`
- [Atomic calculations](https://github.com/lsstdesc/photozdc1/blob/master/src/genAstro.py): `src/genAstro.py`

### Photometry Simulation

- [Magnitude calculation](https://github.com/lsstdesc/photozdc1/blob/master/src/photometry.py): `src/photometry.py`
- [Cosmology](https://github.com/lsstdesc/photozdc1/blob/master/src/cosmo.py): `src/cosmo.py`
- [Photometric errors](https://github.com/lsstdesc/photozdc1/blob/master/src/photErrorModel.py): `src/photErrorModel.py`
- [Physical constants](https://github.com/lsstdesc/photozdc1/blob/master/src/const.py): `src/const.py`
- **Observed catalog**

### Photo-z Analysis

- [Photo-z formatting](https://github.com/lsstdesc/photozdc1/blob/master/src/convert_file_to_pzformat.py): `src/convert_file_to_pzformat.py`
- [Photo-z metrics](https://github.com/lsstdesc/photozdc1/blob/master/validation/photo_z.py): `validation/photo_z.py`
- [Color distributions](https://github.com/lsstdesc/photozdc1/blob/master/validation/plot_color.py): `validation/plot_color.py`

### Other components

- **Simulation user**

## Connections

- Simulation user → Catalog interface: loads inputs (evidence: `README.md`)
- Mock catalog → Catalog interface: provides data (evidence: `README.md`)
- Catalog interface → SED mapping: maps properties (evidence: `src/interface.py`)
- SED library → SED mapping: provides templates (evidence: `README.md`)
- Filter curves → SED and filters: provides curves
- SED mapping → SED and filters: uses SEDs (evidence: `src/sedMapper.py`)
- Catalog interface → SED mapping: uses mapper (evidence: `src/interface.py`)
- SED mapping → Magnitude calculation: uses calculations (evidence: `src/sedMapper.py`)
- SED mapping → SED and filters: uses filters (evidence: `src/sedMapper.py`)
- Galaxy properties → SED mapping: supplies properties
- SED generation → SED mapping: supplies SEDs (evidence: `README.md`)
- Continuum fitting → SED mapping: parameterizes SEDs (evidence: `README.md`)
- Emission lines → SED mapping: perturbs SEDs (evidence: `README.md`)
- Dust reddening → SED mapping: perturbs SEDs
- IGM absorption → SED mapping: absorbs light (evidence: `README.md`)
- IGM absorption → Atomic calculations: uses atomic calculations (evidence: `src/igmModel.py`)
- Magnitude calculation → Cosmology: uses distances
- Magnitude calculation → Photometric errors: applies noise (evidence: `src/photErrorModel.py`)
- Cosmology → Physical constants: uses constants (evidence: `src/cosmo.py`)
- Atomic calculations → Physical constants: uses constants (evidence: `src/genAstro.py`)
- Magnitude calculation → Observed catalog: computes magnitudes (evidence: `README.md`)
- Observed catalog → Photo-z formatting: formats catalog (evidence: `src/convert_file_to_pzformat.py`)
- Photo-z formatting → Catalog interface: reads catalog (evidence: `src/convert_file_to_pzformat.py`)
- Observed catalog → Photo-z metrics: evaluates estimates (evidence: `README.md`)
- Photo-z metrics → Color distributions: uses plotting (evidence: `validation/photo_z.py`)
