firecrown.app.examples ====================== .. py:module:: firecrown.app.examples .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: firecrown.app.examples.EXAMPLES_LIST Classes ------- .. autoapisummary:: firecrown.app.examples.ExampleCosmicShear firecrown.app.examples.ExampleSupernovaSRD firecrown.app.examples.ExampleDESY13x2pt firecrown.app.examples.DESY1FactoryType Package Contents ---------------- .. py:class:: ExampleCosmicShear Bases: :py:obj:`firecrown.app.analysis.AnalysisBuilder` .. autoapi-inheritance-diagram:: firecrown.app.examples.ExampleCosmicShear :parts: 1 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. .. py:attribute:: description :type: ClassVar[str] :value: 'Weak lensing cosmic shear analysis with synthetic galaxy data' Human-readable description of what this analysis demonstrates. .. py:attribute:: prefix :type: Annotated[str, typer.Option(help="Prefix for generated filenames (e.g., 'cosmic_shear' creates 'cosmic_shear.sacc')", show_default=True)] :value: 'cosmic_shear' .. py:attribute:: seed :type: Annotated[int, typer.Option(help='Random seed for reproducible synthetic data generation', show_default=True)] :value: 42 .. py:attribute:: n_bins :type: Annotated[int, typer.Option(help='Number of tomographic redshift bins', show_default=True)] :value: 2 .. py:attribute:: z_max :type: Annotated[float, typer.Option(help='Maximum redshift for n(z) distributions', show_default=True)] :value: 2.0 .. py:attribute:: n_z_points :type: Annotated[int, typer.Option(help='Number of redshift points for n(z) sampling', show_default=True)] :value: 600 .. py:attribute:: ell_min :type: Annotated[float, typer.Option(help='Minimum multipole for power spectrum', show_default=True)] :value: 10.0 .. py:attribute:: ell_max :type: Annotated[float, typer.Option(help='Maximum multipole for power spectrum', show_default=True)] :value: 10000.0 .. py:attribute:: n_ell_points :type: Annotated[int, typer.Option(help='Number of multipole points for power spectrum', show_default=True)] :value: 10 .. py:attribute:: noise_level :type: Annotated[float, typer.Option(help='Relative noise level for synthetic data', show_default=True)] :value: 0.01 .. py:attribute:: sigma_z :type: Annotated[float, typer.Option(help='Width of Gaussian redshift distributions', show_default=True)] :value: 0.25 .. py:method:: generate_sacc(output_path) Generate synthetic cosmic shear data in SACC format. Creates SACC file with tomographic bins, power spectra, and covariance. :param output_path: Output directory :return: Path to generated SACC file .. py:method:: generate_factory(output_path, _sacc) Copy cosmic shear factory template. :param output_path: Output directory :param _sacc: SACC file path (unused) :return: Path to factory file .. py:method:: get_build_parameters(sacc_path) Return SACC file path for likelihood construction. .. py:method:: get_models() Define photo-z shift parameters for each tomographic bin. :return: Model with delta_z parameters for all bins .. py:method:: required_cosmology() Return cosmology requirement level. .. py:method:: get_options_desc() Return description of Cosmic Shear options. .. py:class:: ExampleSupernovaSRD Bases: :py:obj:`firecrown.app.analysis.AnalysisBuilder` .. autoapi-inheritance-diagram:: firecrown.app.examples.ExampleSupernovaSRD :parts: 1 Supernova SRD analysis example. Downloads LSST DESC SRD Year 1 supernova data and generates framework configurations for distance modulus fitting. .. py:attribute:: description :type: ClassVar[str] :value: 'Supernova SRD analysis with LSST DESC synthetic data' Human-readable description of what this analysis demonstrates. .. py:attribute:: data_url :type: ClassVar[str] :value: 'https://github.com/LSSTDESC/firecrown/releases/download/files-v1.0.0/srd-y1.sacc' .. py:attribute:: prefix :type: Annotated[str, typer.Option(help="Prefix for generated filenames (e.g., 'sn_srd' creates 'sn_srd.sacc')", show_default=True)] :value: 'sn_srd' .. py:method:: generate_sacc(output_path) Download supernova SRD data from LSST DESC repository. :param output_path: Output directory :return: Path to downloaded SACC file .. py:method:: generate_factory(output_path, _sacc) Copy supernova factory template. :param output_path: Output directory :param _sacc: SACC file path (unused) :return: Path to factory file .. py:method:: get_build_parameters(sacc_path) Return SACC file path for likelihood construction. :return: Named parameters with sacc_file path .. py:method:: get_models() Define supernova absolute magnitude parameter. :return: Single model with M parameter .. py:method:: required_cosmology() Return cosmology requirement level. .. py:method:: cosmology_analysis_spec() Return the cosmology analysis specification. :return: The cosmology analysis specification .. py:class:: ExampleDESY13x2pt Bases: :py:obj:`firecrown.app.analysis.AnalysisBuilder` .. autoapi-inheritance-diagram:: firecrown.app.examples.ExampleDESY13x2pt :parts: 1 DES Y1 3x2pt analysis example. Downloads real DES Y1 3x2pt data (cosmic shear, galaxy-galaxy lensing, galaxy clustering) and generates framework configurations. .. py:attribute:: description :type: ClassVar[str] :value: 'DES Y1 3x2pt analysis with cosmic shear, galaxy-galaxy lensing, and galaxy clustering' Human-readable description of what this analysis demonstrates. .. py:attribute:: data_url :type: ClassVar[str] :value: 'https://github.com/LSSTDESC/firecrown/releases/download/files-v1.1.0/des_y1_3x2pt.sacc' .. py:attribute:: prefix :type: Annotated[str, typer.Option(help="Prefix for generated filenames (e.g., 'des_y1_3x2pt' creates 'des_y1_3x2pt.sacc')", show_default=True)] :value: 'des_y1_3x2pt' .. py:attribute:: factory_type :type: Annotated[DESY1FactoryType, typer.Option(help=FACTORY_TYPE_HELP, show_default=True, case_sensitive=False, rich_help_panel='Factory Options', metavar='FACTORY_TYPE')] .. py:method:: generate_sacc(output_path) Download DES Y1 3x2pt data from LSST DESC repository. :param output_path: Output directory :return: Path to downloaded SACC file .. py:method:: generate_factory(output_path, sacc) Copy DES Y1 3x2pt factory template or generate YAML config. :param output_path: Output directory :param sacc: SACC file path (unused) :return: Path to factory file or YAML config .. py:method:: get_build_parameters(sacc_path) Return build parameters for likelihood construction. :param sacc_path: Path to the SACC data file :return: Named parameters with sacc_file and optional config path .. py:method:: get_models() Define DES Y1 systematic and bias parameters. :return: Model with IA, photo-z, bias, and multiplicative bias parameters .. py:method:: required_cosmology() Cosmology requirement level. .. py:method:: get_options_desc() Return description of DES Y1 3x2pt options. .. py:class:: DESY1FactoryType Bases: :py:obj:`enum.StrEnum` .. autoapi-inheritance-diagram:: firecrown.app.examples.DESY1FactoryType :parts: 1 Available factory implementations for DES Y1 3x2pt analysis. .. py:attribute:: STANDARD :value: 'standard' .. py:attribute:: PT :value: 'pt' .. py:attribute:: TATT :value: 'tatt' .. py:attribute:: HMIA :value: 'hmia' .. py:attribute:: PK_MODIFIER :value: 'pk_modifier' .. py:attribute:: YAML_DEFAULT :value: 'yaml_default' .. py:attribute:: YAML_PURE_CCL :value: 'yaml_pure_ccl' .. py:attribute:: YAML_MU_SIGMA :value: 'yaml_mu_sigma' .. py:data:: EXAMPLES_LIST :type: 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.