forcedPhotCcd.py fails to perform measurement due to WCS issue

I’m following the tutorial at pipelines.lsst.io and am trying to implement forced photometry on individual exposures with forcedPhotCcd.py. All the stages of the tutorial up to and including doing the photometry on the coadds with forcedPhotCoadd.py have run successfully. When I run the following commands

forcedPhotCcd.py $DATADIR --rerun coaddPhot:ccdForcedPhot --id filter=HSC-R &> r_band_output.txt
forcedPhotCcd.py $DATADIR --rerun ccdForcedPhot --id filter=HSC-I &> i_band_output.txt

the output includes the following error:

FatalAlgorithmError: CModel forced measurement currently requires the measurement image to have the same Wcs as the reference catalog (this is a temporary limitation)

I am running on a spawned machine on lsst-lspdev with version 16 of the stack. I’m unsure why the measurement image apparently doesn’t have the same WCS as the reference catalog because I made a skymap for the exposures following the tutorial.

The end result is that forcedPhotCcd.py writes an empty table to forced_src_schema.fits and no other FITS files. Does anyone know what might help here?

You’ll need to disable the CModel galaxy photometry for now; I think this in a config file passed with -C should do it:

config.measurement.plugins.names -= ["modelfit_CModel"]

Thanks for taking a look. Including that in a config file that I pass in now leads to the following ValueError:

  File "/opt/lsst/software/stack/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_base/16.0+1/bin/forcedPhotCcd.py", line 24, in <module>
    ForcedPhotCcdTask.parseAndRun()
  File "/opt/lsst/software/stack/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_base/16.0+1/python/lsst/pipe/base/cmdLineTask.py", line 570, in parseAndRun
    parsedCmd = argumentParser.parse_args(config=config, args=args, log=log, override=cls.applyOverrides)
  File "/opt/lsst/software/stack/stack/miniconda3-4.3.21-10a4fa6/Linux64/pipe_base/16.0+1/python/lsst/pipe/base/argumentParser.py", line 649, in parse_args
    namespace.config.validate()
  File "/opt/lsst/software/stack/stack/miniconda3-4.3.21-10a4fa6/Linux64/pex_config/16.0/python/lsst/pex/config/config.py", line 690, in validate
    field.validate(self)
  File "/opt/lsst/software/stack/stack/miniconda3-4.3.21-10a4fa6/Linux64/pex_config/16.0/python/lsst/pex/config/configurableField.py", line 259, in validate
    value.validate()
  File "/opt/lsst/software/stack/stack/miniconda3-4.3.21-10a4fa6/Linux64/meas_base/16.0+1/python/lsst/meas/base/baseMeasurement.py", line 172, in validate
    raise ValueError("source flux slot algorithm '%s' is not being run." % slot)
ValueError: source flux slot algorithm 'modelfit_CModel' is not being run.```

I think we need to strike the following line from obs_subaru/config/forcedPhotCcd.py:

config.load(os.path.join(getPackageDir("obs_subaru"), "config", "cmodel.py"))

Thanks for your help with this. Problem resolved by passing in a config file [link] to override the default obs_subaru/config/forcedPhotCcd.py [link]. Running the command forcedPhotCcd.py $DATADIR --rerun coaddPhot:ccdForcedPhot --id filter=HSC-R --clobber-config --configfile=/project/shared/data/ci_hsc/forcedPhotCcdConfig.py worked.