The original code ensured that the the coaddMean and coaddClip were generated with the same configs as specified for the final coadd, except for MEAN/MEANCLIP.
configIntersection = {k: getattr(self.config, k)
|
for k, v in self.config.toDict().items()
|
if (k in config.keys() and k != "connections")}
|
config.update(**configIntersection)
|
|
|
config.statistic = 'MEAN'
|
task = AssembleCoaddTask(config=config)
|
coaddMean = task.run(skyInfo, tempExpRefList, imageScalerList, weightList).coaddExposure
|
|
config.statistic = 'MEANCLIP'
|
task = AssembleCoaddTask(config=config)
|
coaddClip = task.run(skyInfo, tempExpRefList, imageScalerList, weightList).coaddExposure
|
|
When you replaced these with subtasks, you forgot to load the camera-specific configs for the two subtasks.
This changed the behavior of safeclip for all cameras that have an obs_camera/config/safeClipAssembleCoadd.py
We didn't notice until now because we don't regularly run safeClip in CI.
Please either revert your ticket or add the following:
config.assembleMeanCoadd.load(os.path.join(os.path.dirname(__file__), "assembleCoadd.py"))
|
config.assembleMeanCoadd.statistic = 'MEAN'
|
config.assembleMeanClipCoadd.load(os.path.join(os.path.dirname(__file__), "assembleCoadd.py"))
|
config.assembleMeanClipCoadd.statistic = 'MEANCLIP'
|
to every obs_package that has a config/safeClipAssembleCoadd.py
I don't think this is actually a bug. The issue is that the config settings such as doApplyExternalPhotoCalib=True must also be specified for the subtasks:
config.assembleMeanCoadd.doApplyExternalPhotoCalib=True and config.assembleMeanClipCoadd.doApplyExternalPhotoCalib=True . An alternative would be to check the configs of the subtasks when they are created and copy over all of the settings from the main Task, though I would expect that to create its own problems.