streamobs.background.catalog_injector module#
Full-injection background pipeline using known catalogs.
- class streamobs.background.catalog_injector.BackgroundCatalogInjector(survey, **kwargs)[source]#
Bases:
objectThin wrapper around
StreamInjectorfor background catalog injection.Exposes
inject_stars()andinject_galaxies()so the caller does not need to passsource_typeexplicitly. All injection logic lives inStreamInjector.- Parameters:
survey (Survey or list of Survey) – Survey (or surveys, for multi-survey injection) to inject into. Passed through to
StreamInjector, which handles both forms; with multiple surveys the output carries each survey’s namespaced columns.**kwargs – Forwarded to
StreamInjector.
Examples
>>> injector = BackgroundCatalogInjector(survey) >>> injector = BackgroundCatalogInjector([survey_lsst, survey_roman]) >>> obs_stars = injector.inject_stars(catalog_df, bands=['g', 'r']) >>> obs_gals = injector.inject_galaxies(catalog_df, bands=['g', 'r'])
- inject_galaxies(catalog, bands=None, **kwargs) pd.DataFrame[source]#
Inject a catalog of galaxies through the full survey pipeline.
Uses
get_gal_misclassification()for the detection flag (probability a galaxy passes stellar selection). Requiresgal_misclassificationto be loaded on the survey.- Parameters:
catalog (pd.DataFrame or str) – True galaxy catalog. Accepts a DataFrame or a path to parquet/CSV.
bands (list of str, optional) – Photometric bands to inject. Defaults to
['r', 'g'].**kwargs – Forwarded to
inject().
- Returns:
Observed catalog with survey-namespaced magnitude and flag columns.
- Return type:
pd.DataFrame
- inject_stars(catalog, bands=None, **kwargs) pd.DataFrame[source]#
Inject a catalog of stars through the full survey pipeline.
- Parameters:
catalog (pd.DataFrame or str) – True stellar catalog. Accepts a DataFrame or a path to parquet/CSV.
bands (list of str, optional) – Photometric bands to inject. Defaults to
['r', 'g'].**kwargs – Forwarded to
inject().
- Returns:
Observed catalog with survey-namespaced magnitude and flag columns.
- Return type:
pd.DataFrame