API Reference

Configuration

Configuration loading and defaults.

class euclid_dsps.config.Paths(catalog: 'Path', ssp: 'Path')[source]
Parameters:
  • catalog (Path)

  • ssp (Path)

catalog: Path
ssp: Path
exception euclid_dsps.config.ConfigValidationError[source]

Raised when a run configuration is internally inconsistent.

euclid_dsps.config.load_config(path)[source]

Load a YAML config file.

Parameters:

path (str | Path)

Return type:

dict[str, Any]

euclid_dsps.config.normalize_config(config)[source]

Fill lightweight defaults without hiding required paths.

Parameters:

config (dict[str, Any])

Return type:

dict[str, Any]

euclid_dsps.config.validate_config(config)[source]

Validate the normalized runtime configuration.

Validation intentionally checks structure and scalar contracts only. It does not require local data files to exist, so CI can validate configs without shipping the private or large FS2 parquet files.

Parameters:

config (dict[str, Any])

Return type:

None

euclid_dsps.config.validate_catalog_columns(config, available_columns)[source]

Validate that every configured catalog column exists in a data source.

Parameters:
  • config (dict[str, Any])

  • available_columns (set[str] | list[str] | tuple[str, ...])

Return type:

None

euclid_dsps.config.resolve_path(path, base_dir=None)[source]

Resolve paths relative to the current working directory or config dir.

Parameters:
  • path (str | Path)

  • base_dir (str | Path | None)

Return type:

Path

Catalog Columns

Column metadata for the CosmoHub catalog used by this project.

class euclid_dsps.columns.CatalogColumn(name, source_name, group, dtype, unit, description, notes='')[source]

Human-readable metadata for one catalog column.

Parameters:
  • name (str)

  • source_name (str)

  • group (str)

  • dtype (str)

  • unit (str)

  • description (str)

  • notes (str)

name: str
source_name: str
group: str
dtype: str
unit: str
description: str
notes: str = ''
euclid_dsps.columns.known_catalog_columns()[source]

Return the canonical local column names documented for catalog 353.

Return type:

set[str]

I/O

Catalog, observation, and artifact I/O.

class euclid_dsps.io.BandObservation(name: 'str', column: 'str', flux_fnu_cgs: 'float', mag_ab: 'float', sigma_mag: 'float', error_column: 'str | None' = None, flux_error_fnu_cgs: 'float | None' = None)[source]
Parameters:
  • name (str)

  • column (str)

  • flux_fnu_cgs (float)

  • mag_ab (float)

  • sigma_mag (float)

  • error_column (str | None)

  • flux_error_fnu_cgs (float | None)

name: str
column: str
flux_fnu_cgs: float
mag_ab: float
sigma_mag: float
error_column: str | None = None
flux_error_fnu_cgs: float | None = None
class euclid_dsps.io.GalaxyObservation(row_index: 'int', row: 'dict[str, Any]', bands: 'list[BandObservation]')[source]
Parameters:
row_index: int
row: dict[str, Any]
bands: list[BandObservation]
euclid_dsps.io.ensure_dir(path)[source]
Parameters:

path (str | Path)

Return type:

Path

euclid_dsps.io.write_json(path, payload)[source]
Parameters:
  • path (str | Path)

  • payload (Any)

Return type:

None

euclid_dsps.io.configured_output_formats(config)[source]

Return configured tabular output formats.

Parameters:

config (dict[str, Any])

Return type:

list[str]

euclid_dsps.io.write_dataframe_outputs(frame, out_dir, stem, config, index=False)[source]

Write a dataframe in configured formats and return filenames.

Parameters:
  • frame (DataFrame)

  • out_dir (str | Path)

  • stem (str)

  • config (dict[str, Any])

  • index (bool)

Return type:

list[str]

euclid_dsps.io.to_jsonable(value)[source]
Parameters:

value (Any)

Return type:

Any

euclid_dsps.io.dataclass_is_instance(value)[source]
Parameters:

value (Any)

Return type:

bool

euclid_dsps.io.read_catalog(path, columns=None, nrows=None)[source]

Read a parquet catalog into memory, optionally truncating rows.

Parameters:
  • path (str | Path)

  • columns (list[str] | None)

  • nrows (int | None)

Return type:

DataFrame

euclid_dsps.io.truth_column_from_spec(spec)[source]

Return the catalog column named by a truth-column config entry.

Parameters:

spec (Any)

Return type:

str | None

euclid_dsps.io.truth_value_from_spec(row, spec)[source]

Read and optionally transform a truth value from a catalog row.

Parameters:
  • row (dict[str, Any])

  • spec (Any)

Return type:

float | None

euclid_dsps.io.iter_catalog_batches(path, columns=None, batch_size=10000, limit=None, row_indices=None)[source]

Yield catalog batches without loading the full parquet into memory.

Parameters:
  • path (str | Path)

  • columns (list[str] | None)

  • batch_size (int)

  • limit (int | None)

  • row_indices (set[int] | None)

Return type:

Iterable[DataFrame]

euclid_dsps.io.load_row_indices(path)[source]

Load row indices from a one-column text or CSV file.

Parameters:

path (str | Path)

Return type:

list[int]

euclid_dsps.io.flux_fnu_cgs_to_abmag(flux)[source]

Convert F_nu in erg/s/cm^2/Hz to AB magnitude.

Parameters:

flux (float)

Return type:

float

euclid_dsps.io.abmag_to_flux_fnu_cgs(mag)[source]

Convert AB magnitude to F_nu in erg/s/cm^2/Hz.

Parameters:

mag (float)

Return type:

float

euclid_dsps.io.microjy_to_flux_fnu_cgs(flux_microjy)[source]

Convert microJansky to F_nu in erg/s/cm^2/Hz.

Parameters:

flux_microjy (float)

Return type:

float

euclid_dsps.io.microjy_to_abmag(flux_microjy)[source]

Convert microJansky to AB magnitude.

Parameters:

flux_microjy (float)

Return type:

float

euclid_dsps.io.flux_error_to_sigma_mag(flux_fnu_cgs, flux_error_fnu_cgs, floor=None, ceiling=None)[source]

Convert a flux-density uncertainty into a local AB-mag uncertainty.

Parameters:
  • flux_fnu_cgs (float)

  • flux_error_fnu_cgs (float)

  • floor (float | None)

  • ceiling (float | None)

Return type:

float

euclid_dsps.io.build_observation(row_index, row, band_configs)[source]

Build one photometric observation from a catalog row.

When a band declares error_column, the catalog flux-density error is converted to a local AB-magnitude uncertainty and used by the likelihood. The configured sigma_mag remains the fallback for bands without usable per-object errors.

Parameters:
  • row_index (int)

  • row (Series)

  • band_configs (list[dict[str, Any]])

Return type:

GalaxyObservation

euclid_dsps.io.required_catalog_columns(config)[source]
Parameters:

config (dict[str, Any])

Return type:

list[str]

Filters

Filter loading helpers.

class euclid_dsps.filters.FilterCurve(name: 'str', wave: 'np.ndarray', transmission: 'np.ndarray', source: 'str')[source]
Parameters:
  • name (str)

  • wave (ndarray)

  • transmission (ndarray)

  • source (str)

name: str
wave: ndarray
transmission: ndarray
source: str
property effective_wavelength: float

Transmission-weighted central wavelength in Angstrom.

euclid_dsps.filters.load_filters(band_configs)[source]

Load all filters declared in the config.

Parameters:

band_configs (list[dict[str, Any]])

Return type:

dict[str, FilterCurve]

euclid_dsps.filters.load_filter(name, filter_config)[source]

Load an exact HDF5/FITS/DAT curve or build an approximate top-hat.

Parameters:
  • name (str)

  • filter_config (dict[str, Any])

Return type:

FilterCurve

euclid_dsps.filters.load_ascii_filter(name, path, filter_config)[source]

Load two-column ASCII throughput files.

Parameters:
  • name (str)

  • path (Path)

  • filter_config (dict[str, Any])

Return type:

FilterCurve

euclid_dsps.filters.load_fits_filter(name, path, filter_config)[source]

Load Euclid throughput FITS files and convert wavelength to Angstrom.

Parameters:
  • name (str)

  • path (Path)

  • filter_config (dict[str, Any])

Return type:

FilterCurve

Model

Native DSPS model wrapper.

class euclid_dsps.model.DspsContext(ssp: 'Any', filters: 'dict[str, FilterCurve]', n_sfh_bins: 'int' = 96, cosmos_dust_k_by_code: 'np.ndarray | None' = None, cosmos_dust_curve_names: 'tuple[str, ...]' = (), ssp_wave_jax: 'Any | None' = None, ssp_lgmet_jax: 'Any | None' = None, ssp_lg_age_gyr_jax: 'Any | None' = None, ssp_flux_jax: 'Any | None' = None, ssp_emline_luminosity: 'np.ndarray | None' = None, ssp_emline_wave: 'np.ndarray | None' = None, ssp_emline_name: 'tuple[str, ...]' = (), nebular_emission_mode: 'str' = 'ssp_flux', jax_filters: 'tuple[tuple[Any, Any], ...]' = (), cosmos_dust_k_by_code_jax: 'Any | None' = None)[source]
Parameters:
  • ssp (Any)

  • filters (dict[str, FilterCurve])

  • n_sfh_bins (int)

  • cosmos_dust_k_by_code (ndarray | None)

  • cosmos_dust_curve_names (tuple[str, ...])

  • ssp_wave_jax (Any | None)

  • ssp_lgmet_jax (Any | None)

  • ssp_lg_age_gyr_jax (Any | None)

  • ssp_flux_jax (Any | None)

  • ssp_emline_luminosity (ndarray | None)

  • ssp_emline_wave (ndarray | None)

  • ssp_emline_name (tuple[str, ...])

  • nebular_emission_mode (str)

  • jax_filters (tuple[tuple[Any, Any], ...])

  • cosmos_dust_k_by_code_jax (Any | None)

ssp: Any
filters: dict[str, FilterCurve]
n_sfh_bins: int = 96
cosmos_dust_k_by_code: ndarray | None = None
cosmos_dust_curve_names: tuple[str, ...] = ()
ssp_wave_jax: Any | None = None
ssp_lgmet_jax: Any | None = None
ssp_lg_age_gyr_jax: Any | None = None
ssp_flux_jax: Any | None = None
ssp_emline_luminosity: ndarray | None = None
ssp_emline_wave: ndarray | None = None
ssp_emline_name: tuple[str, ...] = ()
nebular_emission_mode: str = 'ssp_flux'
jax_filters: tuple[tuple[Any, Any], ...] = ()
cosmos_dust_k_by_code_jax: Any | None = None
class euclid_dsps.model.ModelResult(parameters: 'dict[str, float]', derived: 'dict[str, float]', wave: 'np.ndarray', rest_sed: 'np.ndarray', dusted_rest_sed: 'np.ndarray', photometry: 'dict[str, dict[str, float]]')[source]
Parameters:
  • parameters (dict[str, float])

  • derived (dict[str, float])

  • wave (ndarray)

  • rest_sed (ndarray)

  • dusted_rest_sed (ndarray)

  • photometry (dict[str, dict[str, float]])

parameters: dict[str, float]
derived: dict[str, float]
wave: ndarray
rest_sed: ndarray
dusted_rest_sed: ndarray
photometry: dict[str, dict[str, float]]
class euclid_dsps.model.JaxModelResult(wave: 'jnp.ndarray', rest_sed: 'jnp.ndarray', dusted_rest_sed: 'jnp.ndarray', model_mags: 'jnp.ndarray', t_obs_gyr: 'jnp.ndarray', formed_mass_msun: 'jnp.ndarray', sfr_at_obs_msun_per_yr: 'jnp.ndarray')[source]
Parameters:
  • wave (jax.numpy.ndarray)

  • rest_sed (jax.numpy.ndarray)

  • dusted_rest_sed (jax.numpy.ndarray)

  • model_mags (jax.numpy.ndarray)

  • t_obs_gyr (jax.numpy.ndarray)

  • formed_mass_msun (jax.numpy.ndarray)

  • sfr_at_obs_msun_per_yr (jax.numpy.ndarray)

wave: jax.numpy.ndarray
rest_sed: jax.numpy.ndarray
dusted_rest_sed: jax.numpy.ndarray
model_mags: jax.numpy.ndarray
t_obs_gyr: jax.numpy.ndarray
formed_mass_msun: jax.numpy.ndarray
sfr_at_obs_msun_per_yr: jax.numpy.ndarray
class euclid_dsps.model.BatchSedResult(parameter_names, parameter_matrix, wave, rest_sed, dusted_rest_sed, model_mags, derived)[source]

Batch DSPS SEDs and photometry from one JAX-vmapped call.

Parameters:
  • parameter_names (list[str])

  • parameter_matrix (ndarray)

  • wave (ndarray)

  • rest_sed (ndarray)

  • dusted_rest_sed (ndarray)

  • model_mags (ndarray)

  • derived (dict[str, ndarray])

parameter_names: list[str]
parameter_matrix: ndarray
wave: ndarray
rest_sed: ndarray
dusted_rest_sed: ndarray
model_mags: ndarray
derived: dict[str, ndarray]
euclid_dsps.model.load_context(ssp_path, filters, n_sfh_bins=96, cosmos_config=None, nebular_emission='ssp_flux')[source]
Parameters:
  • ssp_path (str)

  • filters (dict[str, FilterCurve])

  • n_sfh_bins (int)

  • cosmos_config (dict[str, Any] | None)

  • nebular_emission (str)

Return type:

DspsContext

euclid_dsps.model.parameters_for_row(base, parameter_columns, row, redshift_config=None)[source]

Merge fixed config parameters with optional per-row catalog overrides.

Parameters:
  • base (dict[str, Any])

  • parameter_columns (dict[str, str])

  • row (dict[str, Any])

  • redshift_config (dict[str, Any] | None)

Return type:

dict[str, float]

euclid_dsps.model.resolve_redshift(params, row, redshift_config)[source]

Resolve DSPS redshift from configured initializer.

Parameters:
  • params (dict[str, float])

  • row (dict[str, Any])

  • redshift_config (dict[str, Any])

Return type:

float

euclid_dsps.model.redshift_prior_parameters(z_value, row, redshift_config)[source]

Return row-level redshift prior metadata consumed by fit priors.

Parameters:
  • z_value (float)

  • row (dict[str, Any])

  • redshift_config (dict[str, Any])

Return type:

dict[str, float]

euclid_dsps.model.run_dsps_model(context, params)[source]

Run DSPS from simple SFH/metallicity parameters to SED and photometry.

Parameters:
Return type:

ModelResult

euclid_dsps.model.run_dsps_model_jax(context, params)[source]

Pure-JAX DSPS forward model used by gradient-based fits.

Parameters:
Return type:

JaxModelResult

euclid_dsps.model.predict_mags_jax(context, wave, dusted_sed, z_obs)[source]

Predict configured apparent AB magnitudes with DSPS photometry kernels.

Parameters:
  • context (DspsContext)

  • wave (jax.numpy.ndarray)

  • dusted_sed (jax.numpy.ndarray)

  • z_obs (jax.numpy.ndarray)

Return type:

jax.numpy.ndarray

euclid_dsps.model.model_mags_jax(context, params)[source]

Return only model magnitudes for likelihood/gradient code.

Parameters:
Return type:

jax.numpy.ndarray

euclid_dsps.model.predict_batch_mags(context, parameter_names, parameter_matrix)[source]

Predict magnitudes for many parameter rows with one JAX-vmapped call.

Parameters:
  • context (DspsContext)

  • parameter_names (list[str])

  • parameter_matrix (ndarray)

Return type:

ndarray

euclid_dsps.model.derived_quantities_jax(context, params)[source]

Return derived quantities needed for scientifically comparable reports.

Parameters:
Return type:

jax.numpy.ndarray

euclid_dsps.model.predict_batch_derived(context, parameter_names, parameter_matrix)[source]

Compute derived quantities for many fitted parameter rows.

Parameters:
  • context (DspsContext)

  • parameter_names (list[str])

  • parameter_matrix (ndarray)

Return type:

dict[str, ndarray]

euclid_dsps.model.predict_batch_seds(context, parameter_names, parameter_matrix)[source]

Predict rest SEDs, dusted rest SEDs, magnitudes, and derived quantities.

This is the batch/GPU path used by COSMOS-template comparisons after MAP or population fits. It avoids one Python DSPS call per galaxy.

Parameters:
  • context (DspsContext)

  • parameter_names (list[str])

  • parameter_matrix (ndarray)

Return type:

BatchSedResult

euclid_dsps.model.build_lognormal_sfh(gal_t_table, log10_sfr, sfh_t_peak, sfh_tau)[source]

Build a positive SFH in Msun/yr on cosmic-time bins.

Parameters:
  • gal_t_table (ndarray)

  • log10_sfr (float)

  • sfh_t_peak (float)

  • sfh_tau (float)

Return type:

ndarray

euclid_dsps.model.build_sfh_table_jax(gal_t_table, params)[source]

