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

CpFlatNormalizationTask improperly indexes detectors

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: cp_pipe
    • Labels:
      None
    • Story Points:
      1
    • Epic Link:
    • Team:
      Data Release Production
    • Urgent?:
      No

      Description

      CpFlatNormalizationTask iterates through the detectors at line 297 with:

      if self.config.level == 'DETECTOR':
          for detId, det in enumerate(detSet): 
                for amp in camera[detId]:
      

      This fails for decam with *** KeyError: 'Detector for key 0 not found.', because the detectors start at 1. This should probably refer to camera[det].

        Attachments

          Activity

          Hide
          Parejkoj John Parejko added a comment -

          As noted on slack, this should just be `for detector in camera:`, no indexing should be necessary.

          Show
          Parejkoj John Parejko added a comment - As noted on slack, this should just be `for detector in camera:`, no indexing should be necessary.
          Hide
          czw Christopher Waters added a comment - - edited

          The indexing is necessary to correctly find the "detector scale" that this block is repacking into a nested set of defaultdicts.
          Link for reference: https://lsstc.slack.com/archives/CQ4SMS3QQ/p1607023685058300

          Show
          czw Christopher Waters added a comment - - edited The indexing is necessary to correctly find the "detector scale" that this block is repacking into a nested set of defaultdicts. Link for reference:  https://lsstc.slack.com/archives/CQ4SMS3QQ/p1607023685058300
          Hide
          mrawls Meredith Rawls added a comment -

          Thanks for clarifying the indexing situation, this is quite a nested adventure. I do think some minor variable renaming would really enhance clarity (det > detector and exp > exposure throughout, for instance). If you're able to do that here, bonus points! But if not, the fix is good as is.

          Show
          mrawls Meredith Rawls added a comment - Thanks for clarifying the indexing situation, this is quite a nested adventure. I do think some minor variable renaming would really enhance clarity (det > detector and exp  > exposure throughout, for instance). If you're able to do that here, bonus points! But if not, the fix is good as is.

            People

            Assignee:
            czw Christopher Waters
            Reporter:
            ctslater Colin Slater
            Reviewers:
            Meredith Rawls
            Watchers:
            Christopher Waters, Colin Slater, John Parejko, Meredith Rawls
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: