Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-30858: Add GAaP to obs_subaru #367

Merged
merged 4 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/charImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
config.measurement.load(os.path.join(ObsConfigDir, "apertures.py"))
config.measurement.load(os.path.join(ObsConfigDir, "kron.py"))
config.measurement.load(os.path.join(ObsConfigDir, "convolvedFluxes.py"))
config.measurement.load(os.path.join(ObsConfigDir, "gaap.py"))
config.measurement.load(os.path.join(ObsConfigDir, "hsm.py"))
if "ext_shapeHSM_HsmShapeRegauss" in config.measurement.plugins:
# no deblending has been done
Expand All @@ -55,6 +56,10 @@
names = config.measurement.plugins["ext_convolved_ConvolvedFlux"].getAllResultNames()
config.measureApCorr.allowFailure += names

if "ext_gaap_GaapFlux" in config.measurement.plugins:
names = config.measurement.plugins["ext_gaap_GaapFlux"].getAllGaapResultNames()
config.measureApCorr.allowFailure += names

# For aperture correction modeling, only use objects that were used in the
# PSF model and have psf flux signal-to-noise > 200.
config.measureApCorr.sourceSelector['science'].doFlags = True
Expand Down
4 changes: 4 additions & 0 deletions config/forcedPhotCoadd.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
config.measurement.load(os.path.join(os.path.dirname(__file__), "apertures.py"))
config.measurement.load(os.path.join(os.path.dirname(__file__), "kron.py"))
config.measurement.load(os.path.join(os.path.dirname(__file__), "convolvedFluxes.py"))
config.measurement.load(os.path.join(os.path.dirname(__file__), "gaap.py"))
config.load(os.path.join(os.path.dirname(__file__), "cmodel.py"))

config.measurement.slots.gaussianFlux = None
Expand Down Expand Up @@ -41,5 +42,8 @@ def doUndeblended(config, algName, fluxList=None):
doUndeblended(config, "base_CircularApertureFlux", []) # No aperture correction for circular apertures
doUndeblended(config, "ext_convolved_ConvolvedFlux",
config.measurement.plugins["ext_convolved_ConvolvedFlux"].getAllResultNames())
doUndeblended(config, "ext_gaap_GaapFlux",
config.measurement.plugins["ext_gaap_GaapFlux"].getAllGaapResultNames())
# Disable registration for apCorr of undeblended convolved; apCorr will be done through the deblended proxy
config.measurement.undeblended["ext_convolved_ConvolvedFlux"].registerForApCorr = False
config.measurement.undeblended["ext_gaap_GaapFlux"].registerForApCorr = False
7 changes: 7 additions & 0 deletions config/gaap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Enable GAaP (Gaussian Aperture and PSF) colors
# 'config' is typically a SourceMeasurementConfig
try:
import lsst.meas.extensions.gaap # noqa
config.plugins.names.add("ext_gaap_GaapFlux")
except ImportError as exc:
print("Cannot import lsst.meas.extensions.gaap (%s): disabling GAaP flux measurements" % (exc,))
60 changes: 60 additions & 0 deletions policy/Object.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,50 @@ funcs:
args: slot_ModelFlux
filt1: z
filt2: y
# PSF GAaP flux
GaapFlux_Psf:
functor: NanoJansky
dataset: forced_src
args: ext_gaap_GaapFlux_1_15x_PsfFlux_instFlux
GaapFluxErr_Psf:
functor: NanoJanskyErr
dataset: forced_src
args:
- ext_gaap_GaapFlux_1_15x_PsfFlux_instFlux
- ext_gaap_GaapFlux_1_15x_PsfFlux_instFluxErr
# 0.7 arcsec sigma GAaP flux
GaapFlux_0_7:
functor: NanoJansky
dataset: forced_src
args: ext_gaap_GaapFlux_1_15x_0_7_instFlux
GaapFluxErr_0_7:
functor: NanoJanskyErr
dataset: forced_src
args:
- ext_gaap_GaapFlux_1_15x_0_7_instFlux
- ext_gaap_GaapFlux_1_15x_0_7_instFluxErr
# 1.0 arcsec sigma GAaP flux
GaapFlux_1_0:
functor: NanoJansky
dataset: forced_src
args: ext_gaap_GaapFlux_1_15x_1_0_instFlux
GaapFluxErr_1_0:
functor: NanoJanskyErr
dataset: forced_src
args:
- ext_gaap_GaapFlux_1_15x_1_0_instFlux
- ext_gaap_GaapFlux_1_15x_1_0_instFluxErr
# Optimal GAaP flux
GaapFlux_Optimal:
functor: NanoJansky
dataset: forced_src
args: ext_gaap_GaapFlux_1_15x_Optimal_instFlux
GaapFluxErr_Optimal:
functor: NanoJanskyErr
dataset: forced_src
args:
- ext_gaap_GaapFlux_1_15x_Optimal_instFlux
- ext_gaap_GaapFlux_1_15x_Optimal_instFluxErr
# Taking Shape from meas
Ixx:
functor: Column
Expand Down Expand Up @@ -385,6 +429,20 @@ flags:
- slot_PsfFlux_flag_apCorr
- slot_PsfFlux_flag_edge
- slot_PsfFlux_flag_noGoodPixels
- ext_gaap_GaapFlux_1_15x_Psf_apCorr
- ext_gaap_GaapFlux_1_15x_Psf_apCorrErr
- ext_gaap_GaapFlux_1_15x_Optimal_apCorr
- ext_gaap_GaapFlux_1_15x_Optimal_apCorrErr
- ext_gaap_GaapFlux_1_15x_0_7_apCorr
- ext_gaap_GaapFlux_1_15x_0_7_apCorrErr
- ext_gaap_GaapFlux_1_15x_1_0_apCorr
- ext_gaap_GaapFlux_1_15x_1_0_apCorrErr
- ext_gaap_GaapFlux_flag
- ext_gaap_GaapFlux_flag_edge
- ext_gaap_GaapFlux_1_15x_flag_gaussianization
- ext_gaap_GaapFlux_1_15x_Optimal_flag_bigPsf
- ext_gaap_GaapFlux_1_15x_0_7_flag_bigPsf
- ext_gaap_GaapFlux_1_15x_1_0_flag_bigPsf
- ext_photometryKron_KronFlux_apCorr
- ext_photometryKron_KronFlux_apCorrErr
- ext_photometryKron_KronFlux_flag
Expand Down Expand Up @@ -418,6 +476,8 @@ flag_rename_rules:
- ['base_CircularApertureFlux', 'ApFlux']
- ['ext_shapeHSM_', '']
- ['ext_convolved_', '']
- ['ext_gaap_GaapFlux_1_15x', 'GaapFlux']
- ['ext_gaap_GaapFlux', 'GaapFlux']
- ['undeblended_base', 'undeblended']
- ['undeblended_ext_photometryKron', 'undeblended']
- ['ext_photometryKron_', '']
Expand Down
1 change: 1 addition & 0 deletions ups/obs_subaru.table
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ setupOptional(daf_butler)
setupOptional(meas_modelfit)
setupOptional(meas_extensions_psfex)
setupOptional(meas_extensions_shapeHSM)
setupOptional(meas_extensions_gaap)
setupOptional(testdata_subaru)

envPrepend(LD_LIBRARY_PATH, ${PRODUCT_DIR}/lib)
Expand Down