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

PhotoCalib methods should take BaseCatalog instead of SourceCatalog

    Details

    • Type: Bug
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Story Points:
      2
    • Sprint:
      AP S19-5
    • Team:
      Alert Production

      Description

      Lauren MacArthur pointed out that PhotoCalib.instFluxToMagnitude takes a SourceCatalog, but some use cases call for a SimpleCatalog or even a BaseCatalog. I'll try to make it (plus the corresponding SourceRecord version, and the instFluxToNanojansky versions too) more generic.

        Attachments

          Issue Links

            Activity

            Hide
            lauren Lauren MacArthur added a comment - - edited

            I'm just using:

            magErr = 2.5*np.log10(np.e)*(baseCatalog[photoCalibratedFluxErrStr]/baseCatalog[photoCalibratedFluxStr])
            

            where baseCatalog has flux and fluxErr entries that were calibrated using PhotoCalib along the lines of:

            calibratedFluxAndErrArray = photoCalib.instFluxToNanojansky(sourceCatalog, fluxNameStr)
            catalog[fluxKey] = calibratedFluxAndErrArray[:, 0]
            catalog[fluxErrKey] = calibratedFluxAndErrArray[:, 1]
            

            I'm assuming the error I get back from photoCalib.instFluxToNanojansky() includes the calibration error.

            Show
            lauren Lauren MacArthur added a comment - - edited I'm just using: magErr = 2.5 * np.log10(np.e) * (baseCatalog[photoCalibratedFluxErrStr] / baseCatalog[photoCalibratedFluxStr]) where baseCatalog has flux and fluxErr entries that were calibrated using PhotoCalib along the lines of: calibratedFluxAndErrArray = photoCalib.instFluxToNanojansky(sourceCatalog, fluxNameStr) catalog[fluxKey] = calibratedFluxAndErrArray[:, 0 ] catalog[fluxErrKey] = calibratedFluxAndErrArray[:, 1 ] I'm assuming the error I get back from photoCalib.instFluxToNanojansky() includes the calibration error.
            Hide
            Parejkoj John Parejko added a comment -

            > I'm assuming the error I get back from photoCalib.instFluxToNanojansky() includes the calibration error.

            Yes, the error is incorporated into both: the equations in the class docstring for PhotoCalib give the equations used for the flux and magnitude errors.

            Show
            Parejkoj John Parejko added a comment - > I'm assuming the error I get back from photoCalib.instFluxToNanojansky() includes the calibration error. Yes, the error is incorporated into both: the equations in the class docstring for PhotoCalib give the equations used for the flux and magnitude errors.
            Hide
            Parejkoj John Parejko added a comment -

            From your use above, it definitely does look like you would be better off with a photoCalib.calibrateCatalog() method that would do both the flux and magnitude calculations and return a catalog with them filled in.

            Show
            Parejkoj John Parejko added a comment - From your use above, it definitely does look like you would be better off with a photoCalib.calibrateCatalog() method that would do both the flux and magnitude calculations and return a catalog with them filled in.
            Hide
            Parejkoj John Parejko added a comment -

            Closing this as won't fix, given the conversation above.

            Show
            Parejkoj John Parejko added a comment - Closing this as won't fix, given the conversation above.
            Hide
            lauren Lauren MacArthur added a comment -

            Indeed. I have a vague memory of you having plans for implementing such a method? No rush/need, but do make me a watcher if you see one coming down the pipe

            Show
            lauren Lauren MacArthur added a comment - Indeed. I have a vague memory of you having plans for implementing such a method? No rush/need, but do make me a watcher if you see one coming down the pipe

              People

              • Assignee:
                Parejkoj John Parejko
                Reporter:
                Parejkoj John Parejko
                Watchers:
                Eli Rykoff, Jim Bosch, John Parejko, John Swinbank, Lauren MacArthur, Paul Price, Yusra AlSayyad
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel