Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-6124

Testing ngmix Psf plugin with CModel

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: meas_extensions_ngmix
    • Labels:
      None
    • Story Points:
      6
    • Epic Link:
    • Sprint:
      DRP X16-3
    • Team:
      Data Release Production

      Description

      Test that the ngmix PSF approx plugin works correctly in our measurement framework by testing it with CModel and comparing results with those produced with ShapeletPsfApprox.

        Attachments

          Issue Links

            Activity

            Hide
            pgee Perry Gee added a comment -

            This is a comparison of the Gaussian fitters using their default settings. This was just a sanity test. But I did find the omission of the Jacobian because of strange problems with EMPsfApprox doing these simple tests.

            nGauss1: ngmix EMPsfApprox, nGauss = 1
            nGauss2: ngmix EMPsfApprox, nGauss = 2
            SingleGaussian: PsfShapeletApprox
            DoubleGaussian: PsfShapeletApprox

            Models running on a Single Gaussian:
            component 0: amp = 1.000000, sigma = 4.000000

            Using model nGauss1
            DIFFS: (-0.00015829129176376792, 0.0011888552335592665)
            PSF: (ixx=15.9990375642, iyy=15.9990375678, ixy=-1.59644452847e-08),
            (-5.7088e-13, 7.2717e-14))
            [ 0.27003514]

            Using model SingleGaussian
            DIFFS: (-0.00015541221422079763, 0.0012018456926277991)
            PSF: (ixx=15.9999987904, iyy=15.9999994105, ixy=-2.88753774136e-07),
            (7.0562e-10, 5.9369e-10))
            [ 0.28209478]

            Using model nGauss2
            DIFFS: (-0.00015828218642075919, 0.0011889808463263511)
            PSF: (ixx=15.437239682, iyy=15.4376494832, ixy=-0.000212610070082),
            (0.0019808, -0.0022363))
            [ 0.15543501]
            PSF: (ixx=16.7722790887, iyy=16.7717162863, ixy=0.000298129770636),
            (-0.0027039, 0.003053))
            [ 0.11461417]

            Using model DoubleGaussian
            DIFFS: (-0.0001554122121517216, 0.0012018456811670592)
            PSF: (ixx=15.9999999845, iyy=16.0000010528, ixy=-2.86920951877e-07),
            (1.1837e-09, 9.7758e-10))
            [ 0.28209478]
            PSF: (ixx=63.9982986901, iyy=63.9982986901, ixy=1.49369523773e-12),
            (-1.9056e-17, -2.3531e-17))
            [ 1.48330137e-08]

            -------------------------------------
            -------------------------------------
            Models running on a double gaussian
            component 0: amp = 1.000000, sigma = 4.000000
            component 1: amp = 0.500000, sigma = 8.000000

            Using model nGauss1
            DIFFS: (-0.00016236985259901842, 0.00093493041720977275)
            PSF: (ixx=26.4048038208, iyy=26.4048038208, ixy=-8.42381887074e-13),
            (-3.7257e-16, -6.1202e-19))
            [ 0.26343557]

            Using model SingleGaussian
            DIFFS: (-0.00016284465841898458, 0.00095982776760274104)
            PSF: (ixx=20.3547972164, iyy=20.2284155693, ixy=0.0631870250436),
            (-0.00017337, -9.5825e-05))
            [ 0.25573096]

            Using model nGauss2
            DIFFS: (-0.0001595243252360783, 0.00095397063580048111)
            PSF: (ixx=15.9668132914, iyy=15.9668132914, ixy=0.0),
            (3.8047e-16, -5.4508e-17))
            [ 0.18150405]
            PSF: (ixx=63.7248239325, iyy=63.7248239325, ixy=-3.79858632292e-16),
            (2.0634e-16, 2.0936e-17))
            [ 0.09142004]

            Using model DoubleGaussian
            DIFFS: (-0.0001572490117598259, 0.0009619403876283553)
            PSF: (ixx=16.169975098, iyy=16.1699215778, ixy=-1.24287220881e-05),
            (7.8807e-07, 2.8255e-06))
            [ 0.19159612]
            PSF: (ixx=67.2220132981, iyy=67.2225928636, ixy=0.000126914960634),
            (2.2892e-07, 4.0119e-07))
            [ 0.09126995]

            Show
            pgee Perry Gee added a comment - This is a comparison of the Gaussian fitters using their default settings. This was just a sanity test. But I did find the omission of the Jacobian because of strange problems with EMPsfApprox doing these simple tests. nGauss1: ngmix EMPsfApprox, nGauss = 1 nGauss2: ngmix EMPsfApprox, nGauss = 2 SingleGaussian: PsfShapeletApprox DoubleGaussian: PsfShapeletApprox Models running on a Single Gaussian: component 0: amp = 1.000000, sigma = 4.000000 Using model nGauss1 DIFFS: (-0.00015829129176376792, 0.0011888552335592665) PSF: (ixx=15.9990375642, iyy=15.9990375678, ixy=-1.59644452847e-08), (-5.7088e-13, 7.2717e-14)) [ 0.27003514] Using model SingleGaussian DIFFS: (-0.00015541221422079763, 0.0012018456926277991) PSF: (ixx=15.9999987904, iyy=15.9999994105, ixy=-2.88753774136e-07), (7.0562e-10, 5.9369e-10)) [ 0.28209478] Using model nGauss2 DIFFS: (-0.00015828218642075919, 0.0011889808463263511) PSF: (ixx=15.437239682, iyy=15.4376494832, ixy=-0.000212610070082), (0.0019808, -0.0022363)) [ 0.15543501] PSF: (ixx=16.7722790887, iyy=16.7717162863, ixy=0.000298129770636), (-0.0027039, 0.003053)) [ 0.11461417] Using model DoubleGaussian DIFFS: (-0.0001554122121517216, 0.0012018456811670592) PSF: (ixx=15.9999999845, iyy=16.0000010528, ixy=-2.86920951877e-07), (1.1837e-09, 9.7758e-10)) [ 0.28209478] PSF: (ixx=63.9982986901, iyy=63.9982986901, ixy=1.49369523773e-12), (-1.9056e-17, -2.3531e-17)) [ 1.48330137e-08] ------------------------------------- ------------------------------------- Models running on a double gaussian component 0: amp = 1.000000, sigma = 4.000000 component 1: amp = 0.500000, sigma = 8.000000 Using model nGauss1 DIFFS: (-0.00016236985259901842, 0.00093493041720977275) PSF: (ixx=26.4048038208, iyy=26.4048038208, ixy=-8.42381887074e-13), (-3.7257e-16, -6.1202e-19)) [ 0.26343557] Using model SingleGaussian DIFFS: (-0.00016284465841898458, 0.00095982776760274104) PSF: (ixx=20.3547972164, iyy=20.2284155693, ixy=0.0631870250436), (-0.00017337, -9.5825e-05)) [ 0.25573096] Using model nGauss2 DIFFS: (-0.0001595243252360783, 0.00095397063580048111) PSF: (ixx=15.9668132914, iyy=15.9668132914, ixy=0.0), (3.8047e-16, -5.4508e-17)) [ 0.18150405] PSF: (ixx=63.7248239325, iyy=63.7248239325, ixy=-3.79858632292e-16), (2.0634e-16, 2.0936e-17)) [ 0.09142004] Using model DoubleGaussian DIFFS: (-0.0001572490117598259, 0.0009619403876283553) PSF: (ixx=16.169975098, iyy=16.1699215778, ixy=-1.24287220881e-05), (7.8807e-07, 2.8255e-06)) [ 0.19159612] PSF: (ixx=67.2220132981, iyy=67.2225928636, ixy=0.000126914960634), (2.2892e-07, 4.0119e-07)) [ 0.09126995]
            Hide
            pgee Perry Gee added a comment -

            Note that nGauss2 finds a two Gaussian fit to a single gaussian which splits the flux between two gaussians of nearly equal sigma and flux.

            Show
            pgee Perry Gee added a comment - Note that nGauss2 finds a two Gaussian fit to a single gaussian which splits the flux between two gaussians of nearly equal sigma and flux.
            Hide
            jbosch Jim Bosch added a comment -

            Looks good. One question: did finding and fixing the Jacobian bug improve the speed of the algorithm at all? No need for lots of new tests; I was just curious whether the slow performance you saw before went away at all.

            Show
            jbosch Jim Bosch added a comment - Looks good. One question: did finding and fixing the Jacobian bug improve the speed of the algorithm at all? No need for lots of new tests; I was just curious whether the slow performance you saw before went away at all.
            Hide
            pgee Perry Gee added a comment -

            Yes, I was just sending you email about that. The EmPsfApprox algorithm seems fine now. Note comparison with ShapeletPsfApprox models of similar order.

            Show
            pgee Perry Gee added a comment - Yes, I was just sending you email about that. The EmPsfApprox algorithm seems fine now. Note comparison with ShapeletPsfApprox models of similar order.
            Hide
            pgee Perry Gee added a comment -

            I think that all the questions for 6124 and 6125 were answered by the timing information I sent you. Yes, I think the plugin is working well now, and is faster. It is about as good as the comparable lower order ShapeletPsfApprox models at reproducing the input Psf. And the CModel + EmPsfApprox pair seems to work comparably.

            Show
            pgee Perry Gee added a comment - I think that all the questions for 6124 and 6125 were answered by the timing information I sent you. Yes, I think the plugin is working well now, and is faster. It is about as good as the comparable lower order ShapeletPsfApprox models at reproducing the input Psf. And the CModel + EmPsfApprox pair seems to work comparably.

              People

              Assignee:
              pgee Perry Gee
              Reporter:
              pgee Perry Gee
              Reviewers:
              Jim Bosch
              Watchers:
              Jim Bosch, Perry Gee
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.