From 83ef608039b7555df7be905b4a4071816caf0c4c Mon Sep 17 00:00:00 2001 From: taranu Date: Tue, 5 Dec 2023 09:28:03 -0800 Subject: [PATCH 1/3] Remove redundant fit_linear config fields --- python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py | 1 - python/lsst/meas/extensions/multiprofit/fit_coadd_psf.py | 1 - 2 files changed, 2 deletions(-) diff --git a/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py b/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py index 6bec537..f60b974 100644 --- a/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py +++ b/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py @@ -115,7 +115,6 @@ class MultiProFitSourceConfig(CatalogSourceFitterConfig, fitMB.CoaddMultibandFit doc="list of bandpass filters to fit", listCheck=lambda x: len(set(x)) == len(x), ) - fit_linear = pexConfig.Field[bool](default=True, doc="Fit linear parameters to initialize") mask_names_zero = pexConfig.ListField[str]( default=["BAD", "EDGE", "SAT", "NO_DATA"], doc="Mask bits to mask out" ) diff --git a/python/lsst/meas/extensions/multiprofit/fit_coadd_psf.py b/python/lsst/meas/extensions/multiprofit/fit_coadd_psf.py index 1142730..e1667c9 100644 --- a/python/lsst/meas/extensions/multiprofit/fit_coadd_psf.py +++ b/python/lsst/meas/extensions/multiprofit/fit_coadd_psf.py @@ -39,7 +39,6 @@ class CatalogExposure(fitCP.CatalogExposurePsf, CatalogExposurePsfABC): class MultiProFitPsfConfig(CatalogPsfFitterConfig, fitCP.CoaddPsfFitSubConfig): """Configuration for the MultiProFit Gaussian mixture PSF fitter.""" - fit_linear = pexConfig.Field[bool](default=True, doc="Fit linear parameters to initialize") prefix_column = pexConfig.Field[str](default="mpf_psf_", doc="Column name prefix") def setDefaults(self): From 98126c08e6f5e8c076dc29d5f56fa772485743d1 Mon Sep 17 00:00:00 2001 From: taranu Date: Tue, 5 Dec 2023 09:28:52 -0800 Subject: [PATCH 2/3] Initialize free Sersic index params --- .../meas/extensions/multiprofit/fit_coadd_multiband.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py b/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py index f60b974..bfada2f 100644 --- a/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py +++ b/python/lsst/meas/extensions/multiprofit/fit_coadd_multiband.py @@ -271,7 +271,12 @@ def initialize_model( for comp in comps[:n_psfs]: self._init_component(comp, values_init=values_init_psf, limits_init=limits_init_psf) - for comp in comps[n_psfs:]: + for comp, config_comp in zip(comps[n_psfs:], self.config.sersics.values()): + if config_comp.sersicindex.fixed: + if g2f.SersicIndexParameterD in values_init: + del values_init[g2f.SersicMixComponentIndexParameterD] + else: + values_init[g2f.SersicMixComponentIndexParameterD] = config_comp.sersicindex.value_initial self._init_component(comp, values_init=values_init, limits_init=limits_init) for prior in model.priors: if isinstance(prior, g2f.GaussianPrior): From d1b1dfcbf50dd93166b96ad51331d4c3b04e2469 Mon Sep 17 00:00:00 2001 From: taranu Date: Tue, 5 Dec 2023 09:29:11 -0800 Subject: [PATCH 3/3] Add Sersic (+PS) model fits to pipeline --- pipelines/fit.yaml | 32 ++++++++++++++++++++++++++++++++ pipelines/merge.yaml | 20 +++++++++++++------- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/pipelines/fit.yaml b/pipelines/fit.yaml index 27bec1f..4b03af5 100644 --- a/pipelines/fit.yaml +++ b/pipelines/fit.yaml @@ -71,6 +71,38 @@ tasks: prior_size_stddev=0.3, ) } + fit_src_ser_multiprofit: + class: lsst.pipe.tasks.fit_coadd_multiband.CoaddMultibandFitTask + config: + connections.cat_output: deepCoadd_ser_multiprofit + python: | + from lsst.meas.extensions.multiprofit.fit_coadd_multiband import MultiProFitSourceTask + from lsst.multiprofit.componentconfig import SersicConfig, SersicIndexConfig + config.fit_coadd_multiband.retarget(MultiProFitSourceTask) + config.fit_coadd_multiband.n_pointsources = 0 + config.fit_coadd_multiband.sersics = { + "ser": SersicConfig( + sersicindex=SersicIndexConfig(fixed=False, value_initial=1.0), + prior_axrat_stddev=0.8, + prior_size_stddev=0.3, + ) + } + fit_src_psser_multiprofit: + class: lsst.pipe.tasks.fit_coadd_multiband.CoaddMultibandFitTask + config: + connections.cat_output: deepCoadd_psser_multiprofit + python: | + from lsst.meas.extensions.multiprofit.fit_coadd_multiband import MultiProFitSourceTask + from lsst.multiprofit.componentconfig import SersicConfig, SersicIndexConfig + config.fit_coadd_multiband.retarget(MultiProFitSourceTask) + config.fit_coadd_multiband.n_pointsources = 1 + config.fit_coadd_multiband.sersics = { + "ser": SersicConfig( + sersicindex=SersicIndexConfig(fixed=False, value_initial=1.63), + prior_axrat_stddev=0.8, + prior_size_stddev=0.3, + ) + } fit_src_psexpdev_multiprofit: class: lsst.pipe.tasks.fit_coadd_multiband.CoaddMultibandFitTask config: diff --git a/pipelines/merge.yaml b/pipelines/merge.yaml index 8615465..4a0ea2e 100644 --- a/pipelines/merge.yaml +++ b/pipelines/merge.yaml @@ -29,18 +29,24 @@ tasks: is_multipatch=True, storageClass="DataFrame", ), - "deepCoadd_psexpdev_multiprofit": InputConfig( - doc="Point Source + Exponential + DeVaucouleurs source fit", - action=MergeMultibandFluxes(name_model="psexpdev"), - column_id="id", - is_multiband=True, - ), "deepCoadd_psgauss_multiprofit": InputConfig( doc="Point Source + Gaussian source fit", action=MergeMultibandFluxes(name_model="psgauss"), column_id="id", is_multiband=True, ), + "deepCoadd_psser_multiprofit": InputConfig( + doc="Point Source + Sersic source fit", + action=MergeMultibandFluxes(name_model="psser"), + column_id="id", + is_multiband=True, + ), + "deepCoadd_psexpdev_multiprofit": InputConfig( + doc="Point Source + Exponential + DeVaucouleurs source fit", + action=MergeMultibandFluxes(name_model="psexpdev"), + column_id="id", + is_multiband=True, + ), } match_multiprofit: class: lsst.pipe.tasks.match_tract_catalog.MatchTractCatalogTask @@ -100,7 +106,7 @@ tasks: if parameters.size_include: for ax in ("x", "y"): config.columns_target_copy.append( - f"{parameters.model_prefix}_{parameters.size_include}_sigma_{ax}" + f"{parameters.model_prefix}_{parameters.size_include}_reff_{ax}" ) config.columns_flux = columns_flux config.coord_format.column_target_coord1 = f"{parameters.model_prefix}_cen_ra"