<p><em>In the plot, the spectrum is clearly more bright on the left</em></p>
<p>One possibility is that this was taken with a blue-sensitive CCD, and/or the diffraction grating has a higher efficiency in the blue. In general, the recorded brightness is the <em>product</em> of the object's intrinsic brightness (in photons/sec per wavelength interval) and the spectral response of the system (telescope mirrors/lenses + grating + filters + CCD).</p>
<p><em>I would be grateful about tips on the colormap settings, so one can see the absorption lines and therefore also the rotation better.</em></p>
<p>You don't say how you are generating these displays, though I'm guessing it's via the Matplotlib library in Python. So, in case you're not already displaying the data with a logarithmic scaling, try that (i.e., display <code>np.log10(data)</code> instead of <code>data</code>. You could try other scalings as well (e.g., square root).</p>
<p>A second point is that you appear to be using the default &quot;viridis&quot; colormap of Matplotlib. This is a <em>terrible</em> colormap if what you want to see are faint variations in your data. I would suggest something like a rainbow color map, maybe the <a href="https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html" rel="nofollow noreferrer">&quot;turbo&quot; color map</a> which is a bit better than the older &quot;jet&quot; colormap.</p>

CC BY-SA 4.0
2023-03-22T07:33:55.247Z
I updated my plot with a different colormap and displayed the data logarithmically
trynerror
CC BY-SA 4.0
2023-03-21T13:17:56.740Z
2023-03-21T13:17:56.740Z
Peter Erwin
<p>I have the 2D data (shape(1125,2058) taken by a long slit spectrograph, which looks as follows:
<a href="https://i.sstatic.net/29fzO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/29fzO.png" alt="enter image description here" /></a>
The y-axis corresponds to the distance from the center, where the center is at the most bright green part (y_index about 595). The x-axis corresponds to the wavelengths. The data shows the long-slit-spectra of an elliptical galaxy. And here is where I am getting a bit confused, I expected the red end of the spectrum (i.e. longer wavelengths) to be more bright, since ellipticals have a red continuum, due to their old stellar population. In the plot, the spectrum is clearly more bright on the left, does that mean that the wavelength goes from right to left? Of course I also extracted the wavelength array from my fits file, if I include it into the plot, it runs from left to right. But I guess since my wavelength range does not extend into the red part of the spectrum only until yellow (570 nm) this resolves the problem?
After some changes one can see the absortpion lines as well as the rotation of the galaxy.
<a href="https://i.sstatic.net/PtMpB.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/PtMpB.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2023-03-21T12:24:30.413Z
Your wavelength range is not very large, and in particular doesn't include the Balmer break and the 4000 Å break, so I'm not sure it's so surprising that it looks flat-ish. From ~4800 Å to a Mg line at ~5200 Å the spectrum actually typically does decline a little, but after that it should increase again, I think. But perhaps extract the 1D spectrum? I think that would make it easier to see.
pela
CC BY-SA 4.0
2023-03-21T12:37:18.943Z
to my understanding the balmer break and the 4000 $\AA$ break in elliptical galaxies is roughly at the same wavelength right? the 1d spectrum from the center looks pretty much as expected for the wavelength range
trynerror
CC BY-SA 4.0
2023-03-21T12:38:34.077Z
Was just wondering why there is more blue light then yellow light in the central region.
trynerror
CC BY-SA 4.0
2023-03-21T15:35:48.923Z
Yes, the two breaks partially overlap (but evolve differently with age of the stellar population).
pela
CC BY-SA 4.0
2023-03-21T17:24:40.797Z
And yes, I understand that you're puzzled as to why the spectrum seems to decrease toward longer wavelengths, and I agree that it should stay flat or increase somewhat. But if you look at other elliptical galaxy spectra, you'll see that it's not unusual to decrease in the first half of your range. It should then increase again, which is indeed puzzling, but see Peter Erwin's answer. And then perhaps try and extract the 1D spectrum which might be more easily interpreted.
pela
CC BY-SA 4.0
2023-03-21T20:21:13.193Z
Why would you assume that a 2D image like this has had any instrumental effects removed (e.g. the wavelength response of the grating)?
ProfRob
<observational-astronomy><galaxy><data-analysis><python>
2D Galaxy Spectrum taken by long-slit-spectrograph
trynerror
# 2D Galaxy Spectrum taken by long-slit-spectrograph

(Asked by: username_0 on 2023-03-21)

I have the 2D data (shape(1125,2058) taken by a long slit spectrograph, which looks as follows:
[![enter image description here](https://i.sstatic.net/29fzO.png)](https://i.sstatic.net/29fzO.png)
The y-axis corresponds to the distance from the center, where the center is at the most bright green part (y\_index about 595). The x-axis corresponds to the wavelengths. The data shows the long-slit-spectra of an elliptical galaxy. And here is where I am getting a bit confused, I expected the red end of the spectrum (i.e. longer wavelengths) to be more bright, since ellipticals have a red continuum, due to their old stellar population. In the plot, the spectrum is clearly more bright on the left, does that mean that the wavelength goes from right to left? Of course I also extracted the wavelength array from my fits file, if I include it into the plot, it runs from left to right. But I guess since my wavelength range does not extend into the red part of the spectrum only until yellow (570 nm) this resolves the problem?
After some changes one can see the absortpion lines as well as the rotation of the galaxy.
[![enter image description here](https://i.sstatic.net/PtMpB.png)](https://i.sstatic.net/PtMpB.png)

**Tags:** observational-astronomy, galaxy, data-analysis, python

> **Comments:**
> **username_1**: Your wavelength range is not very large, and in particular doesn't include the Balmer break and the 4000 Å break, so I'm not sure it's so surprising that it looks flat-ish. From ~4800 Å to a Mg line at ~5200 Å the spectrum actually typically does decline a little, but after that it should increase again, I think. But perhaps extract the 1D spectrum? I think that would make it easier to see.  
> **username_0**: to my understanding the balmer break and the 4000 $\AA$ break in elliptical galaxies is roughly at the same wavelength right? the 1d spectrum from the center looks pretty much as expected for the wavelength range  
> **username_0**: Was just wondering why there is more blue light then yellow light in the central region.  
> **username_1**: Yes, the two breaks partially overlap (but evolve differently with age of the stellar population).  
> **username_1**: And yes, I understand that you're puzzled as to why the spectrum seems to decrease toward longer wavelengths, and I agree that it should stay flat or increase somewhat. But if you look at other elliptical galaxy spectra, you'll see that it's not unusual to decrease in the first half of your range. It should then increase again, which is indeed puzzling, but see username_3 username_3's answer. And then perhaps try and extract the 1D spectrum which might be more easily interpreted.  
> **username_2**: Why would you assume that a 2D image like this has had any instrumental effects removed (e.g. the wavelength response of the grating)?  

---

## 1 answers

### Answer by username_3 on 2023-03-21. Score: 2 | Accepted answer

*In the plot, the spectrum is clearly more bright on the left*

One possibility is that this was taken with a blue-sensitive CCD, and/or the diffraction grating has a higher efficiency in the blue. In general, the recorded brightness is the *product* of the object's intrinsic brightness (in photons/sec per wavelength interval) and the spectral response of the system (telescope mirrors/lenses + grating + filters + CCD).

*I would be grateful about tips on the colormap settings, so one can see the absorption lines and therefore also the rotation better.*

You don't say how you are generating these displays, though I'm guessing it's via the Matplotlib library in Python. So, in case you're not already displaying the data with a logarithmic scaling, try that (i.e., display `np.log10(data)` instead of `data`. You could try other scalings as well (e.g., square root).

A second point is that you appear to be using the default "viridis" colormap of Matplotlib. This is a *terrible* colormap if what you want to see are faint variations in your data. I would suggest something like a rainbow color map, maybe the ["turbo" color map](https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html) which is a bit better than the older "jet" colormap.

> **Comments:**
> **username_0**: I updated my plot with a different colormap and displayed the data logarithmically  

---

