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

Confusing error message when afw.image Image is given a numpy array that isn't contiguous

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • Team:
      Data Release Production
    • Urgent?:
      No

      Description

      Creating images from numpy arrays requires input array to be contiguous but when the array isnt it gives a confusing error message. To reproduce

      import numpy as np
      from lsst.afw.image import Image
       
      s = (100, 100)
      data = np.zeros(s, dtype=np.float64) 
      print (data.flags['C_CONTIGUOUS'])
      im = Image(data, dtype=data.dtype.type)
       
      data = data.T
      print (data.flags['C_CONTIGUOUS'])
      im = Image(data, dtype=data.dtype.type)
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ajc Andrew Connolly
              Watchers:
              Andrew Connolly, John Swinbank
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel