Ticket #1649 (closed defect: duplicate)

Opened 8 years ago

Last modified 6 years ago

ImagePca does not return orthonormal Images

Reported by: becker Owned by: rhl
Priority: normal Milestone:
Component: afw Keywords:
Cc: rhl, rowen, bick, cloomis, price Blocked By:
Blocking: Project: LSST
Version Number:
How to repeat:
import lsst.afw.image as afwImage
import lsst.afw.geom as afwGeom
import lsst.afw.math as afwMath
import numpy
rdm      = afwMath.Random()
imagePca = afwImage.ImagePcaD()
for i in range(5):
    rdmImage  = afwImage.ImageD(afwGeom.Extent2I(10, 10))
    afwMath.randomGaussianImage(rdmImage, rdm)
    imagePca.addImage(rdmImage, 1.0)
imagePca.analyze()
eigenImages = imagePca.getEigenImages()
for i in range(len(eigenImages)):
    for j in range(i, len(eigenImages)):
        print i, j, afwImage.innerProduct(eigenImages[i], eigenImages[j])

Description

PCA is generally assumed to produce orthonormal bases; however the Images that are returned from ImagePca? are not orthonormal. Part of the issue seems to be a modification particular to Pca of Psfs:

#define FIX_BKGD_LEVEL 1
#if FIX_BKGD_LEVEL
/*
 * Estimate and subtract the mean background level from the i > 0
 * eigen images; if we don't do that then PSF variation can get mixed
 * with subtle variations in the background and potentially amplify
 * them disasterously.
 *
 * It is not at all clear that doing this is a good idea; it'd be
 * better to get the sky level right in the first place.
 */

I'd argue that this specialization to Psf Pcs does not belong in the base class.

Change History

comment:1 Changed 8 years ago by DefaultCC Plugin

  • Cc rhl, rowen, bick, cloomis, price added

comment:2 Changed 8 years ago by rhl

  • Status changed from new to deferred

Yes, this needs to be fixed. The component-fixup belongs in meas_algorithms (#1775), so I'm deferring this ticket so both can be solved together

comment:3 Changed 7 years ago by rhl

  • Status changed from deferred to assigned

OK, back to active

comment:4 Changed 6 years ago by price

  • Status changed from assigned to closed
  • Resolution set to duplicate

Duped by #2450.

Note: See TracTickets for help on using tickets.