How does the "slot_" magic work?

Could someone kindly remind me how the “slot_” magic works?

When the extended shape measurements were called
ext_shapeHSM_HsmSourceMoments
ext_shapeHSM_HsmSourceMoments_psf

I had code like this:

I_xx, I_xy, I_yy = cat.get(slot_shape+'_xx'), cat.get(slot_shape+'_xy'), cat.get(slot_shape+'_yy')

that magically worked by calling slot_shape='slot_Shape' and slot_shape='slot_Shape_psf'.

But now that they are named:

ext_shapeHSM_HsmPsfMoments
ext_shapeHSM_HsmSourceMoments

is there any way to rewrite the above code so it still works. I tried definining the slot_Shape_psf, but that actually broke the thing that used to work which was saying slot_Shape_xx and getting that magically expanded.

I’m worried that this only worked in the past as a side effect and that the functionality you used was never expected to be a feature.

I wonder if the right thing to do here is to push the source catalogs to have a PSF shape slot as well as a source shape slot by default.

I’m worried that this only worked in the past as a side effect and that the functionality you used was never expected to be a feature.

Thus my request for a pointer to the documentation. Because the magic suffix appended was what I was told to do.

I wonder if the right thing to do here is to push the source catalogs to have a PSF shape slot as well as a source shape slot by default.

Yes, I agree that the source catalogs should define a PSF shape slot. But my point was that under the current behavior, if I do define that alias, then everything breaks.

I can go back to using getPsf(), but that replaces a lookup in a table with a function call, which is a performance hit.

@KSK Oh, I see! Your plan was to use a slot name that didn’t share the same prefix as slot_Shape (slot_PsfShape). Yes, that’s a good idea.

I had previously been trying out the silly and annoying:

        alias.set("slot_Shape", "ext_shapeHSM_HsmSourceMoments")
        alias.set("slot_Shape_xx", "ext_shapeHSM_HsmSourceMoments_xx")
        alias.set("slot_Shape_xy", "ext_shapeHSM_HsmSourceMoments_xy")
        alias.set("slot_Shape_yy", "ext_shapeHSM_HsmSourceMoments_yy")
        alias.set("slot_Shape_psf", "ext_shapeHSM_HsmPsfMoments")
        alias.set("slot_Shape_psf_xx", "ext_shapeHSM_HsmPsfMoments_xx")
        alias.set("slot_Shape_psf_xy", "ext_shapeHSM_HsmPsfMoments_xy")
        alias.set("slot_Shape_psf_yy", "ext_shapeHSM_HsmPsfMoments_yy")

FYI, the ticket for this is DM-12003.