code: def readiter(d):
      
  
      da = ms.getdata([d['datacol'],'axis_info','u','v','w','flag','data_desc_id'], ifraxis=True)
      good = n.where((da['data_desc_id']) == d['spwlist'][0])[0]   # take first spw                                                
      time0 = da['axis_info']['time_axis']['MJDseconds'][good]
      data0 = n.transpose(da[d['datacol']], axes=[3,2,1,0])[good]
      flag0 = n.transpose(da['flag'], axes=[3,2,1,0])[good]
      u0 = da['u'].transpose()[good] * d['freq_orig'][0] * (1e9/3e8)    # uvw are in m, so divide by wavelength of first chan to set in lambda
      v0 = da['v'].transpose()[good] * d['freq_orig'][0] * (1e9/3e8)
      w0 = da['w'].transpose()[good] * d['freq_orig'][0] * (1e9/3e8)
  
      if len(d['spwlist']) > 1:
          for spw in d['spwlist'][1:]:
              good = n.where((da['data_desc_id']) == spw)[0]
              data1 = n.transpose(da[d['datacol']], axes=[3,2,1,0])[good]
              data0 = n.concatenate( (data0, data1), axis=2 )
              flag0 = n.concatenate( (flag0, n.transpose(da['flag'], axes=[3,2,1,0])[good]), axis=2 )
  
      del da
      data0 = data0[:,:,d['chans'],:] * n.invert(flag0[:,:,d['chans'],:])   # flag==1 means bad data (for vla)                     
      iterstatus = ms.iternext() 
  
      return data0.astype('complex64'), u0.astype('float32'), v0.astype('float32'), w0.astype('float32'), time0.astype('float32')
docs: Read iteration of size iterint