# SourceCatalog \`flux\` fields are now \`instFlux\`

**URL:** <https://www.rubin.community/t/sourcecatalog-flux-fields-are-now-instflux/3265>\
**Category:** DM Notifications\
**Tags:** afw, catalogs, afwtable, dm-dev, flux\
**Created:** [September 19, 2018, 6:11am UTC](https://www.rubin.community/t/sourcecatalog-flux-fields-are-now-instflux/3265 "2018-09-19T06:11:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![parejkoj](https://sea2.discourse-cdn.com/flex002/user_avatar/www.rubin.community/parejkoj/32/138_2.png) [@parejkoj](https://www.rubin.community/u/parejkoj)\
**Post date:** [September 19, 2018, 6:11am UTC](https://www.rubin.community/t/sourcecatalog-flux-fields-are-now-instflux/3265/1 "2018-09-19T06:11:59Z")

</div>

As of the merging of [DM-10302](https://jira.lsstcorp.org/browse/DM-10302), [RFC-322](https://jira.lsstcorp.org/browse/RFC-322) and [RFC-510](https://jira.lsstcorp.org/browse/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:

```auto
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

```

---

<div class="post-metadata">

**Author:** ![mwv](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mwv](https://www.rubin.community/u/mwv)\
**Post date:** [October 24, 2018, 7:45pm UTC](https://www.rubin.community/t/sourcecatalog-flux-fields-are-now-instflux/3265/2 "2018-10-24T19:45:10Z")

</div>

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

E.g., I

```auto
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.

---

<div class="post-metadata">

**Author:** ![mwv](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mwv](https://www.rubin.community/u/mwv)\
**Post date:** [October 24, 2018, 8:00pm UTC](https://www.rubin.community/t/sourcecatalog-flux-fields-are-now-instflux/3265/3 "2018-10-24T20:00:07Z")

</div>

Oh, it’s just

```auto
cat.schema.VERSION

```

Well, at least I answered my own question.
