dfm / dfm/python-fsps

Odd behavior with optical emission lines

Offen
#199 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
76
Forks
45
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I noticed a strange behavior where after a logzsol value of 0.2 all points in a standard BPT diagram ([NII]/Hα, [OIII]/Hβ) are stuck to a certain value. I am using default stellar libraries: "mist" and "miles" to get the BPT emission-line ratios ([OIII]/Hβ and [NII]/Hα) for an SSP (sfh=0) observed at tage=1Myr (0.001Gyr) with a constant ionization parameter of logU=-2.5 but for different metallicities (logzsol=[-0.6,0.6]), also I set zcontinuous=1. The models are such that logzsol = gas_logz. I attach the resulted BPT diagram bellow. In an attempt to understand what is happening I have calculated the SEDs in two cases; 1) sfh=0 (SSP), logz=0, dust1=0, dust2=0 for different ages; 2) sfh=0 (SSP), dust1=0, dust2=0 for different metallicities (both with default stellar libraries). The UV produced by the two SSPs (I think that) look normal (attached bellow). Finally I am giving you the result of the [OIII]/Hβ as a function of metallicity (from the calculations of BPT).

Is this expected behavior?

Here is my code for the BPT calculations (the two SED tests are calculated from an other script)

import os
import numpy as np
import fsps
from tqdm import tqdm
import matplotlib.pyplot as plt
import time
import json
import pandas as pd
import warnings
import random as random
warnings.filterwarnings('ignore')

sp = fsps.StellarPopulation(zcontinuous=1)


sp.params['imf_type'] = 2
sp.params['sfh'] = 0 
sp.params['sf_start'] = 0.0 
sp.params['sf_trunc'] = 0.0
sp.params['tburst'] = 0.0
sp.params['fburst'] = 0.0
sp.params['tau'] = 10.0
sp.params['const'] = 0.0


sp.params['add_neb_emission'] = True
sp.params['nebemlineinspec'] = True
sp.params['add_neb_continuum'] = True

ilib, slib, dlib = sp.libraries
print(ilib, slib, dlib)

sample_size = 1000
logz_arr = np.linspace(-0.6,0.6,sample_size)

logu_arr = -2.5*np.ones(sample_size) 

comb_arr = np.stack([logz_arr, logu_arr], axis=1)

uid = time.strftime("%Y%m%d_%H%M%S")

file_name1 = 'sfg_syn_sed' #  uid
file_name2 = 'sfg_syn_emlines'

tage = 0.001

w, _ = sp.get_spectrum(tage=tage, peraa=True)

emwv = sp.emline_wavelengths
with open(file_name2 + '-' + uid + '.txt', 'w') as file:
    np.savetxt(file, emwv, newline=' ')
    file.write('\n')
file.close()

dict3 = vars(sp.params)['_params']

keys = []
for key, value in dict3.items():
    k = key
    keys.append(k)

df_params = pd.DataFrame(columns=keys)
 
for i in tqdm(range(len(comb_arr))):
    sp.params['logzsol'] = comb_arr[i][0]
    sp.params['gas_logz'] = comb_arr[i][0]
    sp.params['gas_logu'] = comb_arr[i][1]

    _, spec = sp.get_spectrum(tage=tage, peraa=True)

    # Write emission lines to a file
    with open(file_name2 + '-' + uid + '.txt', 'a') as file:
        np.savetxt(file, sp.emline_luminosity, newline=' ')
        file.write('\n')
    file.close()

    dict3 = vars(sp.params)['_params']

    values = []
    for key, value in dict3.items():
        v = value
        values.append(v)
        
    df1 = pd.DataFrame([values], columns=keys)
    df_params = pd.concat([df_params, df1], axis=0)


df_params.to_csv('params_' + uid + '.csv', index=False)

Figure_1_z
Figure_1
download (8)
oiii_hb_logz

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit der Ausführung des bereitgestellten Python-Skripts mit den angegebenen SSP-, stellar-library-, Metallizitäts- und Ionisationsparameter-Einstellungen und untersuchen Sie anschließend die generierten Emissionslinienwerte um logzsol=0.2. Vergleichen Sie das Verhalten von [OIII]/Hβ und [NII]/Hα mit den beigefügten Plots; als erledigt gilt die Aufgabe, wenn festgestellt wurde, ob das Plateau erwartet wird, oder ein reproduzierbares Problem zur Meldung oder Behebung identifiziert wurde.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
28/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.