I have a black and white spectrum that I want to colorize
using this colorize image.

Adapting the method given here: Applying different color map to mask, I obtain a final colorized image, but it lacks the features of the spectrum (see comments in code for a link to the picture finalimage).
My code is given here (with the hosted images in the comments since I cannot display all of them here):
import numpy as np
import matplotlib.pyplot as plt
import pyfits
wavemap = "FITS/wavemap.fits.gz"
spectrum = "FITS/phxspectra.fits.gz"
image = pyfits.getdata(spectrum)
colors = pyfits.getdata(wavemap)
mask = colors > 0
colors_ma = np.ma.array(colors, mask=~mask)
kwargs = {'interpolation': 'none', 'vmin': colors[mask].min(), 'vmax': colors.max(), 'origin': 'lower', 'alpha' : 0.5}
plt.imshow(image, cmap=plt.cm.Greys_r, interpolation='none', origin='lower')
plt.imshow(colors_ma, cmap=plt.cm.jet, **kwargs)
plt.show()
#
#
#
#
#
If I lower the alpha value, the features of the spectrum show better, but the colors are very dim. If I increase the alpha value, then the colors show much better, but the features of the spectrum do not show.
How can I get the features of the spectrum AND the colors from the colorize image without trading off one for the other?
