Uploaded image for project: 'DRP 2-D Pipeline'
  1. DRP 2-D Pipeline
  2. PIPE2D-1275

DoubleDetectorMap findWavelength method no longer accepting multivalue arrays

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      `drp_stella` and `datamodel` see the error on `w.2023.30`, `w.2023.30a`, and `w.2023.31`. It was working with `w.2023.29`.

      Description

      The overloaded method `findWavelength` no longer accepts numpy arrays when there is more than one element in the array.

      I've attached a minimal working example script but the following is an example:
       

       # Works correctly
      
      DetectorMap.findWavelength(1, 340)
      
      DetectorMap.findWavelength(np.array([1]), 340)
      
      DetectorMap.findWavelength(2, np.array([341]))
      
      DetectorMap.findWavelength(np.array([2]), np.array([341]))
      
       # Overload error
      
      DetectorMap.findWavelength(np.array([1, 2]), np.array([340]))
      
      DetectorMap.findWavelength(np.array([1]), np.array([340, 341]))
      
      DetectorMap.findWavelength(np.array([1, 2]), np.array([340, 341]))
      

       

      test-db-findWavelength.py

       Edit: error message:

      1:  649.9656811860972
      
      Traceback (most recent call last):
      
        File "test-db-findWavelength.py", line 23, in <module>
      
          print('2: ', detector_map_used.findWavelength(1, np.array([340, 341])))  # Fails
      
      TypeError: findWavelength(): incompatible function arguments. The following argument types are supported:
      
          1. (self: pfs.drp.stella.DetectorMap.DetectorMap, fiberId: int, row: float, throwOnError: bool = False) -> float
      
          2. (self: pfs.drp.stella.DetectorMap.DetectorMap, fiberId: int, row: numpy.ndarray) -> numpy.ndarray
      
          3. (self: pfs.drp.stella.DetectorMap.DetectorMap, fiberId: numpy.ndarray, row: numpy.ndarray) -> numpy.ndarray
      
          4. (self: pfs.drp.stella.DetectorMap.DetectorMap, arg0: int, arg1: numpy.ndarray) -> numpy.ndarray
      
          5. (self: pfs.drp.stella.DetectorMap.DetectorMap, arg0: numpy.ndarray, arg1: numpy.ndarray) -> numpy.ndarray
      
       
      
      Invoked with: <pfs.drp.stella.DoubleDetectorMap.DoubleDetectorMap object at 0x7ff1c5d96430>, 1, array([340, 341])
      

        Attachments

          Activity

            People

            • Assignee:
              price price
              Reporter:
              wtgee Wilfred Gee
              Reviewers:
              price
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: