Esempio n. 1
0
def make_minimum_structure():
    sme = SME_Struct()
    sme.teff = 5000
    sme.logg = 4.4
    sme.vmic = 1
    sme.vmac = 1
    sme.vsini = 1
    sme.abund = Abund.solar()
    sme.linelist = ValdFile("{}/testcase3.lin".format((cwd)))
    sme.atmo.source = "marcs2012p_t2.0.sav"
    sme.atmo.method = "grid"

    sme.wran = [[6436, 6444]]

    return sme
Esempio n. 2
0
    sme.cscale = 1
    sme.vrad_flag = "whole"
    sme.vrad = 31.82

    fitparameters = ["logg", "teff", "monh"]

    # Start SME solver

    sme = synthesize_spectrum(sme)

    # solver = SME_Solver(filename=f"test2.sme")
    # sme = solver.solve(sme, fitparameters)

    try:
        # Calculate stellar age based on abundances
        solar = Abund.solar()
        y, mg = sme.abund["Y"], sme.abund["Mg"]
        sy, smg = (
            sme.fitresults.punc["Y abund"],
            sme.fitresults.punc["Mg abund"],
        )
        x = y - mg - (solar["Y"] - solar["Mg"])
        sx = np.sqrt(sy**2 + smg**2)

        # Values from paper
        a = 0.175
        sa = 0.011
        b = -0.0404
        sb = 0.0019
        age = (x - a) / b
        sigma_age = 1 / b * np.sqrt(sx**2 + sa**2 + ((x - a) / b)**2 * sb**2)