turn dataObject.real() / .imag() into attributes (read- and writable) dataObject.real / imag

Issue #78 resolved
M. Gronle
created an issue

For a better compatibility with Numpy (np.ndarray) and to provide a setter functionality, it is proposed to replace the methods

itom.dataObject.real() itom.dataObject.imag()

by attributes:

itom.dataObject.real itom.dataObject.imag

This will be the exact behaviour of numpy ndarrays (https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.real.html#numpy.ndarray.real). Additionally, it provides the feature to not only get the real or imaginary part of the dataObject as real dataObject but also to set either the real or imaginary part to a given dataObject or numpy.array:

When assigning a new value to either the real or imaginary part, the following values should be accepted:

  • scalar (the entire real or imaginary part will be set to this value)
  • real dataObject (same size than the given complex dataObject)
  • real np.ndarray (same size than the given complex dataObject)