Skip to content

Commit

Permalink
rebase me
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeyers314 committed Jun 8, 2022
1 parent 523a001 commit 6824dca
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions python/lsst/pipe/tasks/insertFakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,13 @@ class InsertFakesConfig(PipelineTaskConfig,
default="disk_n",
)

bulge_disk_flux_ratio_col = pexConfig.Field(
doc="Source catalog column name for the bulge/disk flux ratio. See "
"also: ``bulge_flux_fraction_col``.",
dtype=str,
default="bulge_disk_flux_ratio",
)

mag_col = pexConfig.Field(
doc="Source catalog column name template for magnitudes, in the format "
"``filter name``_mag_col. E.g., if this config variable is set to "
Expand All @@ -382,7 +389,14 @@ class InsertFakesConfig(PipelineTaskConfig,

bulge_flux_fraction_col = pexConfig.Field(
doc="Source catalog column name for fraction of flux in bulge "
"component.",
"component, in the format ``filter name``_bulge_flux_fraction. "
"E.g., if this config variable is set to ``%s_bulge_flux_fraction,"
"then the i-band bulge flux fraction will be search for in the "
"``i_bulge_flux_fraction`` column of the source catalog. "
"Note that if the source catalog contains both the config values "
"for bulge_flux_fraction_col and bulge_disk_flux_ratio_col, then "
"the fluxes will be determined from bulge_flux_fraction_col and "
"the bulge_disk_flux_ratio_col column will be ignored.",
dtype=str,
default="%s_bulge_flux_fraction"
)
Expand All @@ -408,13 +422,6 @@ class InsertFakesConfig(PipelineTaskConfig,

# Deprecated config variables

bulge_disk_flux_ratio_col = pexConfig.Field(
doc="Source catalog column name for the bulge/disk flux ratio.",
dtype=str,
default="bulge_disk_flux_ratio",
deprecated="Use `bulge_flux_fraction_col` instead."
)

raColName = pexConfig.Field(
doc="RA column name used in the fake source catalog.",
dtype=str,
Expand Down Expand Up @@ -797,10 +804,11 @@ def add_to_replace_dict(new_name, depr_name, std_name):
"axis ratio."
)

# Populate bulge_flux_fraction using either new-style with string interpolation,
# or old-style from b/d flux ratio. If neither are available, fall back to
# deprecated behavior of bd flux ratio = 1.0, or equivalently,
# bulge_flux_fraction=0.5
# Standardize flux apportionment between bulge and disk using
# `bulge_flux_fraction`. Prefer, in order:
# - `bulge_flux_fraction_col`
# - `bulge_disk_flux_ratio_col`
# - bd_flux_ratio = 1.0, which is equivalent to bulge_flux_fraction=0.5
if cfg.bulge_flux_fraction_col%band in fakeCat.columns:
fakeCat = fakeCat.rename(
columns={
Expand Down

0 comments on commit 6824dca

Please sign in to comment.