def restrict(self, varname):
    '\n        restrict the variable varname to a coarser grid (factor of 2\n        coarser) and return an array with the resulting data (and same\n        number of ghostcells)\n        '
    fG = self.grid
    fData = self.get_var(varname)
    ng_c = fG.ng
    nx_c = (fG.nx // 2)
    cData = numpy.zeros(((2 * ng_c) + nx_c), dtype=self.dtype)
    ilo_c = ng_c
    ihi_c = ((ng_c + nx_c) - 1)
    cData[ilo_c:(ihi_c + 1)] = (0.5 * (fData[fG.ilo:(fG.ihi + 1):2] + fData[(fG.ilo + 1):(fG.ihi + 1):2]))
    return cData
restrict the variable varname to a coarser grid (factor of 2
coarser) and return an array with the resulting data (and same
number of ghostcells)
def restrict(self, varname):
    '\n        restrict the variable varname to a coarser grid (factor of 2\n        coarser) and return an array with the resulting data (and same\n        number of ghostcells)\n        '
    fG = self.grid
    fData = self.get_var(varname)
    ng_c = fG.ng
    nx_c = (fG.nx // 2)
    cData = numpy.zeros(((2 * ng_c) + nx_c), dtype=self.dtype)
    ilo_c = ng_c
    ihi_c = ((ng_c + nx_c) - 1)
    cData[ilo_c:(ihi_c + 1)] = (0.5 * (fData[fG.ilo:(fG.ihi + 1):2] + fData[(fG.ilo + 1):(fG.ihi + 1):2]))
    return cData