I’m not sure what the second warning is, but I imagine you can fix it by setting up meas_extensions_photometryKron and adding ext_photometryKron_KronFlux to the list of algorithms. I don’t understand why it’s necessary in mergeCoaddMeasurements.py, though.
The first warning can only be fixed by re-running single-frame processing and coaddition with the modelfit algorithms enabled there: we derive our coadd aperture corrections by “coadding” the aperture corrections from individual exposures, so if we don’t generate an aperture correction for CModel at that point, there’s nothing we can do about it later.
As a side note, it should be unnecessary to run modelfit_GeneralShapeletPsfApprox; it’s an alternative to modelfit_DoubleShapeletPsfApprox that’s slower and more prone to failure, and I the the CModel default is to use DoubleShapeletPsfApprox so it’s probably being ignored right now anyway.
It should actually only be necessary to do this for charImage; adding these to the plugins for calibrate is harmless but unnecessary, since aperture corrections are measured in charImage. And I don’t think you need to import lsst.shapelet. But the lines themselves look correct.
Have a look at the configuration for HSC in obs_subaru. We have a configuration file, cmodel.py that gets loaded whenever we want to activate CModel. This allows reuse in processCcd, measureCoaddSources, forcedPhotCoadd, etc. The import is in a try block, which makes it very easy to disable CModel by simply doing unsetup -j meas_modelfit.
from __future__ import print_function
# Enable CModel mags (unsetup meas_modelfit or use $MEAS_MODELFIT_DIR/config/disable.py to disable)
# 'config' is a SourceMeasurementConfig.
import os
try:
import lsst.meas.modelfit
config.measurement.plugins.names |= ["modelfit_DoubleShapeletPsfApprox", "modelfit_CModel"]
config.measurement.slots.modelFlux = 'modelfit_CModel'
config.catalogCalculation.plugins['base_ClassificationExtendedness'].fluxRatio = 0.985
except (KeyError, ImportError):
print("Cannot import lsst.meas.modelfit: disabling CModel measurements")