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

Compute PSFlux chi squared metric

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: meas_base
    • Labels:

      Description

      The DPDD requires us to compute the chi squared of a point source model fit on difference imaging residuals. Develop a chi squared fit for the PSF model that can be run on the residuals which can be added to the source catalog. This may need to be run in the C++ layer at the point where the measurement is made.

        Attachments

          Issue Links

            Activity

            Hide
            Parejkoj John Parejko added a comment -

            Krzysztof Findeisen: do you mind doing this small-ish review (~50 lines) of mixed C++ and python (the test code)? I don't know if there's a more optimal way to do the C++ calculation.

            Eric Bellm: can you please ponder the plot I've uploaded and see if you agree with my math on the ticket? You can look at the calculation in the python test code if you don't want to bother with the C++.

            It looks like the new calculations here increase the PsfFluxAlgorithm runtime by about 10% (roughly 52ms->58ms to run on 10k PSFs on my desktop), which is probably irrelevant in the grand scheme of things.

            Show
            Parejkoj John Parejko added a comment - Krzysztof Findeisen : do you mind doing this small-ish review (~50 lines) of mixed C++ and python (the test code)? I don't know if there's a more optimal way to do the C++ calculation. Eric Bellm : can you please ponder the plot I've uploaded and see if you agree with my math on the ticket? You can look at the calculation in the python test code if you don't want to bother with the C++. It looks like the new calculations here increase the PsfFluxAlgorithm runtime by about 10% (roughly 52ms->58ms to run on 10k PSFs on my desktop), which is probably irrelevant in the grand scheme of things.
            Show
            Parejkoj John Parejko added a comment - Jenkins run with ci_hsc: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/34628/pipeline
            Hide
            Parejkoj John Parejko added a comment - - edited
            Show
            Parejkoj John Parejko added a comment - - edited Post-rebase and ap_association fix Jenkins: https://ci.lsst.codes/blue/organizations/jenkins/stack-os-matrix/detail/stack-os-matrix/34664/pipeline
            Hide
            ebellm Eric Bellm added a comment -

            Hi John Parejko, indeed there is a math error: for chi-squared we want sum( ((yi-fi)/sigma_i)**2.). The current code has sum( ((yi-fi)/sigma_i)) since you have taken the square root of the variance plane.

            Show
            ebellm Eric Bellm added a comment - Hi John Parejko , indeed there is a math error: for chi-squared we want sum( ((yi-fi)/sigma_i)**2.). The current code has sum( ((yi-fi)/sigma_i)) since you have taken the square root of the variance plane.
            Hide
            Parejkoj John Parejko added a comment -

            Attached an updated plot, after fixing the sqrt bug that Eric reported. That looks much more like what I'd expect. Note that these plots are just for DRP output, not diffims.

            Show
            Parejkoj John Parejko added a comment - Attached an updated plot, after fixing the sqrt bug that Eric reported. That looks much more like what I'd expect. Note that these plots are just for DRP output, not diffims.

              People

              Assignee:
              Parejkoj John Parejko
              Reporter:
              sullivan Ian Sullivan
              Reviewers:
              Eric Bellm, Krzysztof Findeisen
              Watchers:
              Eric Bellm, Ian Sullivan, John Parejko, Krzysztof Findeisen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.