SourceCatalog `flux` fields are now `instFlux`

As of the merging of DM-10302, RFC-322 and RFC-510 are both Implemented, meaning that all SourceCatalog flux fields produced by the stack are now called instFlux. For example, slot_ApFlux_flux and slot_ApFlux_fluxErr are now slot_ApFlux_instFlux and slot_ApFlux_instFluxErr. Our code measures the “instrumental flux” from a source, not the physical calibrated flux (achieved by multiplying the instFlux by the calibration factor), and this change will make that distinction clearer.

In addition, the flux field formerly known as InstFlux is now called GaussianFlux, which more correctly represents its contents. As far as I could tell, this field was not used anywhere in the stack currently.

This change necessitated incrementing the Schema version to 3 (version 2 was Russell’s Sigma->Err change), and I’ve maintained backwards compatibility with catalog schema versions 0, 1 and 2.

In addition to the change in field key names, I removed several long-deprecated field definition accessors from afw.table (that had no uses outside afw that I was able to find). These were of the form getPsfFluxDefinition(), getPsfFluxSlot(), hasPsfFluxSlot(), getPsfFluxKey(), getPsfFluxErrKey(), and getPsfFluxFlagKey(), for each of Psf, Calib, Model, Ap and Gaussian.

There are likely jupyter notebooks that are broken by this change. I’m happy to help, if you have an actively used notebook that needs updating.

Doing this paves the way for us to eventually introduce _flux and _fluxErr fields that will represent the on-sky physical calibrated fluxes. That won’t be for a while yet, but the PhotoCalib object has hooks to help manage such fields.

This change touched 18 packages, so if you are currently working on one of the following, you should rebase to master soon, so as not to be surprised by conflicts:

afw
daf_butler
ip_diffim
jointcal
lsst_dm_stack_demo
meas_algorithms
meas_astrom
meas_base
meas_extensions_astrometryNet
meas_extensions_convolved
meas_extensions_photometryKron
meas_extensions_psfex
meas_modelfit
meas_mosaic
obs_subaru
pipe_tasks
synpipe
validate_drp
2 Likes

How do I inspect a catalog object returned by the Butler to determine the schema version?

E.g., I

cat = butler.get(datasetType='deepCoadd_forced_src', dataId=this_data)

and want to have code that works for the older behavior of base_PsfFlux_flux or base_PsfFlux_instFlux by checking the schema version.

Oh, it’s just

cat.schema.VERSION

Well, at least I answered my own question.