ZtoRGBpy

Version 1.0.1 Documentation

ZtoRGBpy.remap

remap(data, scale=None, profile=None, return_int=False, return_metadata=False, **kwargs)[source]

Converts an array of complex values to RGB triples

For 2d arrays of complex numbers the returned array is suitable for passing to pyplot.imshow from matplotlib.

Parameters:
  • data (array_like […]) – Complex input data.
  • scale ({Scale, ‘linear’, ‘log’}, optional, default: None) –

    Use to define the magnitude scaling of the data. Data is transformed by this object to a interval of \([0.0, 1.0]\)

    If passed an instance of Scale, then this instance is use to scale the data.

    If passed a subclass of Scale, an instance is then created of this subclass, as scale([min(abs(data)),] max(abs(data)), **kwargs).

    ’linear’ or None are equivalent to passing LinearScale, while ‘log’ is equivalent to passing LogScale

  • profile ({RGBColorProfile, ‘srgb’, ‘srgb_high’, ‘srgb_low’}, optional, default: None) –

    ColorProfile representing the RGB colorspace to convert the complex data to.

    ’srgb’ or None are equivalent to passing sRGB, while ‘srgb_high’ or ‘srgb_low’ are respectively equivalent to passing sRGB_HIGH or sRGB_LOW.

  • return_int (bool, optional, default: False) – If true, returns integers in the interval \([0, 255]\) rather than floats in the interval \([0.0, 1.0]\).
  • return_metadata (bool, optional, default: False) – Return the scale and profile instance used to generate the mapping.
Other Parameters:
 

**kwargs – These parameters are passed to the scale class when creating an automatic instance for scaling.

Returns:

  • rgb (array [ data.shape, 3]) – Array containing RGB color values with the last dimension representing the RGB triplets.

    If return_int is False then the values are floating point in the interval \([0.0, 1.0]\).

    If return_int is True then the values are integers in the interval \([0, 255]\).

  • scale (Scale) – Present only if return_metadata = True. The actual Scale instance used to generate the mapping.

  • profile (RGBColorProfile) – Present only if return_metadata = True. The actual RGBColorProfile instance used to generate the mapping.