<p>It’s hard to tell for sure without seeing the data and playing around, but looking at your image, I would suggest trying to subtract off a constant background level to get the sky as close to black as possible.  You could sample the edges of the image to find the average background level.  Then subtract that value from the whole image array and try plotting it.  Even simpler would be just to subtract the minimum value, but that’s prone to being skewed by just a single pixel.</p>
<p>If you try it, post an image back here and let’s see how it looks.</p>

CC BY-SA 4.0
2020-08-01T03:03:43.787Z
2020-08-01T03:03:43.787Z
Eric Jensen
<p>Based on <a href="https://astronomy.stackexchange.com/a/38234/7982">@ELNJ's answer</a> I did a quick check of your posted image <a href="https://i.sstatic.net/Ky5Rl.png" rel="nofollow noreferrer">https://i.sstatic.net/Ky5Rl.png</a> using the script below. Separating out the color channels we see the following:</p>
<pre><code>channel   lowest value present

 red           4
 green        33
 blue         90
 alpha       255
</code></pre>
<p>So I think you can get dramatic results by subtracting an RGB value of [4, 33, 90]</p>
<p>which looks like this: <a href="https://i.sstatic.net/F1P1I.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/F1P1I.png" alt="sample of rgb = [4, 33, 90]" /></a></p>
<p>If that helps, or something along those lines does, please post an answer to your question, it is always okay to answer your own questions in Stack Exchange!</p>
<p><a href="https://i.sstatic.net/KhHxV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/KhHxV.png" alt="analysis of https://i.sstatic.net/Ky5Rl.png" /></a></p>
<hr />
<p>Python script for plot:</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt

img = plt.imread('Ky5Rl.png')
plt.imshow(img)
plt.show()

rgba = (255*np.moveaxis(img, 2, 0)).astype(int)
names = ['red', 'green', 'blue', 'alpha']
colors = names[:3] + ['black']
bins = np.arange(0, 257)
plt.figure()
plt.subplot(2, 1, 1)
plt.imshow(img)
plt.subplot(2, 1, 2)
for thing, name, color in zip(rgba, names, colors):
    a, b = np.histogram(thing.flatten(), bins=bins)  
    plt.plot(b[:-1], a, color=color)
    x = np.argmax(a)
    y = a[x]
    plt.annotate(name, (x, 1.01*y))
    print('first nonzero value for ', name, ' is at ', np.nonzero(a)[0][0])
plt.xlabel('value')
plt.ylabel('frequency')
plt.show()
</code></pre>

CC BY-SA 4.0
2020-08-02T07:58:46.153Z
2020-08-02T08:09:40.423Z
2020-08-02T08:09:40.423Z
uhoh
<p>In my laboratory, we have an antenna to get data from the GOES-16 satellite and I want to reproduce NASA's nice visualization of ultraviolet images from the sensor SUVI.</p>
<p><a href="https://i.sstatic.net/tlF4V.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tlF4V.png" alt="enter image description here" /></a></p>
<p>I can read the data without any problem and thanks to the project sunpy I got the color tables corresponding to each band. But I have not found a reference for the exact correspondence between values and color indexes, so my version is not remotely as nice.</p>
<p><a href="https://i.sstatic.net/Ky5Rl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ky5Rl.png" alt="enter image description here" /></a></p>
<p>Where can I find a reference to know how to use this color map with my own software?  I will appreciate any hint.</p>

CC BY-SA 4.0
2020-08-01T11:33:25.023Z
Comparing the two images, it is apparent that the bright areas in the upper image are over-saturated while they are not in yours. Thus the bigger contrast at medium levels is gained by loosing information at the brightest end. You might also try to scale brightness logarithmically, or generally not linear.
planetmaker
<the-sun>
Corresponding values for the Sun's ultra violet color maps?
user2309000
# Corresponding values for the Sun's ultra violet color maps?

(Asked by: username_0 on 2020-07-30)

In my laboratory, we have an antenna to get data from the GOES-16 satellite and I want to reproduce NASA's nice visualization of ultraviolet images from the sensor SUVI.

[![enter image description here](https://i.sstatic.net/tlF4V.png)](https://i.sstatic.net/tlF4V.png)

I can read the data without any problem and thanks to the project sunpy I got the color tables corresponding to each band. But I have not found a reference for the exact correspondence between values and color indexes, so my version is not remotely as nice.

[![enter image description here](https://i.sstatic.net/Ky5Rl.png)](https://i.sstatic.net/Ky5Rl.png)

Where can I find a reference to know how to use this color map with my own software? I will appreciate any hint.

**Tags:** the-sun

> **Comments:**
> **username_1**: Comparing the two images, it is apparent that the bright areas in the upper image are over-saturated while they are not in yours. Thus the bigger contrast at medium levels is gained by loosing information at the brightest end. You might also try to scale brightness logarithmically, or generally not linear.  

---

## 2 answers

### Answer by username_2 on 2020-08-01. Score: 2

It’s hard to tell for sure without seeing the data and playing around, but looking at your image, I would suggest trying to subtract off a constant background level to get the sky as close to black as possible. You could sample the edges of the image to find the average background level. Then subtract that value from the whole image array and try plotting it. Even simpler would be just to subtract the minimum value, but that’s prone to being skewed by just a single pixel.

If you try it, post an image back here and let’s see how it looks.


---

### Answer by username_3 on 2020-08-02. Score: 0

Based on @ELNJ's answer I did a quick check of your posted image https://i.sstatic.net/Ky5Rl.png using the script below. Separating out the color channels we see the following:
channel   lowest value present

 red           4
 green        33
 blue         90
 alpha       255

So I think you can get dramatic results by subtracting an RGB value of [4, 33, 90]
which looks like this: 
If that helps, or something along those lines does, please post an answer to your question, it is always okay to answer your own questions in Stack Exchange!


Python script for plot:
import numpy as np
import matplotlib.pyplot as plt

img = plt.imread('Ky5Rl.png')
plt.imshow(img)
plt.show()

rgba = (255*np.moveaxis(img, 2, 0)).astype(int)
names = ['red', 'green', 'blue', 'alpha']
colors = names[:3] + ['black']
bins = np.arange(0, 257)
plt.figure()
plt.subplot(2, 1, 1)
plt.imshow(img)
plt.subplot(2, 1, 2)
for thing, name, color in zip(rgba, names, colors):
    a, b = np.histogram(thing.flatten(), bins=bins)  
    plt.plot(b[:-1], a, color=color)
    x = np.argmax(a)
    y = a[x]
    plt.annotate(name, (x, 1.01*y))
    print('first nonzero value for ', name, ' is at ', np.nonzero(a)[0][0])
plt.xlabel('value')
plt.ylabel('frequency')
plt.show()


---

