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

Weighting in photometric calibration is incorrect

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: meas_photocal
    • Labels:
      None

      Description

      Dominique points out that the zero point calibration uses errors not inverse errors to calculate the zero point. git annotate reveals:

      24c9149f python/lsst/meas/photocal/PhotoCal.py (Robert Lupton the Good 2010-12-13 05:03:12 +0000 353) return np.average(dmag, weights=dmagErr), np.std(dmag, ddof=1), len(dmag)

      Please fix this. At the same time, we should add a config parameter to soften the errors.

        Attachments

          Issue Links

            Activity

            No builds found.
            rhl Robert Lupton created issue -
            Hide
            boutigny Dominique Boutigny added a comment - - edited

            I think that the error is also incorrect (np.std(dmag)) I think that it should be something like :
            zp, sum = np.average(dmag, weights=1/dmagErr**2,returned=True)
            sigma = np.sqrt(1.0/sum)

            Assuming that the dmagErr values are correct

            Show
            boutigny Dominique Boutigny added a comment - - edited I think that the error is also incorrect (np.std(dmag)) I think that it should be something like : zp, sum = np.average(dmag, weights=1/dmagErr**2,returned=True) sigma = np.sqrt(1.0/sum) Assuming that the dmagErr values are correct
            swinbank John Swinbank made changes -
            Field Original Value New Value
            Team Data Release Production [ 10301 ]
            swinbank John Swinbank made changes -
            Issue Type Story [ 10001 ] Bug [ 1 ]
            swinbank John Swinbank made changes -
            Rank Ranked higher
            swinbank John Swinbank made changes -
            Epic Link DM-1912 [ 15945 ]
            swinbank John Swinbank made changes -
            Sprint Science Pipelines DM-S15-5 [ 162 ]
            Assignee Robert Lupton [ rhl ] Jim Bosch [ jbosch ]
            jbosch Jim Bosch made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            Hide
            jbosch Jim Bosch added a comment -

            I'm just adopting Dominique Boutigny's proposed solution, as it seems correct, or at least vastly more correct than what we have now. I do wonder a bit whether we should be doing this average in flux units rather than magnitude units, but I think that's beyond the scope of this issue.

            Robert Lupton, by "soften the errors", do you just mean "add a constant in quadrature" (with the constant coming from the config)?

            Show
            jbosch Jim Bosch added a comment - I'm just adopting Dominique Boutigny 's proposed solution, as it seems correct, or at least vastly more correct than what we have now. I do wonder a bit whether we should be doing this average in flux units rather than magnitude units, but I think that's beyond the scope of this issue. Robert Lupton , by "soften the errors", do you just mean "add a constant in quadrature" (with the constant coming from the config)?
            Hide
            boutigny Dominique Boutigny added a comment -

            Probably not exactly in the scope of this ticket, but the main problem is that the Photocal fit is not taking into account the error on the flux of the reference stars. In some region of the SDSS catalog (CFHTLS D3 for instance) they can be quite large.

            Show
            boutigny Dominique Boutigny added a comment - Probably not exactly in the scope of this ticket, but the main problem is that the Photocal fit is not taking into account the error on the flux of the reference stars. In some region of the SDSS catalog (CFHTLS D3 for instance) they can be quite large.
            jbosch Jim Bosch made changes -
            Story Points 1
            Hide
            jbosch Jim Bosch added a comment -

            This issue will address some (but not all) of the problems discussed in DM-2308.

            Show
            jbosch Jim Bosch added a comment - This issue will address some (but not all) of the problems discussed in DM-2308 .
            jbosch Jim Bosch made changes -
            Link This issue is contained by DM-2308 [ DM-2308 ]
            Hide
            jbosch Jim Bosch added a comment -

            Simon, do you have time for a small review? This fixes a big but simple problem in the Photocal algorithm, along with a number of minor fixes and cleanups. All changes on tickets/DM-2423 of pipe_tasks.

            Show
            jbosch Jim Bosch added a comment - Simon, do you have time for a small review? This fixes a big but simple problem in the Photocal algorithm, along with a number of minor fixes and cleanups. All changes on tickets/ DM-2423 of pipe_tasks.
            jbosch Jim Bosch made changes -
            Reviewers Simon Krughoff [ krughoff ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            jbosch Jim Bosch made changes -
            Status In Review [ 10004 ] In Progress [ 3 ]
            Hide
            jbosch Jim Bosch added a comment -

            Simon is super busy. Russell Owen, could you take on this review? It's a pretty small one.

            Show
            jbosch Jim Bosch added a comment - Simon is super busy. Russell Owen , could you take on this review? It's a pretty small one.
            jbosch Jim Bosch made changes -
            Reviewers Simon Krughoff [ krughoff ] Russell Owen [ rowen ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            swinbank John Swinbank made changes -
            Sprint Science Pipelines DM-S15-5 [ 162 ] Science Pipelines DM-S15-5, Science Pipelines DM-S15-6 [ 162, 165 ]
            swinbank John Swinbank made changes -
            Rank Ranked higher
            Hide
            rowen Russell Owen added a comment -

            photoCal.py

            The changes look helpful.

            One small request: please change the final return to specify each value on its own line, as per the original code. I feel that makes it easier for a user to see exactly what named values are in the returned struct.

            testPhotocal.py

            The changes look helpful.

            Show
            rowen Russell Owen added a comment - photoCal.py The changes look helpful. One small request: please change the final return to specify each value on its own line, as per the original code. I feel that makes it easier for a user to see exactly what named values are in the returned struct. testPhotocal.py The changes look helpful.
            rowen Russell Owen made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            Hide
            jbosch Jim Bosch added a comment -

            One small request: please change the final return to specify each value on its own line, as per the original code. I feel that makes it easier for a user to see exactly what named values are in the returned struct.

            I find that a bit unnecessarily verbose, but I also don't care much. Will do.

            Show
            jbosch Jim Bosch added a comment - One small request: please change the final return to specify each value on its own line, as per the original code. I feel that makes it easier for a user to see exactly what named values are in the returned struct. I find that a bit unnecessarily verbose, but I also don't care much. Will do.
            Hide
            jbosch Jim Bosch added a comment -

            Merged to master.

            Show
            jbosch Jim Bosch added a comment - Merged to master.
            jbosch Jim Bosch made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]
            Hide
            rhl Robert Lupton added a comment -

            Yes.

            Show
            rhl Robert Lupton added a comment - Yes.
            rhl Robert Lupton made changes -
            Attachment signature.asc [ 27052 ]

              People

              Assignee:
              jbosch Jim Bosch
              Reporter:
              rhl Robert Lupton
              Reviewers:
              Russell Owen
              Watchers:
              Dominique Boutigny, Jim Bosch, Rachel Mandelbaum, Robert Lupton, Russell Owen, Simon Krughoff
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.