title: Making an Image Cube using multiple fits images
body: <p>I have a bunch of fits files that can be read using the below script</p>
  
  <pre><code>from astropy.io import fits
  hdu = fits.open('file.fits')
  data = hdu[0].data
  </code></pre>
  
  <p>I am trying to make an image cube using the data read from multiple fits files. (An image cube is a 3D image that contains data from multiple fits file where the x and y axis is the 2D image dimension and the 3rd axis is time or frequency)</p>
  
  <p>I believe it can be done usin spectral _cube module, however most of the documentation only talks about how to read an image cube and not how to make one using individual fits files.</p>
  
  <p>So far I have tried the following script.</p>
  
  <pre><code>#In the below script data is a 3D numpy array
  from spectral_cube import SpectralCube
  cube = SpectralCube(data=data)
  cube.write('new_cube.fits', format='fits')
  </code></pre>
  
  <p>However, the above script gives an error saying 3 arguments required while only 2 given.</p>