Build the simple production SFH table without leaving JAX.

Parameters:
  • gal_t_table (jax.numpy.ndarray)

  • params (dict[str, Any])

Return type:

jax.numpy.ndarray

euclid_dsps.model.build_lognormal_sfh_jax(gal_t_table, log10_sfr, sfh_t_peak, sfh_tau)[source]

JAX lognormal SFH used by production fits.

Parameters:
  • gal_t_table (jax.numpy.ndarray)

  • log10_sfr (jax.numpy.ndarray)

  • sfh_t_peak (jax.numpy.ndarray)

  • sfh_tau (jax.numpy.ndarray)

Return type:

jax.numpy.ndarray

euclid_dsps.model.normalize_sfh_mass_jax(gal_t_table, gal_sfr_table, params)[source]

Optionally scale an SFH to a configured formed stellar mass.

Without log10_formed_mass_msun this preserves the historical behavior, where log10_sfr is the SFH amplitude. With it, log10_sfr only sets the pre-normalization shape scale and the luminosity amplitude is controlled by the formed-mass parameter.

Parameters:
  • gal_t_table (jax.numpy.ndarray)

  • gal_sfr_table (jax.numpy.ndarray)

  • params (dict[str, Any])

Return type:

tuple[jax.numpy.ndarray, jax.numpy.ndarray]

euclid_dsps.model.apply_dust(wave_angstrom, rest_sed, params)[source]

Apply the configured attenuation model.

Parameters:
  • wave_angstrom (ndarray)

  • rest_sed (ndarray)

  • params (dict[str, float])

Return type:

ndarray

euclid_dsps.model.apply_dust_jax(wave_angstrom, rest_sed, params, cosmos_dust_k_by_code=None)[source]

Apply COSMOS two-component dust when available, else DSPS Salim dust.

Parameters:
  • wave_angstrom (jax.numpy.ndarray)

  • rest_sed (jax.numpy.ndarray)

  • params (dict[str, Any])

  • cosmos_dust_k_by_code (ndarray | None)

Return type:

jax.numpy.ndarray

euclid_dsps.model.apply_salim_dust_jax(wave_angstrom, rest_sed, params)[source]

Apply DSPS Salim+2018-style attenuation without leaving JAX.

Parameters:
  • wave_angstrom (jax.numpy.ndarray)

  • rest_sed (jax.numpy.ndarray)

  • params (dict[str, Any])

Return type:

jax.numpy.ndarray

euclid_dsps.model.apply_cosmos_two_component_dust_jax(rest_sed, params, cosmos_dust_k_by_code)[source]

Apply the two COSMOS dust curves as a differentiable mixture.

Parameters:
  • rest_sed (jax.numpy.ndarray)

  • params (dict[str, Any])

  • cosmos_dust_k_by_code (ndarray)

Return type:

jax.numpy.ndarray

euclid_dsps.model.comparison_rows(observation, result)[source]
Parameters:
Return type:

list[dict[str, float | str]]

COSMOS Template SEDs

COSMOS-template pseudo-ground-truth SED reconstruction.

The Flagship catalog does not contain wavelength-by-wavelength spectra. This module reconstructs an approximate, template-level proxy from COSMOS template IDs, E(B-V), extinction-curve codes, and optional component fractions. The output is a diagnostic reference SED, not exact physical SPS truth.

exception euclid_dsps.cosmos.CosmosSedError[source]

Raised when COSMOS-template SED reconstruction cannot continue.

exception euclid_dsps.cosmos.MissingCosmosColumnsError[source]

Raised when catalog columns required by COSMOS SED reconstruction are absent.

exception euclid_dsps.cosmos.MissingCosmosResourceError[source]

Raised when LePhare template or extinction files are absent.

class euclid_dsps.cosmos.CosmosTemplate(template_id, name, path, wave_angstrom, flambda)[source]

One COSMOS template from COSMOS_MOD.list.

Parameters:
  • template_id (int)

  • name (str)

  • path (Path)

  • wave_angstrom (ndarray)

  • flambda (ndarray)

template_id: int
name: str
path: Path
wave_angstrom: ndarray
flambda: ndarray
class euclid_dsps.cosmos.ExtinctionCurve(name, path, wave_angstrom, k_lambda)[source]

One LePhare extinction curve k(lambda).

Parameters:
  • name (str)

  • path (Path)

  • wave_angstrom (ndarray)

  • k_lambda (ndarray)

name: str
path: Path
wave_angstrom: ndarray
k_lambda: ndarray
class euclid_dsps.cosmos.CosmosSedResources(templates, extinction_curves, extinction_mapping, template_list_path, extinction_dir)[source]

Loaded COSMOS templates and extinction-curve mapping.

Parameters:
  • templates (tuple[CosmosTemplate, ...])

  • extinction_curves (dict[str, ExtinctionCurve])

  • extinction_mapping (dict[int, str])

  • template_list_path (Path)

  • extinction_dir (Path)

templates: tuple[CosmosTemplate, ...]
extinction_curves: dict[str, ExtinctionCurve]
extinction_mapping: dict[int, str]
template_list_path: Path
extinction_dir: Path
class euclid_dsps.cosmos.CosmosSedResult(row_index, wave_angstrom, flambda_unscaled, flambda_scaled, alpha, synthetic_abs_fluxes_before, synthetic_abs_fluxes_after, catalog_abs_fluxes, residuals_vs_catalog_abs, relative_residuals_vs_catalog_abs, diagnostics)[source]

Reconstructed and Euclid-absolute-flux-normalized proxy SED.

Parameters:
  • row_index (int)

  • wave_angstrom (ndarray)

  • flambda_unscaled (ndarray)

  • flambda_scaled (ndarray)

  • alpha (float)

  • synthetic_abs_fluxes_before (dict[str, float])

  • synthetic_abs_fluxes_after (dict[str, float])

  • catalog_abs_fluxes (dict[str, float])

  • residuals_vs_catalog_abs (dict[str, float])

  • relative_residuals_vs_catalog_abs (dict[str, float])

  • diagnostics (dict[str, Any])

row_index: int
wave_angstrom: ndarray
flambda_unscaled: ndarray
flambda_scaled: ndarray
alpha: float
synthetic_abs_fluxes_before: dict[str, float]
synthetic_abs_fluxes_after: dict[str, float]
catalog_abs_fluxes: dict[str, float]
residuals_vs_catalog_abs: dict[str, float]
relative_residuals_vs_catalog_abs: dict[str, float]
diagnostics: dict[str, Any]
euclid_dsps.cosmos.resolve_lephare_data_dir(cosmos_config)[source]

Resolve LePhare auxiliary-data root.

Priority is explicit config, LEPHAREDIR, then the LePhare default cache used by recent installations.

Parameters:

cosmos_config (dict[str, Any])

Return type:

Path

euclid_dsps.cosmos.load_cosmos_sed_resources(cosmos_config)[source]

Load COSMOS templates and LePhare extinction curves.

Parameters:

cosmos_config (dict[str, Any])

Return type:

CosmosSedResources

euclid_dsps.cosmos.load_cosmos_templates(cosmos_config)[source]

Load templates in exact COSMOS_MOD.list order.

Catalog IDs 0..N-1 map directly to the line order in the list file.

Parameters:

cosmos_config (dict[str, Any])

Return type:

tuple[CosmosTemplate, …]

euclid_dsps.cosmos.load_extinction_curves(cosmos_config)[source]

Load configured LePhare extinction curves from $LEPHAREDIR/ext.

Parameters:

cosmos_config (dict[str, Any])

Return type:

tuple[dict[int, str], dict[str, ExtinctionCurve], Path]

euclid_dsps.cosmos.resolve_value_added_data_dir(cosmos_config)[source]

Resolve the optional SciPIC value-added data directory.

Parameters:

cosmos_config (dict[str, Any])

Return type:

Path | None

euclid_dsps.cosmos.load_value_added_cosmos_templates(cosmos_config, value_added_dir)[source]

Load SciPIC COSMOS templates from value_added_data/galaxy_seds.

Parameters:
  • cosmos_config (dict[str, Any])

  • value_added_dir (Path)

Return type:

tuple[CosmosTemplate, …]

euclid_dsps.cosmos.load_value_added_extinction_curves(cosmos_config, value_added_dir)[source]

Derive k(lambda) curves from SciPIC attenuated flat-Fnu files.

Parameters:
  • cosmos_config (dict[str, Any])

  • value_added_dir (Path)

Return type:

tuple[dict[int, str], dict[str, ExtinctionCurve], Path]

