     unsigned j;
     j = lut[i]   =   floor(v);
     fpart[i]     = v-floor(v);
-    hit[j  ]+=fpart[i];
-    hit[j+1]+=(1.0f-fpart[i]);
+    hits[j  ]+=fpart[i];
+    hits[j+1]+=(1.0f-fpart[i]);
   }
   // compute norms
   for(unsigned i=0;i<inwidth;++i)

static int pipeline_alloc_accumulator(pipeline_t self, const pipeline_image_t src)
{ if(self->ctx.accumulator)
    cudaFree(self->ctx.accumulator);
  const unsigned w     = self->align*((src->w+self->align-1)/self->align); // increase number of columns to align
  const unsigned nelem = w*src->h*src->nchan;
  CUNEW(float,self->ctx.accumulator,nelem);
  CUZERO(float,self->ctx.accumulator,nelem);



#define EPS (1e-3)
static unsigned pipeline_get_output_width(pipeline_t self, const double inwidth)
{ const double d=inwidth/self->samples_per_scan; // 1 - duty
  //max derivative of the cosine warp adjusted to cos(2pi*(d/2)) is the zero point
  //and the positive part of the warp function goes from 0 to 1.
  const double maxslope=M_PI*(1.0-d)/inwidth/cos(M_PI*d);
  const double amplitude=1.0/maxslope;
  const unsigned w=self->alignment*(unsigned)(amplitude/(float)self->downsample/self->alignment);
  TRY(-EPS<d && d<=(0.5+EPS));
  TRY(0<w && w<inwidth);
  return w;
Error:
