Rerunning individual tasks from processCcd

Using the Gaia catalog is improving a lot the astrometry determination. The problem is that at the moment it is not possible to use a different catalog for astrometry and photometry, so getting a good astrometry is coming at the price of a poor photometry calibration. I know that UW is working in order to remove this restriction but in the mean time I am wondering if it would be possible to run the photometry calibration as a separate task once the calexps have been produced with processCcd and possibly using a different catalog ?

On top of solving my immediate problem, I think that having this possibility could also be very useful in general.

I think it’s

Thanks, this is the ticket corresponding to the support for multiple reference catalogs. But it does not answer to the question whether it is possible to run the photometry calibration on a previously produced calexp and update the zero point.

Sorry; you’re right, I only addressed the first question (and the short answer was: not yet).

So you want (as a workaround) to rerun the photocal with a different catalogue, while keeping the astrometric calibrations? That should be pretty easy to assemble from the parts – I’ll try to take a look later today (and if it isn’t easy I’ll have learned something)

I have been able to create a small task to rerun the photometry calibration on previously produced calexp. I still need to find how to overwrite the metadata with the new zero point.

The zero point is in the calexp's FITS header, so you probably have to clobber the entire calexp. You could write it in an independent product, but then you need to change everything downstream to look for that.

So you mean that there is no way to overwrite the calexp’s fits header in place ?

It may be possible using lsst::afw::fits but I’m not sure that’s exported to python. You could use pyfits or some other FITS handler. But I’m not aware of any LSST stack command or snippet that will allow you to update a FITS header in-place. It’s not something we want to get in the habit of doing.