euclid_dsps.cosmos.reconstruct_cosmos_proxy_sed(row, row_index, resources, filters, band_configs, cosmos_config)[source]

Reconstruct, attenuate, combine, and normalize one COSMOS proxy SED.

Parameters:
  • row (dict[str, Any] | Series)

  • row_index (int)

  • resources (CosmosSedResources)

  • filters (dict[str, FilterCurve])

  • band_configs (list[dict[str, Any]])

  • cosmos_config (dict[str, Any])

Return type:

CosmosSedResult

euclid_dsps.cosmos.apply_cosmos_extinction(wave_angstrom, flambda, ebv, curve_code, resources)[source]

Apply F_att = F * 10**(-0.4 E(B-V) k(lambda)).

Parameters:
  • wave_angstrom (ndarray)

  • flambda (ndarray)

  • ebv (float)

  • curve_code (int)

  • resources (CosmosSedResources)

Return type:

ndarray

euclid_dsps.cosmos.component_fractions(row, cosmos_config)[source]

Return normalized component fractions with explicit missing-column policy.

Parameters:
  • row (dict[str, Any])

  • cosmos_config (dict[str, Any])

Return type:

tuple[float, float, dict[str, Any]]

euclid_dsps.cosmos.synthetic_fnu_from_flambda(wave_angstrom, flambda_cgs_per_angstrom, filter_curve, response_kind='photon')[source]

Integrate an F_lambda SED through a filter and return mean Fnu.

response_kind='photon' uses the common photon-counting AB convention:

<Fnu> = integral(lambda F_lambda T dlambda) / integral(c/lambda T dlambda).

response_kind='energy' uses an energy-response convention:

<Fnu> = integral(F_lambda T dlambda) / integral(c/lambda^2 T dlambda).

Parameters:
  • wave_angstrom (ndarray)

  • flambda_cgs_per_angstrom (ndarray)

  • filter_curve (FilterCurve)

  • response_kind (str)

Return type:

float

euclid_dsps.cosmos.normalize_cosmos_sed(wave_angstrom, flambda_unscaled, row, filters, band_configs, cosmos_config)[source]

Fit scalar normalization against Euclid *_abs flux densities.

Parameters:
  • wave_angstrom (ndarray)

  • flambda_unscaled (ndarray)

  • row (dict[str, Any])

  • filters (dict[str, FilterCurve])

  • band_configs (list[dict[str, Any]])

  • cosmos_config (dict[str, Any])

Return type:

dict[str, Any]

euclid_dsps.cosmos.normalization_band_specs(cosmos_config, band_configs)[source]

Return normalization band mapping to rest-frame absolute-flux columns.

Parameters:
  • cosmos_config (dict[str, Any])

  • band_configs (list[dict[str, Any]])

Return type:

list[dict[str, str]]

euclid_dsps.cosmos.cosmos_catalog_columns(config, available_columns=None, include_optional=True)[source]

Return columns needed for COSMOS SED reconstruction and diagnostics.

Parameters:
  • config (dict[str, Any])

  • available_columns (set[str] | None)

  • include_optional (bool)

Return type:

list[str]

euclid_dsps.cosmos.validate_cosmos_catalog(df, config, available_columns=None)[source]

Validate template IDs, extinction codes, fractions, and abs photometry.

Parameters:
  • df (DataFrame)

  • config (dict[str, Any])

  • available_columns (set[str] | None)

Return type:

dict[str, Any]

euclid_dsps.cosmos.cosmos_diagnostic_row(result)[source]

Flatten one reconstructed SED normalization result for CSV output.

Parameters:

result (CosmosSedResult)

Return type:

dict[str, Any]

euclid_dsps.cosmos.cosmos_abs_flux_rows(result)[source]

Return one row per Euclid absolute-flux comparison.

Parameters:

result (CosmosSedResult)

Return type:

list[dict[str, Any]]

euclid_dsps.cosmos.cosmos_sed_long_rows(result)[source]

Return reproducible long-form sampled SED table for parquet output.

Parameters:

result (CosmosSedResult)

Return type:

DataFrame

euclid_dsps.cosmos.flambda_to_fnu(wave_angstrom, flambda)[source]

Convert F_lambda per Angstrom to Fnu at the same wavelength.

Parameters:
  • wave_angstrom (ndarray)

  • flambda (ndarray)

Return type:

ndarray

euclid_dsps.cosmos.fnu_to_flambda(wave_angstrom, fnu)[source]

Convert Fnu to F_lambda per Angstrom.

Parameters:
  • wave_angstrom (ndarray)

  • fnu (ndarray | float)

Return type:

ndarray

euclid_dsps.cosmos.flambda_10pc_to_lnu_lsun(wave_angstrom, flambda)[source]

Convert rest-frame 10 pc F_lambda to Lnu in Lsun/Hz.

Parameters:
  • wave_angstrom (ndarray)

  • flambda (ndarray)

Return type:

ndarray

euclid_dsps.cosmos.lnu_lsun_to_flambda_10pc(wave_angstrom, lnu_lsun_per_hz)[source]

Convert Lnu in Lsun/Hz to rest-frame 10 pc F_lambda.

Parameters:
  • wave_angstrom (ndarray)

  • lnu_lsun_per_hz (ndarray)

Return type:

ndarray

euclid_dsps.cosmos.compare_cosmos_to_dsps_rest_sed(cosmos_result, dsps_result, filters, cosmos_config)[source]

Compare COSMOS proxy rest SED shape against DSPS rest SED.

Parameters:
Return type:

tuple[dict[str, Any], DataFrame]

euclid_dsps.cosmos.rest_sed_color_residuals(wave, cosmos_flambda, dsps_result, dsps_scale, filters, cosmos_config)[source]

Compute synthetic Euclid rest-flux color residuals.

Parameters:
  • wave (ndarray)

  • cosmos_flambda (ndarray)

  • dsps_result (ModelResult)

  • dsps_scale (float)

  • filters (dict[str, FilterCurve])

  • cosmos_config (dict[str, Any])

Return type:

dict[str, float]

euclid_dsps.cosmos.observed_photometry_target_rows(row, row_index, dsps_result, band_configs, target_set_names=None)[source]

Compare DSPS observed photometry to configured Euclid catalog target sets.

Parameters:
  • row (dict[str, Any])

  • row_index (int)

  • dsps_result (ModelResult)

  • band_configs (list[dict[str, Any]])

  • target_set_names (list[str] | None)

Return type:

list[dict[str, Any]]

euclid_dsps.cosmos.observed_photometry_chi2_summary(frame)[source]

Summarize branch-2 chi-square by row and target set.

Parameters:

frame (DataFrame)

Return type:

DataFrame

euclid_dsps.cosmos.photometry_target_sets(band_configs, names=None)[source]

Build branch-2 target column sets for configured photometric bands.

Parameters:
  • band_configs (list[dict[str, Any]])

  • names (list[str] | None)

Return type:

list[dict[str, Any]]

euclid_dsps.cosmos.grouped_metric_summary(frame, value_column)[source]

Group metrics by color kind and broad redshift bins.

Parameters:
  • frame (DataFrame)

  • value_column (str)

Return type:

DataFrame

euclid_dsps.cosmos.population_validation_summary(frame, value_column, metric_name)[source]

Summarize metrics over science-relevant population axes.

Parameters:
  • frame (DataFrame)

  • value_column (str)

  • metric_name (str)

Return type:

DataFrame

JAX Runtime

JAX runtime configuration used before importing JAX-heavy modules.

euclid_dsps.jax_runtime.apply_jax_runtime_env(runtime_config)[source]

Apply CLI/config runtime choices before importing JAX-heavy modules.

Parameters:

runtime_config (dict[str, Any] | None)

Return type:

None

euclid_dsps.jax_runtime.configure_jax_runtime()[source]

Set conservative JAX defaults unless caller already configured them.

Return type:

None

euclid_dsps.jax_runtime.require_jax_gpu(expected_name=None)[source]

Raise if JAX did not expose an NVIDIA/CUDA-capable GPU device.

Parameters:

expected_name (str | None)

Return type:

list[str]

Fitting

Single-galaxy fitting helpers.

class euclid_dsps.fit.FitResult(success: 'bool', message: 'str', best_parameters: 'dict[str, float]', chi2: 'float', n_bands: 'int', trace: 'list[dict[str, float]]', model_result: 'ModelResult', gradient_norm: 'float')[source]
Parameters:
  • success (bool)

  • message (str)

  • best_parameters (dict[str, float])

  • chi2 (float)

  • n_bands (int)

  • trace (list[dict[str, float]])

  • model_result (ModelResult)

  • gradient_norm (float)

