def METHOD_NAME(self, ispan, ospan):
    idata = ispan.data
    odata = ospan.data
    if self.npol == 1:
        bf_map("b = Complex<b_type>(a).mag2()", {'a': idata, 'b': odata})
    else:
        shape = idata.shape[:self.axis] + idata.shape[self.axis + 1:]
        inds = ['i%i' % i for i in range(idata.ndim)]
        inds[self.axis] = '%i'
        inds_pol = ','.join(inds)
        inds_ = [inds_pol % i for i in range(4)]
        inds = inds[:self.axis] + inds[self.axis + 1:]
        if self.mode == 'jones':
            func = """
            b_type x = a(%s);
            b_type y = a(%s);
            b(%s).assign(x.mag2(), y.mag2());
            b(%s) = x*y.conj();
            """ % (inds_[0], inds_[1], inds_[0], inds_[1])
        elif self.mode == 'stokes':
            func = """
            Complex<b_type> x = a(%s);
            Complex<b_type> y = a(%s);
            auto xx = x.mag2();
            auto yy = y.mag2();
            auto xy = x*y.conj();
            b(%s) = xx + yy;
            b(%s) = xx - yy;
            b(%s) =  2*xy.real;
            b(%s) = -2*xy.imag;
            """ % (inds_[0], inds_[1],
                   inds_[0], inds_[1], inds_[2], inds_[3])
        bf_map(func, shape=shape, axis_names=inds,
               data={'a': ispan.data, 'b': ospan.data})