title: Displaying a fits image with multiple channels
body: <p><a href="https://i.stack.imgur.com/QuSkR.png" rel="nofollow noreferrer">Here is my expected result</a></p>
  
  <p>I downloaded a fits image with multiple channels from CASA. I tried to upload the image like I would a normal fits image, but it shows an error </p>
  
  <blockquote>
    <p>"Invalid dimensions for image data". </p>
  </blockquote>
  
  <p>The image has a shape (1, 20, 250, 250).</p>
  
  <p>Is there a way to display all the channels?</p>
  
  <p>When I try the code I did below, it shows only one of the channels.</p>
  
  <pre class="lang-py prettyprint-override"><code>file2 = "Downloads/PVDiagramtest2.fits"
  image_data = fits.getdata(file2)
  
  image_data = image_data[~np.isnan(image_data)]
  
  plt.figure()
  plt.imshow(image_data[0,0,:,:])
  
  plt.show()
  </code></pre>