success: bool
message: str
best_parameters: dict[str, float]
chi2: float
n_bands: int
trace: list[dict[str, float]]
model_result: ModelResult
gradient_norm: float
class euclid_dsps.fit.BatchFitResult(success: 'np.ndarray', message: 'str', parameter_names: 'list[str]', free_parameter_names: 'list[str]', best_parameter_matrix: 'np.ndarray', chi2: 'np.ndarray', gradient_norm: 'np.ndarray', model_mags: 'np.ndarray', trace: 'list[dict[str, float]]', device: 'str')[source]
Parameters:
  • success (ndarray)

  • message (str)

  • parameter_names (list[str])

  • free_parameter_names (list[str])

  • best_parameter_matrix (ndarray)

  • chi2 (ndarray)

  • gradient_norm (ndarray)

  • model_mags (ndarray)

  • trace (list[dict[str, float]])

  • device (str)

success: ndarray
message: str
parameter_names: list[str]
free_parameter_names: list[str]
best_parameter_matrix: ndarray
chi2: ndarray
gradient_norm: ndarray
model_mags: ndarray
trace: list[dict[str, float]]
device: str
class euclid_dsps.fit.PopulationFitResult(batch: 'BatchFitResult', hyper_mu: 'dict[str, float]', hyper_sigma: 'dict[str, float]', hyper_relations: 'list[dict[str, Any]]', loss: 'float')[source]
Parameters:
  • batch (BatchFitResult)

  • hyper_mu (dict[str, float])

  • hyper_sigma (dict[str, float])

  • hyper_relations (list[dict[str, Any]])

  • loss (float)

batch: BatchFitResult
hyper_mu: dict[str, float]
hyper_sigma: dict[str, float]
hyper_relations: list[dict[str, Any]]
loss: float
euclid_dsps.fit.fit_one_galaxy(context, observation, base_params, fit_config)[source]

Fit configured DSPS parameters with pure-JAX gradients.

Parameters:
Return type:

FitResult

euclid_dsps.fit.fit_galaxy_batch_adam(context, base_params_rows, observed_mag, sigma_mag, fit_config, truth_theta=None, observed_flux=None, flux_error=None, initial_theta=None)[source]

Fit many independent galaxies in one JAX-vmapped Adam run.

Parameters:
  • context (DspsContext)

  • base_params_rows (list[dict[str, float]])

  • observed_mag (ndarray)

  • sigma_mag (ndarray)

  • fit_config (dict[str, Any])

  • truth_theta (ndarray | None)

  • observed_flux (ndarray | None)

  • flux_error (ndarray | None)

  • initial_theta (ndarray | None)

Return type:

BatchFitResult

euclid_dsps.fit.fit_population_batch_adam(context, base_params_rows, observed_mag, sigma_mag, fit_config, initial_theta=None, truth_theta=None, observed_flux=None, flux_error=None)[source]

Joint MAP fit with a Gaussian population prior over free parameters.

Parameters:
  • context (DspsContext)

  • base_params_rows (list[dict[str, float]])

  • observed_mag (ndarray)

  • sigma_mag (ndarray)

  • fit_config (dict[str, Any])

  • initial_theta (ndarray | None)

  • truth_theta (ndarray | None)

  • observed_flux (ndarray | None)

  • flux_error (ndarray | None)

Return type:

PopulationFitResult

Sampling

MCMC posterior sampling for selected galaxies.

class euclid_dsps.mcmc.ScaledBetaDistribution(*args, **kwargs)[source]

Beta distribution scaled to a finite interval.

Parameters:
  • alpha (float)

  • beta (float)

  • low (float)

  • high (float)

  • validate_args (bool | None)

arg_constraints = {'alpha': numpyro.distributions.constraints.positive, 'beta': numpyro.distributions.constraints.positive, 'high': numpyro.distributions.constraints.real, 'low': numpyro.distributions.constraints.real}
reparametrized_params = ['alpha', 'beta']
support()
sample(key, sample_shape=())[source]
log_prob(value)[source]
class euclid_dsps.mcmc.MCMCResult(samples: 'dict[str, np.ndarray]', derived_samples: 'dict[str, np.ndarray]', summary: 'list[dict[str, float | str]]', posterior_model_mags: 'np.ndarray', observed_mag: 'np.ndarray', sigma_mag: 'np.ndarray', observed_flux_fnu_cgs: 'np.ndarray', flux_error_fnu_cgs: 'np.ndarray', band_names: 'list[str]', diagnostics: 'dict[str, Any]')[source]
Parameters:
  • samples (dict[str, ndarray])

  • derived_samples (dict[str, ndarray])

  • summary (list[dict[str, float | str]])

  • posterior_model_mags (ndarray)

  • observed_mag (ndarray)

  • sigma_mag (ndarray)

  • observed_flux_fnu_cgs (ndarray)

  • flux_error_fnu_cgs (ndarray)

  • band_names (list[str])

  • diagnostics (dict[str, Any])

samples: dict[str, ndarray]
derived_samples: dict[str, ndarray]
summary: list[dict[str, float | str]]
posterior_model_mags: ndarray
observed_mag: ndarray
sigma_mag: ndarray
observed_flux_fnu_cgs: ndarray
flux_error_fnu_cgs: ndarray
band_names: list[str]
diagnostics: dict[str, Any]
euclid_dsps.mcmc.sample_one_galaxy(context, observation, base_params, fit_config, sample_config, initial_params=None)[source]

Sample posterior over configured free parameters with NumPyro HMC/NUTS.

Parameters:
  • context (DspsContext)

  • observation (GalaxyObservation)

  • base_params (dict[str, float])

  • fit_config (dict[str, Any])

  • sample_config (dict[str, Any])

  • initial_params (dict[str, float] | None)

Return type:

MCMCResult

Workflows

Workflow orchestration entry points.

euclid_dsps.workflows.fit_batch(config, out_dir, limit=25, batch_size=1000, row_indices_file=None)[source]

Fit the configured free parameters for many rows.

The default path optimizes each parquet chunk with one JAX-vmapped Adam run.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.fit_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

euclid_dsps.workflows.prepare_one(config)[source]
Parameters:

config (dict[str, Any])

euclid_dsps.workflows.reconstruct_cosmos_seds(config, out_dir, limit=10, batch_size=1000, index=None, compare_dsps=False, fit_dsps=False, population_dsps=False, sample_plot_count=None)[source]

Run COSMOS-template SED reconstruction for a small catalog sample.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • index (int | None)

  • compare_dsps (bool)

  • fit_dsps (bool)

  • population_dsps (bool)

  • sample_plot_count (int | None)

Return type:

DataFrame

euclid_dsps.workflows.run_batch(config, out_dir, limit=None, batch_size=10000, row_indices_file=None)[source]

Run the same configured DSPS model over many catalog rows.

