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

Port HistPlotTask into Analysis Tools

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Story Points:
      9
    • Epic Link:
    • Sprint:
      Analysis Tools July 2022
    • Team:
      Data Release Production
    • Urgent?:
      No

      Description

      This task adds histogram plotting functionality from analysis_drp into analysis_tools. As part of this ticket, the sky object flux S/N two-panel plot is also added.

        Attachments

          Issue Links

            Activity

            Hide
            lskelvin Lee Kelvin added a comment - - edited

            The original code from analysis_drp was only partially copied into analysis_tools, heavily refactored. The majority of the code was rewritten from scratch to be significantly more readable. Three example plots are attached to this ticket (1-panel, 2-panel, and 5-panel), for reference.

            Show
            lskelvin Lee Kelvin added a comment - - edited The original code from analysis_drp was only partially copied into analysis_tools , heavily refactored. The majority of the code was rewritten from scratch to be significantly more readable. Three example plots are attached to this ticket (1-panel, 2-panel, and 5-panel), for reference.
            Hide
            lskelvin Lee Kelvin added a comment - - edited

            PS: the PR set up with this ticket includes two plot types added into python/lsst/analysis/tools/analysisPlots/skyObject.py:

            • SkyObjectHistPlot
            • SkyObjectHistPlot5Test.

            Only SkyObjectHistPlot will be merged - the 5Test class in the PR is included here for review testing purposes only, and will be removed prior to merging.

            Show
            lskelvin Lee Kelvin added a comment - - edited PS: the PR set up with this ticket includes two plot types added into python/lsst/analysis/tools/analysisPlots/skyObject.py : SkyObjectHistPlot SkyObjectHistPlot5Test . Only SkyObjectHistPlot will be merged - the 5Test class in the PR is included here for review testing purposes only, and will be removed prior to merging .
            Hide
            lskelvin Lee Kelvin added a comment - - edited

            PPS: the Python testing script I've been using to generate plots on this ticket branch is included here, for reference:

            #!/usr/bin/env python
             
            import lsst.daf.butler as dafButler
            import matplotlib.pyplot as plt
            from lsst.analysis.tools.analysisPlots.skyObject import SkyObjectHistPlot
            from lsst.analysis.tools.tasks.base import _StandinPlotInfo
             
            collection = "HSC/runs/RC2/w_2022_16/DM-34451"
            dataId = {"instrument": "HSC", "skymap": "hsc_rings_v1", "tract": 9813}
             
            butler = dafButler.Butler("/repo/main/")
            objTable = butler.get("objectTable_tract", collections=collection, dataId=dataId)
             
            histPlot = SkyObjectHistPlot()
            histPlot.populatePrepFromProcess()
            stage1 = histPlot.prep(objTable, band="i")
            stage2 = histPlot.process(stage1, band="i")
            plot = histPlot.produce(stage2, plotInfo=_StandinPlotInfo())
             
            # plt.show()
             
            plt.savefig("skyObjectHistPlot.png")
            plt.close()
            # print(plot)
            

            Show
            lskelvin Lee Kelvin added a comment - - edited PPS: the Python testing script I've been using to generate plots on this ticket branch is included here, for reference: #!/usr/bin/env python   import lsst.daf.butler as dafButler import matplotlib.pyplot as plt from lsst.analysis.tools.analysisPlots.skyObject import SkyObjectHistPlot from lsst.analysis.tools.tasks.base import _StandinPlotInfo   collection = "HSC/runs/RC2/w_2022_16/DM-34451" dataId = { "instrument" : "HSC" , "skymap" : "hsc_rings_v1" , "tract" : 9813 }   butler = dafButler.Butler( "/repo/main/" ) objTable = butler.get( "objectTable_tract" , collections = collection, dataId = dataId)   histPlot = SkyObjectHistPlot() histPlot.populatePrepFromProcess() stage1 = histPlot.prep(objTable, band = "i" ) stage2 = histPlot.process(stage1, band = "i" ) plot = histPlot.produce(stage2, plotInfo = _StandinPlotInfo())   # plt.show()   plt.savefig( "skyObjectHistPlot.png" ) plt.close() # print(plot)
            Hide
            nlust Nate Lust added a comment -

            I see emails flying by, and just wanted to let you know I am almost done with my review as well

            Show
            nlust Nate Lust added a comment - I see emails flying by, and just wanted to let you know I am almost done with my review as well
            Hide
            nlust Nate Lust added a comment -

            Some comments on github

            Show
            nlust Nate Lust added a comment - Some comments on github
            Hide
            lskelvin Lee Kelvin added a comment -

            Thank you both for the review - ticket merged and branch deleted. I think all comments were addressed barring testing of this code in a pipeline. As this ticket was already quite large and addresses a large number of issues in several files, it probably makes more sense for a future ticket to add the sky object plot type into a relevant pipeline.

            Thank you again for the review comments, much appreciated.

            Show
            lskelvin Lee Kelvin added a comment - Thank you both for the review - ticket merged and branch deleted. I think all comments were addressed barring testing of this code in a pipeline. As this ticket was already quite large and addresses a large number of issues in several files, it probably makes more sense for a future ticket to add the sky object plot type into a relevant pipeline. Thank you again for the review comments, much appreciated.

              People

              Assignee:
              lskelvin Lee Kelvin
              Reporter:
              lskelvin Lee Kelvin
              Reviewers:
              Clare Saunders, Nate Lust
              Watchers:
              Clare Saunders, Lee Kelvin, Nate Lust
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.