Commit 4f68d243 authored by Martin Reinecke's avatar Martin Reinecke

Merge branch 'mf_plotting' into 'NIFTy_5'

Fix multifrequency plotting

See merge request !340
parents ad4211af 4b6ba80e
Pipeline #53884 passed with stages
in 23 minutes and 11 seconds
......@@ -151,6 +151,7 @@ def _rgb_data(spectral_cube):
res /= tmp
return res
shp = spectral_cube.shape[:-1]+(3,)
spectral_cube = spectral_cube.reshape((-1, spectral_cube.shape[-1]))
xyz = getxyz(spectral_cube.shape[-1])
xyz_data = np.tensordot(spectral_cube, xyz, axes=[-1, -1])
......@@ -160,7 +161,7 @@ def _rgb_data(spectral_cube):
for x in range(xyz_data.shape[0]):
rgb_data[x] = _gammacorr(np.matmul(MATRIX_SRGB_D65, xyz_data[x]))
rgb_data = rgb_data.clip(0., 1.)
return rgb_data.reshape(spectral_cube.shape[:-1]+(-1,))
return rgb_data.reshape(shp)
def _find_closest(A, target):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment