class_docstr: Common set of functionality for performing tests on the real to
  real transforms. This is not implemented as a distinct test class
  (inheriting from unittest.TestCase) because its `__init__` method
  takes multiple arguments as input which set up the size and
  directions of the transform.
class_docstr_tok: ["Common","set","of","functionality","for","performing","tests","on","the","real","to","real","transforms",".","This","is","not","implemented","as","a","distinct","test","class","(","inheriting","from","unittest.TestCase",")","because","its","`","__init__","`","method","takes","multiple","arguments","as","input","which","set","up","the","size","and","directions","of","the","transform","."]
code: def test_against_exact_data(self):
      points = grid(self.dims, self.axes, self.directions)
      data = numpy.ones_like(points[0], dtype=self.dtype)
      wavenumbers = list()
      factors = list()
  
      for index, axis in enumerate(self.axes):
          # Simplification: don't test constant terms. They are weird.
          if self.directions[index] in discrete_cosine_directions:
              wavenumber_min = 1
              wavenumber_max = self.dims[axis] - 2
          else:
              wavenumber_min = 0
              wavenumber_max = self.dims[axis] - 2
          _wavenumbers = sorted(
              {
                  rand.randint(wavenumber_min, wavenumber_max)
                  for _ in range(self.dims[axis])
              }
          )
          _factors = [rand.randint(1, 8) for _ in _wavenumbers]
          interpolated_function = interpolated_function_lookup[
              self.directions[index]
          ]
          data *= sum(
              (
                  factor
                  * interpolated_function(wavenumber, points[axis])
                  for factor, wavenumber in zip(_factors, _wavenumbers)
              )
          )
          wavenumbers.append(numpy.array(_wavenumbers))
          factors.append(numpy.array(_factors))
  
      self._input_array[:] = data
      self.plan.execute()
  
      # zero all of the entries that do not correspond to a wavenumber.
      exact_coefficients = numpy.ones(data.shape)
      for index, axis in enumerate(self.axes):
          dim = self.dims[axis]
          sp = list(it.repeat(slice(None), len(data.shape)))
          zero_indicies = numpy.array(
              list(set(numpy.arange(0, dim)) - set(wavenumbers[index]))
          )
          if len(zero_indicies) == 0:
              pass
          else:
              sp[axis] = zero_indicies
              mask = numpy.ones(data.shape)
              mask[tuple(sp)] = 0.0
              exact_coefficients *= mask
  
      # create the 'known' array of interpolation coefficients.
      normalisation = self.plan.N / (2 ** len(self.axes))
      for index, axis in enumerate(self.axes):
          for factor, wavenumber in zip(
              factors[index], wavenumbers[index]
          ):
              sp = list(it.repeat(slice(None), len(data.shape)))
              sp[axis] = wavenumber
              exact_coefficients[tuple(sp)] *= factor
  
      error = numpy.mean(
          numpy.abs(
              self._output_array / normalisation - exact_coefficients
          )
      )
      return error < self.tol
  
imports: from __future__ import division
  import itertools
  import random
  import unittest
  import numpy
  import pyfftw
  from pyfftw import _supported_types
  from .test_pyfftw_base import run_test_suites
label_desc: Use image node_id 4 for calling the TestRealTransform obj's underlying member method code with example usage: obj.test_against_exact_data() and returns: unknown