Commit 4b6ba80e authored by Philipp Arras's avatar Philipp Arras

Fix multifrequency plotting

parent ad4211af
Pipeline #53430 passed with stages
in 8 minutes and 5 seconds
...@@ -151,6 +151,7 @@ def _rgb_data(spectral_cube): ...@@ -151,6 +151,7 @@ def _rgb_data(spectral_cube):
res /= tmp res /= tmp
return res return res
shp = spectral_cube.shape[:-1]+(3,)
spectral_cube = spectral_cube.reshape((-1, spectral_cube.shape[-1])) spectral_cube = spectral_cube.reshape((-1, spectral_cube.shape[-1]))
xyz = getxyz(spectral_cube.shape[-1]) xyz = getxyz(spectral_cube.shape[-1])
xyz_data = np.tensordot(spectral_cube, xyz, axes=[-1, -1]) xyz_data = np.tensordot(spectral_cube, xyz, axes=[-1, -1])
...@@ -160,7 +161,7 @@ def _rgb_data(spectral_cube): ...@@ -160,7 +161,7 @@ def _rgb_data(spectral_cube):
for x in range(xyz_data.shape[0]): for x in range(xyz_data.shape[0]):
rgb_data[x] = _gammacorr(np.matmul(MATRIX_SRGB_D65, xyz_data[x])) rgb_data[x] = _gammacorr(np.matmul(MATRIX_SRGB_D65, xyz_data[x]))
rgb_data = rgb_data.clip(0., 1.) 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): 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