desihub / desisim

DESI simulations
BSD 3-Clause "New" or "Revised" License
16 stars 22 forks source link

tune the emission lines in the ELG templates #417

Closed moustakas closed 6 years ago

moustakas commented 6 years ago

Cross-posting from https://github.com/desihub/redrock/issues/111.

moustakas commented 6 years ago

@londumas The line you've identified at ~2496 A (which you're not seeing in your stacks, below) is an absorption line in the templates. These absorption-line spectra come from a set of theoretical stellar population synthesis models by Charlie Conroy.

I'm not familiar with this line (although my best guess is that it's an interstellar absorption line), but since it's in absorption it's not trivial to remove from the models unless we do it in a very ad hoc way.

screen shot 2018-09-21 at 3 14 15 pm
moustakas commented 6 years ago

@londumas

I'm surprised you didn't see [NeIII] 3869 (rest) in your analysis. This is a fairly strong line in low-metallicity galaxies and intermediate-luminosity AGN.

Some other lines we should add are: MgII 2800 and [NeV] 3426.

moustakas commented 6 years ago

A comment from Charlie Conroy regarding the origin and identification of the mysterious 2496 A absorption line:

I have no idea! It doesn’t surprise me that there are lines in the model that are not in the data though - the models were constructed with all possible lines, including many that have not been confirmed in the lab. If this is something important I can take a closer look at this sometime in the (relatively) near future..

londumas commented 6 years ago

Kyle here: Helion will send the file of average spectrum, template, and residuals. That should help. In my experience, the MgII emission does appear occasionally (a few %) in ELG and LRG spectra, but it is always broad AGN-like emission. Otherwise, it appears as absorption. I do not recall ever seeing notable [NeV] 3426 emission in a spectrum. Guangtun's composite ELG spectrum is another good resource for line identification. Of course it loses diversity, but it is still informative.

londumas commented 6 years ago

Helion here: Actually I see some significative residuals at the different line you just quoted. Here are the plots:

mgii_2800 nev_3426 neiii_3869

here is the code to plot all of this and the file residuals_GALAXY.txt

import matplotlib.pyplot as plt
import glob
import fitsio
import astropy.io.fits as pyfits
import scipy as sp
import scipy.constants
from scipy.interpolate import interp1d
import h5py
import sys
import subprocess
import time
import os

import redrock.external.boss as rdLib
import redrock.archetypes
def plot():

    spectype = 'GALAXY'
    data = sp.loadtxt( 'BACKUP/residuals_GALAXY.txt')

    lRF_stack = data[:,0]
    flux_stack = data[:,1]
    template_stack = data[:,2]
    residu_stack = data[:,3]
    ivar_stack = data[:,4]
    n_stack = data[:,5]
    try:
        chi2_stack = data[:,6]
    except:
        chi2_stack = sp.zeros(lRF_stack.size)

    w = n_stack>2.
    plt.plot(lRF_stack[w],flux_stack[w],color='blue',linewidth=2,label='Data',alpha=0.8)
    plt.plot(lRF_stack[w],template_stack[w],color='orange',linewidth=2,label='Template',alpha=0.8)
    plt.plot(lRF_stack[w],residu_stack[w],color='red',linewidth=2,label='Residuals',alpha=0.8)
    plt.plot(lRF_stack[w],chi2_stack[w],color='green',linewidth=2,label='Chi2',alpha=0.8)

    ### [SIII]9532 [SIII]9069 [ArIII]7138 [OI]6302 Notexist
    #for l in [9533, 9070, 7137.7, 6302.05, 2496]:
    #    plt.plot([l,l],[-10.,10.],'--',color='black')

    plt.legend()
    plt.xlabel('lambda RF')
    plt.ylabel('')
    plt.grid()
    plt.show()

    return
plot()
moustakas commented 6 years ago

@kdawson1000 @londumas

Thanks for the rapid feedback. Narrow MgII emission occasionally appears in compact, starburst dwarf galaxies (see papers by Kinney and Storchi-Lombardi from the '90s using the ultraviolet IUE instrument), but we also saw it in our low-dispersion PRIMUS spectra and in AGES (an I<20.4 limited survey, so slightly deeper than the planned BGS).

My intuition is that this line is going to be important for some fraction of the BGS targets and also conceivably (intrinsically low-luminosity) ELG targets. And indeed your stack, @londumas, clearly shows the MgII doublet superposed on the (interstellar) MgII absorption line.

On the other hand, I do not think the stacks are showing significant [NeV]3426 or [NeIII]3869. [NeV] is a very high-ionization line only present in AGN, so it will be pretty rare, and [NeIII] also has a steep dependence on galaxy metallicity and ionization parameter, so it is typically only seen in low-metallicity dwarf galaxies.

(Not including [NeIII] is not as big an issue as not including MgII, however, since the [OII] doublet is right next door. At z~1.5, on the other hand, as [OII] approaches the red end of the spectrograph MgII (if present) will be sitting right in the sweet spot of our spectral range.)

If you agree I'd like to go ahead and merge #424 since I think these templates are a clear improvement and we can proceed from there.

Thoughts?

londumas commented 6 years ago

Kyle here: I believe that we will see narrow MgII in the BGS sample, as you say. So let's include it for those. We should also add a set of templates with broad emission though, as that is what I see in the ELG's. The same templates can be used for both, so we'll cover all of the bases.

We do see NeIII 3869 occasionally, but it is really blended with the balmer absorption lines and hard to quantify. I see little harm in neglecting it.

londumas commented 6 years ago

Helion here: I be happy to test the new templates, once they are merged into desisim. Will I need to update DESI_BASIS_TEMPLATES? I currently use $DESI_ROOT/spectro/templates/basis_templates/v2.3/

moustakas commented 6 years ago

No, the emission lines are added on-the-fly, so no need to update the basis templates. But why are you using the v2.3 templates instead of v2.6...? The ELG templates haven't changed but there were some non-negligible fixes/updates to the stellar and LRG templates since v2.3.

And just a heads up that a set of v3.0 templates are in the pipe, with additional improvements to the LRG (#420) and stellar (#423) templates.

londumas commented 6 years ago

@moustakas, perfect, then I will update and test on BOSS and eBOSS(DR14) data the PCA-templates and archetypes with v3.0 once you tell me I can.

moustakas commented 6 years ago

Done in #424.

Let's create a new issue in the next iteration of comparing models to data.