title: ValueError: When providing two arguments, the array must be of shape (N, 4)
body: <p>I've been trying to use pv-extractor package to extract the velocity along a certain path. then convert the position in the pixel coordinate to world coordinate and frequency to velocity. here is the code I've written: </p>
  
  <pre><code>###############################
  ## import packages
  ###############################
  import matplotlib
  matplotlib.use('Qt4Agg')
  
  import matplotlib.pyplot as plt
  
  from astropy.io import fits
  from astropy import wcs
  from astropy import coordinates
  from astropy import units as u
  import os
  import aplpy
  import numpy as np
  from pvextractor import extract_pv_slice
  from pvextractor.geometry import Path
  from astropy import constants as const
  import array as arr
  
  ###############################
  
  fitsfile = fits.open('Image.fits', cache=True)
  hdu = fitsfile[0]
  data = hdu.data[0,:,:,:]
  header = hdu.header
  w = wcs.WCS(hdu.header)
  
  
  ###############################
  ## pv extract
  ###############################
  
  from pvextractor import Path
  list = [(1120.40,780.97), (881.37,741.97)]
  
  path1 = Path(list, width=20 )
  pv1 = extract_pv_slice(data, path1)
  
  fig = plt.figure( )
  
  F1 = aplpy.FITSFigure(pv1, figure=fig)
  
  F1.show_colorscale(cmap='YlGnBu')
  
  plt.show()
  
  
  ##################################
  ## define functions
  ##################################
  restf = 8.6754290e10
  f0 = header['CRVAL3']
  f0 = np.float(f0)
  df = header['CDELT3']
  df = np.float(df)
  ref = header['CRPIX3']
  ref = np.float(ref)
  chan_max = header['NAXIS3']
  chan_max = np.float(chan_max)
  
  channels = np.arange(0, chan_max) # generate array with number of channels
  
  
  ##################################
  ## velocity
  ##################################
  
  f0=np.float(f0)
  df=np.float(df)
  freq = []
  freq = f0 + ( ( channels - ref ) * df )
  
  
  
  v = []
  for i in xrange(0 , len(freq)):
      v.append(const.c.value * (1 - (freq[i] / restf)))
  
  
  
  
  ##################################
  ## distance 
  ##################################
  
  pixcrd = np.array(list, np.float)
  
  world = w.wcs_pix2world(pixcrd,1)
  
  ListDist =[]
  for i in renge (0, len(list)):
      Pixel_x_1 =world[i][0]
      Pixel_y_1 =world[i][1]
      print Pixel_x_1
      print Pixel_y_1
      try: 
         Pixel_x_2 =world[i+1][0]
         Pixel_y_2 =world[i+1][1]
      except IndexError:
         break
  
      dist_dc = abs(Pixel_y_2 - Pixel_y_1)
      dist_ra = abs(Pixel_x_2 - Pixel_x_1) * np.cos(())
      ListDist.append(dist_connect)
          print ListDist
  dist_total = sum(ListDist)  #it should be in arcsec
  
  print dist_total
  ###############################
  </code></pre>
  
  <p>It perfectly extracts the path and shows the map, also I could extract the velocity as well but in the last step, I get the following error which I  don't know how to solve it : </p>
  
  <pre><code>&gt;&gt;Traceback (most recent call last):
  
  &gt;&gt; File "distance.py", line 43, in &lt;module&gt;
  
  &gt;&gt;   world = w.wcs_pix2world(pixcrd,1)
  
  &gt;&gt; File "/usr/lib64/python2.7/site-packages/astropy/wcs/wcs.py", line 1355, in wcs_pix2world
  &gt;&gt;    'output', *args, **kwargs)
  &gt;&gt;  File "/usr/lib64/python2.7/site-packages/astropy/wcs/wcs.py", line 1257, in _array_converter
   &gt;&gt;   return _return_single_array(xy, origin)
  &gt;&gt;  File "/usr/lib64/python2.7/site-packages/astropy/wcs/wcs.py", line 1238, in _return_single_array
   &gt;&gt;   "of shape (N, {0})".format(self.naxis))
  
  &gt;&gt;ValueError: When providing two arguments, the array must be of shape (N, 4)
  </code></pre>