This is intentionally conservative: it writes a flat comparison table and supports per-row physical parameters through model.parameter_columns.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.run_eda(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

euclid_dsps.workflows.run_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

DataFrame

euclid_dsps.workflows.sample_batch(config, out_dir, limit=5, batch_size=1, row_indices_file=None)[source]

Sample independent galaxy posteriors with NumPyro NUTS.

This intentionally runs one galaxy at a time; HMC/NUTS is for posterior density checks on small subsets, while Adam/MAP remains the full-catalog path.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.sample_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

EDA workflow entry points.

euclid_dsps.workflows.eda.run_eda(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

Forward-model workflow entry points.

euclid_dsps.workflows.forward.prepare_one(config)[source]
Parameters:

config (dict[str, Any])

euclid_dsps.workflows.forward.run_batch(config, out_dir, limit=None, batch_size=10000, row_indices_file=None)[source]

Run the same configured DSPS model over many catalog rows.

This is intentionally conservative: it writes a flat comparison table and supports per-row physical parameters through model.parameter_columns.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.forward.run_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

DataFrame

COSMOS-template pseudo-SED workflow entry points.

euclid_dsps.workflows.cosmos.reconstruct_cosmos_seds(config, out_dir, limit=10, batch_size=1000, index=None, compare_dsps=False, fit_dsps=False, population_dsps=False, sample_plot_count=None)[source]

Run COSMOS-template SED reconstruction for a small catalog sample.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • index (int | None)

  • compare_dsps (bool)

  • fit_dsps (bool)

  • population_dsps (bool)

  • sample_plot_count (int | None)

Return type:

DataFrame

MAP fitting workflow entry points.

euclid_dsps.workflows.map_fit.fit_batch(config, out_dir, limit=25, batch_size=1000, row_indices_file=None)[source]

Fit the configured free parameters for many rows.

The default path optimizes each parquet chunk with one JAX-vmapped Adam run.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.map_fit.fit_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

Bayesian sampling workflow entry points.

euclid_dsps.workflows.bayesian.sample_batch(config, out_dir, limit=5, batch_size=1, row_indices_file=None)[source]

Sample independent galaxy posteriors with NumPyro NUTS.

This intentionally runs one galaxy at a time; HMC/NUTS is for posterior density checks on small subsets, while Adam/MAP remains the full-catalog path.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.bayesian.sample_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

Population-level fitting workflow entry points.

euclid_dsps.workflows.population.fit_population(config, out_dir, limit=25, batch_size=256, row_indices_file=None, map_init_file=None)[source]

Fit chunked hierarchical population MAP models with JAX-vmapped Adam.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

  • map_init_file (str | None)

Return type:

None

Composite workflow entry points.

euclid_dsps.workflows.workflow.fit_workflow(config, out_dir, limit=1000, batch_size=64, hmc_n=20, hmc_batch_size=1, population_batch_size=None, hmc_select='stratified', seed=42)[source]

Run MAP batch, HMC subset, population MAP, and comparison reports.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • hmc_n (int)

  • hmc_batch_size (int)

  • population_batch_size (int | None)

  • hmc_select (str)

  • seed (int)

Return type:

None

euclid_dsps.workflows.workflow.report_workflow(config, run_dir)[source]

Regenerate workflow comparison reports from existing workflow outputs.

Parameters:
  • config (dict[str, Any])

  • run_dir (str | Path)

Return type:

None

End-to-end workflows used by the CLI.

euclid_dsps.workflows.core.run_eda(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

euclid_dsps.workflows.core.prepare_one(config)[source]
Parameters:

config (dict[str, Any])

euclid_dsps.workflows.core.run_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

DataFrame

euclid_dsps.workflows.core.fit_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

euclid_dsps.workflows.core.sample_one(config, out_dir)[source]
Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

Return type:

None

euclid_dsps.workflows.core.sample_batch(config, out_dir, limit=5, batch_size=1, row_indices_file=None)[source]

Sample independent galaxy posteriors with NumPyro NUTS.

This intentionally runs one galaxy at a time; HMC/NUTS is for posterior density checks on small subsets, while Adam/MAP remains the full-catalog path.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.core.fit_workflow(config, out_dir, limit=1000, batch_size=64, hmc_n=20, hmc_batch_size=1, population_batch_size=None, hmc_select='stratified', seed=42)[source]

Run MAP batch, HMC subset, population MAP, and comparison reports.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • hmc_n (int)

  • hmc_batch_size (int)

  • population_batch_size (int | None)

  • hmc_select (str)

  • seed (int)

Return type:

None

euclid_dsps.workflows.core.report_workflow(config, run_dir)[source]

Regenerate workflow comparison reports from existing workflow outputs.

Parameters:
  • config (dict[str, Any])

  • run_dir (str | Path)

Return type:

None

euclid_dsps.workflows.core.run_batch(config, out_dir, limit=None, batch_size=10000, row_indices_file=None)[source]

Run the same configured DSPS model over many catalog rows.

This is intentionally conservative: it writes a flat comparison table and supports per-row physical parameters through model.parameter_columns.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.core.fit_batch(config, out_dir, limit=25, batch_size=1000, row_indices_file=None)[source]

Fit the configured free parameters for many rows.

The default path optimizes each parquet chunk with one JAX-vmapped Adam run.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

Return type:

None

euclid_dsps.workflows.core.fit_population(config, out_dir, limit=25, batch_size=256, row_indices_file=None, map_init_file=None)[source]

Fit chunked hierarchical population MAP models with JAX-vmapped Adam.

Parameters:
  • config (dict[str, Any])

  • out_dir (str | Path)

  • limit (int | None)

  • batch_size (int)

  • row_indices_file (str | None)

  • map_init_file (str | None)

Return type:

None

Reporting

EDA and run reporting.

euclid_dsps.reporting.core.configure_plot_style()[source]

Apply project-wide, publication-style matplotlib defaults.

Return type:

None

euclid_dsps.reporting.core.write_eda_outputs(df, band_configs, out_dir, redshift_config=None)[source]
Parameters:
  • df (DataFrame)

  • band_configs (list[dict[str, Any]])

  • out_dir (str | Path)

  • redshift_config (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.core.write_run_outputs(observation, result, out_dir, *, ground_truth_sed=None, include_filters=True)[source]
Parameters:
Return type:

DataFrame

euclid_dsps.reporting.core.write_sed_diagnostic_outputs(observation, result, out_dir, *, stem, ground_truth_sed=None, include_filters=True)[source]

Write one rich SED diagnostic: DSPS SED, optional COSMOS proxy, filters, photometry.

Parameters:
Return type:

dict[str, Any]

euclid_dsps.reporting.core.write_fit_outputs(fit_result, out_dir)[source]
Parameters:
  • fit_result (Any)

  • out_dir (str | Path)

Return type:

None

euclid_dsps.reporting.core.write_mcmc_outputs(mcmc_result, out_dir, truth_values=None)[source]
Parameters:
  • mcmc_result (Any)

  • out_dir (str | Path)

  • truth_values (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.core.write_mcmc_batch_outputs(summary, predictive, diagnostics, out_dir)[source]
Parameters:
  • summary (DataFrame)

  • predictive (DataFrame)

  • diagnostics (DataFrame)

  • out_dir (str | Path)

Return type:

None

euclid_dsps.reporting.core.write_population_corner_outputs(fits, free_parameters, out_dir, config=None)[source]

Write population-level MAP point-estimate distributions.

Parameters:
  • fits (DataFrame)

  • free_parameters (list[str])

  • out_dir (str | Path)

  • config (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.core.plot_population_parameter_histograms(params, path, truth=None)[source]
Parameters:
  • params (DataFrame)

  • path (str | Path)

  • truth (DataFrame | None)

Return type:

None

euclid_dsps.reporting.core.parameter_truth_metrics(frame, config=None)[source]

Summarize paired inferred-vs-truth parameter errors.

Parameters:
  • frame (DataFrame)

  • config (dict[str, Any] | None)

Return type:

DataFrame

euclid_dsps.reporting.core.write_trace_truth_outputs(trace, out_dir, label, make_plots=True)[source]
Parameters:
  • trace (DataFrame)

  • out_dir (str | Path)

  • label (str)

  • make_plots (bool)

Return type:

None

euclid_dsps.reporting.core.trace_truth_summary(trace)[source]
Parameters:

trace (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.core.plot_trace_truth_metrics(trace, path)[source]
Parameters:
  • trace (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.write_batch_outputs(comparison, out_dir, label='batch', reporting_level='full', config=None)[source]

Write aggregate tables and plots for multi-galaxy runs.

Parameters:
  • comparison (DataFrame)

  • out_dir (str | Path)

  • label (str)

  • reporting_level (str)

  • config (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.core.write_fit_diagnostic_outputs(fits, comparison, config, out_dir, label='batch_fit', hyperparameters=None)[source]

Write fit audit tables that protect scientific interpretation.

Parameters:
  • fits (DataFrame)

  • comparison (DataFrame)

  • config (dict[str, Any])

  • out_dir (str | Path)

  • label (str)

  • hyperparameters (DataFrame | None)

Return type:

None

euclid_dsps.reporting.core.fit_parameter_audit(fits, config)[source]

Summarize whether reported fit columns were truly inferred.

Parameters:
  • fits (DataFrame)

  • config (dict[str, Any])

Return type:

DataFrame

euclid_dsps.reporting.core.fit_objective_components(fits, comparison, config, hyperparameters=None)[source]

Post-hoc objective decomposition from saved MAP rows.

Parameters:
  • fits (DataFrame)

  • comparison (DataFrame)

  • config (dict[str, Any])

  • hyperparameters (DataFrame | None)

Return type:

DataFrame

euclid_dsps.reporting.core.plot_population_bias_heatmap(by_row, path)[source]

Plot a heatmap of reduced chi2 in the Redshift-Mass plane.

Parameters:
  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_color_redshift_diagnostics(comparison, by_row, path)[source]

Plot broad-band color-redshift diagnostics, POP-COSMOS style.

Parameters:
  • comparison (DataFrame)

  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_physical_population_diagnostics(by_row, path)[source]

Plot fitted/proxy physical relations in redshift bins.

Parameters:
  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.summarize_by_band(valid)[source]
Parameters:

valid (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.core.summarize_by_row(valid)[source]
Parameters:

valid (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.core.residuals_by_property(by_row)[source]

Summarize row residuals against catalog/fit properties.

Parameters:

by_row (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.core.redshift_attractor_summary(by_row, bin_width=0.05, min_count=5, max_modes=30)[source]

Summarize repeated fitted-redshift modes from MAP output.

Parameters:
  • by_row (DataFrame)

  • bin_width (float)

  • min_count (int)

  • max_modes (int)

Return type:

DataFrame

euclid_dsps.reporting.core.plot_flux_distributions(df, columns, path)[source]
Parameters:
  • df (DataFrame)

  • columns (list[str])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_color_distributions(df, columns, path)[source]
Parameters:
  • df (DataFrame)

  • columns (list[str])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_redshift_distributions(df, redshift_config, path)[source]
Parameters:
  • df (DataFrame)

  • redshift_config (dict[str, Any])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_physical_parameters_distributions(df, path)[source]
Parameters:
  • df (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_sed(result, path)[source]
Parameters:
Return type:

None

euclid_dsps.reporting.core.plot_sed_diagnostic(result, path, *, observation=None, ground_truth_sed=None, include_filters=True)[source]

Plot DSPS SED, COSMOS proxy SED, and model-anchored photometry residuals.

Parameters:
Return type:

None

euclid_dsps.reporting.core.plot_photometry_comparison(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_fit_trace(trace, path)[source]
Parameters:
  • trace (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.write_posterior_predictive(mcmc_result, path)[source]
Parameters:
  • mcmc_result (Any)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_mcmc_traces(samples, path)[source]
Parameters:
  • samples (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_corner(samples, path)[source]
Parameters:
  • samples (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.posterior_comparable_frame(samples, derived, truth_values)[source]

Build posterior columns that have like-for-like truth/proxy values.

Parameters:
  • samples (DataFrame)

  • derived (DataFrame)

  • truth_values (dict[str, Any])

Return type:

DataFrame

euclid_dsps.reporting.core.plot_corner_with_truth(samples, truth_values, path)[source]
Parameters:
  • samples (DataFrame)

  • truth_values (dict[str, Any])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_posterior_predictive(mcmc_result, path)[source]
Parameters:
  • mcmc_result (Any)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_posterior_intervals(summary, path)[source]
Parameters:
  • summary (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_posterior_predictive(predictive, path)[source]
Parameters:
  • predictive (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_mcmc_diagnostics(diagnostics, path)[source]
Parameters:
  • diagnostics (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.write_workflow_comparison(map_fits, population_fits, hmc_summary, hmc_diagnostics, free_parameters, out_dir, hmc_samples=None)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • hmc_summary (DataFrame)

  • hmc_diagnostics (DataFrame)

  • free_parameters (list[str])

  • out_dir (str | Path)

  • hmc_samples (DataFrame | None)

Return type:

None

euclid_dsps.reporting.core.workflow_parameter_comparison(map_fits, population_fits, free_parameters)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • free_parameters (list[str])

Return type:

DataFrame

euclid_dsps.reporting.core.workflow_fit_comparison(map_fits, population_fits)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.core.workflow_hmc_comparison(map_fits, population_fits, hmc_summary, free_parameters)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • hmc_summary (DataFrame)

  • free_parameters (list[str])

Return type:

DataFrame

euclid_dsps.reporting.core.plot_workflow_parameter_corners(map_fits, population_fits, hmc_summary, hmc_samples, free_parameters, out)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • hmc_summary (DataFrame)

  • hmc_samples (DataFrame | None)

  • free_parameters (list[str])

  • out (Path)

Return type:

None

euclid_dsps.reporting.core.paired_fit_truth_frames(fits, config=None)[source]

Return aligned frames for parameters with both fit_ and truth_ columns.

Parameters:
  • fits (DataFrame)

  • config (dict[str, Any] | None)

Return type:

tuple[DataFrame, DataFrame]

euclid_dsps.reporting.core.plot_corner_overlay(inferred, truth, path)[source]
Parameters:
  • inferred (DataFrame)

  • truth (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_map_population_parameters(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_map_population_chi2(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_hmc_map_population(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_dashboard(valid, by_row, path)[source]
Parameters:
  • valid (DataFrame)

  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_residuals_by_band(valid, path)[source]
Parameters:
  • valid (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_observed_vs_model(valid, path)[source]
Parameters:
  • valid (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_redshift_truth(by_row, path)[source]
Parameters:
  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_redshift_attractors(by_row, attractors, path)[source]
Parameters:
  • by_row (DataFrame)

  • attractors (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_batch_parameter_truth(by_row, path, config=None)[source]
Parameters:
  • by_row (DataFrame)

  • path (str | Path)

  • config (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.core.plot_residuals_by_property(by_row, path)[source]
Parameters:
  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.core.plot_residual_boxplot(valid, ax)[source]
Parameters:
  • valid (DataFrame)

  • ax (matplotlib.pyplot.Axes)

Return type:

None

euclid_dsps.reporting.core.plot_observed_model_scatter(valid, ax)[source]
Parameters:
  • valid (DataFrame)

  • ax (matplotlib.pyplot.Axes)

Return type:

None

euclid_dsps.reporting.core.plot_redshift_scatter(by_row, ax)[source]
Parameters:
  • by_row (DataFrame)

  • ax (matplotlib.pyplot.Axes)

Return type:

None

euclid_dsps.reporting.core.ordered_bands(df)[source]
Parameters:

df (DataFrame)

Return type:

list[str]

EDA reporting entry points.

euclid_dsps.reporting.eda.plot_color_distributions(df, columns, path)[source]
Parameters:
  • df (DataFrame)

  • columns (list[str])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.eda.plot_flux_distributions(df, columns, path)[source]
Parameters:
  • df (DataFrame)

  • columns (list[str])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.eda.plot_physical_parameters_distributions(df, path)[source]
Parameters:
  • df (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.eda.plot_redshift_distributions(df, redshift_config, path)[source]
Parameters:
  • df (DataFrame)

  • redshift_config (dict[str, Any])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.eda.plot_residuals_by_property(by_row, path)[source]
Parameters:
  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.eda.residuals_by_property(by_row)[source]

Summarize row residuals against catalog/fit properties.

Parameters:

by_row (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.eda.write_eda_outputs(df, band_configs, out_dir, redshift_config=None)[source]
Parameters:
  • df (DataFrame)

  • band_configs (list[dict[str, Any]])

  • out_dir (str | Path)

  • redshift_config (dict[str, Any] | None)

Return type:

None

Forward-model reporting entry points.

euclid_dsps.reporting.forward.ordered_bands(df)[source]
Parameters:

df (DataFrame)

Return type:

list[str]

euclid_dsps.reporting.forward.plot_batch_dashboard(valid, by_row, path)[source]
Parameters:
  • valid (DataFrame)

  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.forward.plot_batch_observed_vs_model(valid, path)[source]
Parameters:
  • valid (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.forward.plot_batch_parameter_truth(by_row, path, config=None)[source]
Parameters:
  • by_row (DataFrame)

  • path (str | Path)

  • config (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.forward.plot_batch_redshift_truth(by_row, path)[source]
Parameters:
  • by_row (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.forward.plot_batch_residuals_by_band(valid, path)[source]
Parameters:
  • valid (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.forward.plot_observed_model_scatter(valid, ax)[source]
Parameters:
  • valid (DataFrame)

  • ax (matplotlib.pyplot.Axes)

Return type:

None

euclid_dsps.reporting.forward.plot_photometry_comparison(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.forward.plot_redshift_scatter(by_row, ax)[source]
Parameters:
  • by_row (DataFrame)

  • ax (matplotlib.pyplot.Axes)

Return type:

None

euclid_dsps.reporting.forward.plot_residual_boxplot(valid, ax)[source]
Parameters:
  • valid (DataFrame)

  • ax (matplotlib.pyplot.Axes)

Return type:

None

euclid_dsps.reporting.forward.plot_sed(result, path)[source]
Parameters:
Return type:

None

euclid_dsps.reporting.forward.summarize_by_band(valid)[source]
Parameters:

valid (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.forward.summarize_by_row(valid)[source]
Parameters:

valid (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.forward.write_batch_outputs(comparison, out_dir, label='batch', reporting_level='full', config=None)[source]

Write aggregate tables and plots for multi-galaxy runs.

Parameters:
  • comparison (DataFrame)

  • out_dir (str | Path)

  • label (str)

  • reporting_level (str)

  • config (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.forward.write_run_outputs(observation, result, out_dir, *, ground_truth_sed=None, include_filters=True)[source]
Parameters:
Return type:

DataFrame

Reporting helpers for COSMOS-template pseudo-SED diagnostics.

euclid_dsps.reporting.cosmos.plot_cosmos_sed_example(result, path)[source]

Plot one reconstructed COSMOS proxy SED.

Parameters:
Return type:

None

euclid_dsps.reporting.cosmos.plot_cosmos_sed_sample_set(results, path, max_seds=12, comparisons=None)[source]

Plot sampled SEDs as row-wise COSMOS-vs-DSPS grids when available.

Parameters:
  • results (list[CosmosSedResult])

  • path (str | Path)

  • max_seds (int)

  • comparisons (list[DataFrame] | None)

Return type:

None

euclid_dsps.reporting.cosmos.plot_template_pair_heatmap(diagnostics, path)[source]

Plot frequency of sed_cosmos_1 / sed_cosmos_2 template pairs.

Parameters:
  • diagnostics (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.plot_fraction_diagnostics(diagnostics, path)[source]

Plot component fraction distribution and alpha relation.

Parameters:
  • diagnostics (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.plot_synthetic_vs_catalog_abs_flux(frame, path)[source]

Plot synthetic normalized absolute flux versus catalog absolute flux.

Parameters:
  • frame (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.plot_cosmos_dsps_rest_comparison(comparison, path, row_index)[source]

Plot COSMOS proxy and DSPS rest SED comparison for one row.

Parameters:
  • comparison (DataFrame)

  • path (str | Path)

  • row_index (int)

Return type:

None

euclid_dsps.reporting.cosmos.plot_branch1_metric_summary(metrics, path)[source]

Plot rest-frame SED RMS residuals by color kind.

Parameters:
  • metrics (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.plot_rest_color_residuals(metrics, path)[source]

Plot DSPS-COSMOS Euclid rest-color residuals.

Parameters:
  • metrics (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.plot_branch1_residual_heatmap(metrics, path)[source]

Plot median rest-SED RMS residual by redshift bin and color kind.

Parameters:
  • metrics (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.plot_worst_sed_grid(metrics, comparison, path, n=16)[source]

Plot the worst COSMOS-vs-DSPS SED overlays by RMS log residual.

Parameters:
  • metrics (DataFrame)

  • comparison (DataFrame)

  • path (str | Path)

  • n (int)

Return type:

None

euclid_dsps.reporting.cosmos.plot_observed_flux_residuals(frame, path)[source]

Plot branch-2 residuals by band and target set with robust clipping.

Parameters:
  • frame (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.plot_population_validation_summary(summary, path)[source]

Plot grouped population-validation medians from summary CSV rows.

Parameters:
  • summary (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.cosmos.write_cosmos_output_manifest(out_dir, files)[source]

Write lightweight manifest for generated COSMOS SED artifacts.

Parameters:
  • out_dir (str | Path)

  • files (list[str])

Return type:

None

MAP and population fitting report entry points.

euclid_dsps.reporting.fit.paired_fit_truth_frames(fits, config=None)[source]

Return aligned frames for parameters with both fit_ and truth_ columns.

Parameters:
  • fits (DataFrame)

  • config (dict[str, Any] | None)

Return type:

tuple[DataFrame, DataFrame]

euclid_dsps.reporting.fit.parameter_truth_metrics(frame, config=None)[source]

Summarize paired inferred-vs-truth parameter errors.

Parameters:
  • frame (DataFrame)

  • config (dict[str, Any] | None)

Return type:

DataFrame

euclid_dsps.reporting.fit.plot_corner_overlay(inferred, truth, path)[source]
Parameters:
  • inferred (DataFrame)

  • truth (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.fit.plot_fit_trace(trace, path)[source]
Parameters:
  • trace (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.fit.plot_map_population_chi2(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.fit.plot_map_population_parameters(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.fit.plot_population_parameter_histograms(params, path, truth=None)[source]
Parameters:
  • params (DataFrame)

  • path (str | Path)

  • truth (DataFrame | None)

Return type:

None

euclid_dsps.reporting.fit.plot_trace_truth_metrics(trace, path)[source]
Parameters:
  • trace (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.fit.trace_truth_summary(trace)[source]
Parameters:

trace (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.fit.workflow_fit_comparison(map_fits, population_fits)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

Return type:

DataFrame

euclid_dsps.reporting.fit.write_fit_diagnostic_outputs(fits, comparison, config, out_dir, label='batch_fit', hyperparameters=None)[source]

Write fit audit tables that protect scientific interpretation.

Parameters:
  • fits (DataFrame)

  • comparison (DataFrame)

  • config (dict[str, Any])

  • out_dir (str | Path)

  • label (str)

  • hyperparameters (DataFrame | None)

Return type:

None

euclid_dsps.reporting.fit.write_fit_outputs(fit_result, out_dir)[source]
Parameters:
  • fit_result (Any)

  • out_dir (str | Path)

Return type:

None

euclid_dsps.reporting.fit.write_population_corner_outputs(fits, free_parameters, out_dir, config=None)[source]

Write population-level MAP point-estimate distributions.

Parameters:
  • fits (DataFrame)

  • free_parameters (list[str])

  • out_dir (str | Path)

  • config (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.fit.write_trace_truth_outputs(trace, out_dir, label, make_plots=True)[source]
Parameters:
  • trace (DataFrame)

  • out_dir (str | Path)

  • label (str)

  • make_plots (bool)

Return type:

None

Posterior-sampling report entry points.

euclid_dsps.reporting.posterior.plot_batch_mcmc_diagnostics(diagnostics, path)[source]
Parameters:
  • diagnostics (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.plot_batch_posterior_intervals(summary, path)[source]
Parameters:
  • summary (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.plot_batch_posterior_predictive(predictive, path)[source]
Parameters:
  • predictive (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.plot_corner(samples, path)[source]
Parameters:
  • samples (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.plot_corner_with_truth(samples, truth_values, path)[source]
Parameters:
  • samples (DataFrame)

  • truth_values (dict[str, Any])

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.plot_hmc_map_population(comparison, path)[source]
Parameters:
  • comparison (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.plot_mcmc_traces(samples, path)[source]
Parameters:
  • samples (DataFrame)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.plot_posterior_predictive(mcmc_result, path)[source]
Parameters:
  • mcmc_result (Any)

  • path (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.posterior_comparable_frame(samples, derived, truth_values)[source]

Build posterior columns that have like-for-like truth/proxy values.

Parameters:
  • samples (DataFrame)

  • derived (DataFrame)

  • truth_values (dict[str, Any])

Return type:

DataFrame

euclid_dsps.reporting.posterior.workflow_hmc_comparison(map_fits, population_fits, hmc_summary, free_parameters)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • hmc_summary (DataFrame)

  • free_parameters (list[str])

Return type:

DataFrame

euclid_dsps.reporting.posterior.write_mcmc_batch_outputs(summary, predictive, diagnostics, out_dir)[source]
Parameters:
  • summary (DataFrame)

  • predictive (DataFrame)

  • diagnostics (DataFrame)

  • out_dir (str | Path)

Return type:

None

euclid_dsps.reporting.posterior.write_mcmc_outputs(mcmc_result, out_dir, truth_values=None)[source]
Parameters:
  • mcmc_result (Any)

  • out_dir (str | Path)

  • truth_values (dict[str, Any] | None)

Return type:

None

euclid_dsps.reporting.posterior.write_posterior_predictive(mcmc_result, path)[source]
Parameters:
  • mcmc_result (Any)

  • path (str | Path)

Return type:

None

Composite workflow report entry points.

euclid_dsps.reporting.workflow.plot_workflow_parameter_corners(map_fits, population_fits, hmc_summary, hmc_samples, free_parameters, out)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • hmc_summary (DataFrame)

  • hmc_samples (DataFrame | None)

  • free_parameters (list[str])

  • out (Path)

Return type:

None

euclid_dsps.reporting.workflow.workflow_parameter_comparison(map_fits, population_fits, free_parameters)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • free_parameters (list[str])

Return type:

DataFrame

euclid_dsps.reporting.workflow.write_workflow_comparison(map_fits, population_fits, hmc_summary, hmc_diagnostics, free_parameters, out_dir, hmc_samples=None)[source]
Parameters:
  • map_fits (DataFrame)

  • population_fits (DataFrame)

  • hmc_summary (DataFrame)

  • hmc_diagnostics (DataFrame)

  • free_parameters (list[str])

  • out_dir (str | Path)

  • hmc_samples (DataFrame | None)

Return type:

None

Compatibility Facades

Compatibility facade for workflow functions.

New code should import from euclid_dsps.workflows.

Compatibility facade for reporting functions.

New code should import from euclid_dsps.reporting.