astropy / SPISEA

Stellar Population Synthesis Modeling
https://spisea.readthedocs.io/en/stable/index.html
64 stars 33 forks source link

Stellar evolution tracks with different mass #44

Closed YanRomanov closed 1 year ago

YanRomanov commented 3 years ago

Good afternoon, I need to get evolutionary tracks of star with different masses using this project, how can I do it? And is it possible to get the names of evolutionary stages such as "Main Sequence", "Red Giant Branch", etc.?

mwhosek commented 3 years ago

Hello,

Thank you for your interest in SPISEA!

Currently, SPISEA is configured to return isochrones (the properties of stars as a function of mass at a single time) rather than evolutionary tracks (the properties of a star at a single mass as a function of time). However, one could construct their own evolutionary track by generating isochrones at the different ages they are interested in, and then identifying the star at the desired mass within each isochrone.

To save computation time when making the isochrones, you could consider using the "min_mass" and "max_mass" arguments to the Isochrone class to only generate stars around a certain mass range (whatever you are interested in). This limits the number of stars in each isochrone to only those within this mass range. See the documentation page for the Isochrone class here: https://spisea.readthedocs.io/en/latest/make_isochrone.html.

When constructing the Isochrones, SPISEA carries forward the evolutionary stage assignment used in the underlying evolution models (if one is present). The evolutionary stage can be found in the "phase" column of the isochrone. For example, if you select the MIST evolution models, then the phase column has the following designations:

-1=PMS, 0=MS, 2=RGB, 3=CHeB, 4=EAGB, 5=TPAGB, 6=postAGB, 9=WR

