firecrown.app.examples

Example generators for Firecrown analyses.

Provides ready-to-use example generators for different cosmological analyses. Each example creates complete analysis setups including data files, factory files, and framework-specific configurations.

Attributes

EXAMPLES_LIST

Registry of available example generators.

Classes

ExampleCosmicShear

Cosmic shear analysis example with synthetic data.

ExampleSupernovaSRD

Supernova SRD analysis example.

ExampleDESY13x2pt

DES Y1 3x2pt analysis example.

DESY1FactoryType

Available factory implementations for DES Y1 3x2pt analysis.

Package Contents

class firecrown.app.examples.ExampleCosmicShear

Bases: firecrown.app.analysis.AnalysisBuilder

Inheritance diagram of firecrown.app.examples.ExampleCosmicShear

Cosmic shear analysis example with synthetic data.

Generates synthetic weak lensing data with configurable tomographic bins, multipole ranges, and noise levels for testing analysis pipelines.

description: ClassVar[str] = 'Weak lensing cosmic shear analysis with synthetic galaxy data'

Human-readable description of what this analysis demonstrates.

prefix: Annotated[str, typer.Option(help="Prefix for generated filenames (e.g., 'cosmic_shear' creates 'cosmic_shear.sacc')", show_default=True)] = 'cosmic_shear'
seed: Annotated[int, typer.Option(help='Random seed for reproducible synthetic data generation', show_default=True)] = 42
n_bins: Annotated[int, typer.Option(help='Number of tomographic redshift bins', show_default=True)] = 2
z_max: Annotated[float, typer.Option(help='Maximum redshift for n(z) distributions', show_default=True)] = 2.0
n_z_points: Annotated[int, typer.Option(help='Number of redshift points for n(z) sampling', show_default=True)] = 600
ell_min: Annotated[float, typer.Option(help='Minimum multipole for power spectrum', show_default=True)] = 10.0
ell_max: Annotated[float, typer.Option(help='Maximum multipole for power spectrum', show_default=True)] = 10000.0
n_ell_points: Annotated[int, typer.Option(help='Number of multipole points for power spectrum', show_default=True)] = 10
noise_level: Annotated[float, typer.Option(help='Relative noise level for synthetic data', show_default=True)] = 0.01
sigma_z: Annotated[float, typer.Option(help='Width of Gaussian redshift distributions', show_default=True)] = 0.25
generate_sacc(output_path)

Generate synthetic cosmic shear data in SACC format.

Creates SACC file with tomographic bins, power spectra, and covariance.

Parameters:

output_path (pathlib.Path) – Output directory

Returns:

Path to generated SACC file

Return type:

pathlib.Path

generate_factory(output_path, _sacc)

Copy cosmic shear factory template.

Parameters:
  • output_path (pathlib.Path) – Output directory

  • _sacc (pathlib.Path) – SACC file path (unused)

Returns:

Path to factory file

Return type:

pathlib.Path

get_build_parameters(sacc_path)

Return SACC file path for likelihood construction.

Parameters:

sacc_path (pathlib.Path)

Return type:

firecrown.likelihood.NamedParameters

get_models()

Define photo-z shift parameters for each tomographic bin.

Returns:

Model with delta_z parameters for all bins

Return type:

list[firecrown.app.analysis.Model]

required_cosmology()

Return cosmology requirement level.

get_options_desc()

Return description of Cosmic Shear options.

Return type:

Sequence[tuple[str, str]]

class firecrown.app.examples.ExampleSupernovaSRD

Bases: firecrown.app.analysis.AnalysisBuilder

Inheritance diagram of firecrown.app.examples.ExampleSupernovaSRD

Supernova SRD analysis example.

Downloads LSST DESC SRD Year 1 supernova data and generates framework configurations for distance modulus fitting.

description: ClassVar[str] = 'Supernova SRD analysis with LSST DESC synthetic data'

Human-readable description of what this analysis demonstrates.

data_url: ClassVar[str] = 'https://github.com/LSSTDESC/firecrown/releases/download/files-v1.0.0/srd-y1.sacc'
prefix: Annotated[str, typer.Option(help="Prefix for generated filenames (e.g., 'sn_srd' creates 'sn_srd.sacc')", show_default=True)] = 'sn_srd'
generate_sacc(output_path)

Download supernova SRD data from LSST DESC repository.

Parameters:

output_path (pathlib.Path) – Output directory

Returns:

Path to downloaded SACC file

Return type:

pathlib.Path

generate_factory(output_path, _sacc)

Copy supernova factory template.

Parameters:
  • output_path (pathlib.Path) – Output directory

  • _sacc (pathlib.Path) – SACC file path (unused)

Returns:

Path to factory file

Return type:

pathlib.Path

get_build_parameters(sacc_path)

Return SACC file path for likelihood construction.

Returns:

Named parameters with sacc_file path

Parameters:

sacc_path (pathlib.Path)

Return type:

firecrown.likelihood.NamedParameters

get_models()

Define supernova absolute magnitude parameter.

Returns:

Single model with M parameter

Return type:

list[firecrown.app.analysis.Model]

required_cosmology()

Return cosmology requirement level.

cosmology_analysis_spec()

Return the cosmology analysis specification.

Returns:

The cosmology analysis specification

Return type:

firecrown.app.analysis.CCLCosmologySpec

class firecrown.app.examples.ExampleDESY13x2pt

Bases: firecrown.app.analysis.AnalysisBuilder

Inheritance diagram of firecrown.app.examples.ExampleDESY13x2pt

DES Y1 3x2pt analysis example.

Downloads real DES Y1 3x2pt data (cosmic shear, galaxy-galaxy lensing, galaxy clustering) and generates framework configurations.

description: ClassVar[str] = 'DES Y1 3x2pt analysis with cosmic shear, galaxy-galaxy lensing, and galaxy clustering'

Human-readable description of what this analysis demonstrates.

data_url: ClassVar[str] = 'https://github.com/LSSTDESC/firecrown/releases/download/files-v1.1.0/des_y1_3x2pt.sacc'
prefix: Annotated[str, typer.Option(help="Prefix for generated filenames (e.g., 'des_y1_3x2pt' creates 'des_y1_3x2pt.sacc')", show_default=True)] = 'des_y1_3x2pt'
factory_type: Annotated[DESY1FactoryType, typer.Option(help=FACTORY_TYPE_HELP, show_default=True, case_sensitive=False, rich_help_panel='Factory Options', metavar='FACTORY_TYPE')]
generate_sacc(output_path)

Download DES Y1 3x2pt data from LSST DESC repository.

Parameters:

output_path (pathlib.Path) – Output directory

Returns:

Path to downloaded SACC file

Return type:

pathlib.Path

generate_factory(output_path, sacc)

Copy DES Y1 3x2pt factory template or generate YAML config.

Parameters:
  • output_path (pathlib.Path) – Output directory

  • sacc (pathlib.Path) – SACC file path (unused)

Returns:

Path to factory file or YAML config

Return type:

str | pathlib.Path

get_build_parameters(sacc_path)

Return build parameters for likelihood construction.

Parameters:

sacc_path (pathlib.Path) – Path to the SACC data file

Returns:

Named parameters with sacc_file and optional config path

Return type:

firecrown.likelihood.NamedParameters

get_models()

Define DES Y1 systematic and bias parameters.

Returns:

Model with IA, photo-z, bias, and multiplicative bias parameters

Return type:

list[firecrown.app.analysis.Model]

required_cosmology()

Cosmology requirement level.

get_options_desc()

Return description of DES Y1 3x2pt options.

Return type:

Sequence[tuple[str, str]]

class firecrown.app.examples.DESY1FactoryType

Bases: enum.StrEnum

Inheritance diagram of firecrown.app.examples.DESY1FactoryType

Available factory implementations for DES Y1 3x2pt analysis.

STANDARD = 'standard'
PT = 'pt'
TATT = 'tatt'
HMIA = 'hmia'
PK_MODIFIER = 'pk_modifier'
YAML_DEFAULT = 'yaml_default'
YAML_PURE_CCL = 'yaml_pure_ccl'
YAML_MU_SIGMA = 'yaml_mu_sigma'
firecrown.app.examples.EXAMPLES_LIST: dict[str, type[firecrown.app.analysis.AnalysisBuilder]]

Registry of available example generators.

Maps CLI-friendly names to generator classes. Add new examples here to make them discoverable via the command-line interface.