(see http://waps.cfa.harvard.edu/MIST/README_tables.pdf and the MIST papers for details).

The only exception to this is stellar remnants. If the user chooses to generate a cluster from an isochrone using an IFMR (see https://spisea.readthedocs.io/en/latest/ifmr.html), then we assign the following phases to compact remnants:

101: White Dwarf 102: Neutron Star 103: Black Hole

Hope this helps! Matt

YanRomanov commented 3 years ago

Many thanks for the response! Can I generate only one star in Isochrone Object?

YanRomanov commented 3 years ago

Hello again, could you tell me why the phase column is 1?

from spisea import atmospheres, reddening
import numpy as np
# Define isochrone input parameters
logAge = np.log10(100000000) # Age in log(years)
dist = 10 # distance in parsec
AKs = 0.8 # extinction in Ks-band mags
metallicity = 0 # Metallicity in [M/H]
# evo_model = evolution.Geneva()
evo_model = evolution.MergedBaraffePisaEkstromParsec()
atm_func = atmospheres.get_merged_atmosphere
red_law = reddening.RedLawHosek18b()

filt_list = ['nirc1,H']

my_iso_ms = synthetic.IsochronePhot(AKs=AKs, distance=dist,logAge=np.log10(1000000000),
                            filters=filt_list,
                          metallicity=0,
                          evo_model=evo_model,
                          # iso_dir=iso_dir,
                                 min_mass=1, max_mass=1)

print(my_iso_ms.points)

my_iso_not_ms = synthetic.IsochronePhot(AKs=AKs, distance=dist,logAge=np.log10(10000000000),
                            filters=filt_list,
                          metallicity=0,
                          evo_model=evo_model,
                          # iso_dir=iso_dir,
                          #        min_mass=1, max_mass=1)
                                min_mass=0.95, max_mass=1.05)

print(my_iso_not_ms.points)

Returns:

Isochrone generation took 0.164019 s.
Making photometry for isochrone: log(t) = 9.00  AKs = 0.80  dist = 10
     Starting at:  2021-03-26 15:39:41.925575   Usually takes ~5 minutes
Starting filter: nirc1,H   Elapsed time: 0.00 seconds
Starting synthetic photometry
M =   1.000 Msun  T =  5773 K  m_nirc1_H = 4.91
      Time taken: 0.04 seconds
          L                  Teff               R           mass   logg   isWR mass_current phase     m_nirc1_H    
          W                   K                 m         solMass                solMass                           
--------------------- ----------------- ----------------- ------- ------ ----- ------------ ----- -----------------
3.133804711112001e+26 5772.979296482345 629252810.8780493     1.0 4.5225 False       0.9999     1 4.905123648764334
Isochrone generation took 23.340085 s.
Making photometry for isochrone: log(t) = 10.00  AKs = 0.80  dist = 10
     Starting at:  2021-03-26 15:40:05.747254   Usually takes ~5 minutes
Starting filter: nirc1,H   Elapsed time: 0.00 seconds
Starting synthetic photometry
M =   0.950 Msun  T =  5768 K  m_nirc1_H = 4.33
M =   1.029 Msun  T =  4697 K  m_nirc1_H = 0.01
      Time taken: 1.65 seconds
          L                   Teff                R           mass    logg   isWR mass_current phase      m_nirc1_H     
          W                    K                  m         solMass                 solMass                             
---------------------- ------------------ ----------------- -------- ------ ----- ------------ ----- -------------------
5.3207386722847165e+26  5767.664633922509 821438708.5871096     0.95 4.2685 False       0.9493     1   4.329253557817392
 5.443421058774276e+26  5772.979296482345 829325776.8917469 0.952336 4.2611 False       0.9516     1    4.30728561075589
 5.714416999868397e+26 5779.6295119546585 847764378.2305486 0.957194 4.2441 False       0.9564     1   4.258064058046601
 6.231203418715458e+26  5784.955199650903 883639587.4484767 0.965644  4.212 False       0.9648     1   4.167007585947429
                   ...                ...               ...      ...    ...   ...          ...   ...                 ...
 6.134397710438074e+29 3312.8364811728147 84542515193.57639 1.031611 0.2325 False       0.9261     1  -4.362509973965381
 6.383692059847562e+29  3294.579562412821  87201742692.2184 1.031612 0.2055 False       0.9258     1  -4.409082743321987
  6.79316133598078e+29 3265.8783217233567 91543004937.18723 1.031612 0.1632 False       0.9254     1 -4.4799998859049435
 6.791597332847556e+29 3265.8783217233567 91532466265.92676 1.031612 0.1634 False       0.9253     1  -4.479823626270281
Length = 177 rows
mwhosek commented 3 years ago

In your example, the reason why the phase column is "1" for all stars is because the stellar evolution model you selected doesn't offer evolutionary phase information. You used the "MergedBaraffePisaEkstromParsec()" class:

evo_model = evolution.MergedBaraffePisaEkstromParsec()

As its name implies, this is a merger of the individual Baraffe, Pisa, Ekstrom, and Parsec evolution models, where the evolution model used depends on on the mass and age of the star in question (see evolution doc page for more info). Because not all of these evolution models report the stellar evolutionary stage, the "phase" column is set to 1 for all stars (e.g., no phase information).

If you instead use the MIST evolution models, which do include evolutionary stage information, then the "phase" column will be assigned as I described earlier:

evo_model = evolution.MISTv1()

To answer your earlier question: unfortunately, there is currently no direct way to direct the Isochrone Object to generate just one star at a desired mass. But, you can do this indirectly by setting the "min_mass" and "max_mass" to a restricted range to return as few models as possible. It looks like you have already done this in your provided example, in which you set min_mass = 0.95 and max_mass = 1.05 (units = solar masses).

A subtle note here, which may or may not be relevant for your project: when SPISEA generates an Isochrone object (as you have done in your posted example), the stellar masses returned in the isochrone are the same set of stellar masses provided in the underlying stellar evolution model. So, the stars in your isochrone between 0.95 - 1.05 Msun are the same models found in the Parsec() evolution models (Parsec is used due to the population age you selected, as described in the MergedBaraffePisaEkstromParsec documentation). The masses of stellar models in this range of parameter space may change if you move to a different evolution model, such as MIST.

-Matt