Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implementing AGB models #669

Open
s-goldman opened this issue Dec 4, 2020 · 44 comments
Open

Implementing AGB models #669

s-goldman opened this issue Dec 4, 2020 · 44 comments

Comments

@s-goldman
Copy link
Contributor

Now that we have the Padova/Colibri models incorporated into the downloadable data #357 , we need some criteria for when to use the models for a given star. At the moment we are not assuming any dust for these models. As has been discussed in #258 we may want to add dust as well as better resolution for thermal pulses.

@s-goldman
Copy link
Contributor Author

@karllark I'm assuming we need some color or magnitude cut that may depend on the users photometric filter?

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Thinking from the physics model standpoint, it would be based on the evolutionary phase or log(g)/Teff or something like that. Mapping the stellar atmosphere models to the tracks/isochrones is done before we have any photometry computed.

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Not sure the isochrones we download from the website have the evolutionary phase. This needs to be checked via the file (there are lots of columns!).

@s-goldman
Copy link
Contributor Author

The current models have ['Z', 'logz', 'logT', 'Teff', 'Reff', 'logg']

@karllark
Copy link
Member

karllark commented Dec 4, 2020

But there are is more info (I think) in the downloaded isochrone file.

@s-goldman
Copy link
Contributor Author

I remember that some models that we messed with last year when we were trying to interpolate the stellar models had "evolutionary points" from Phil Rosenfield that indicated evolutionary phase.

@s-goldman
Copy link
Contributor Author

The columns for /astro/mboyer/Science/BEAST/Aringer.AGB.grid.fits are the ones I mentioned.

@s-goldman
Copy link
Contributor Author

The Aringer/Colibri models are also non-uniform with respect to metallicity:
beast_z_10
beast_z_9
beast_z_7
beast_z_0
beast_z_4
beast_z_2
beast_z_11
beast_z_8
beast_z_12
beast_z_6
beast_z_5
beast_z_1
beast_z_3

@karllark
Copy link
Member

karllark commented Dec 4, 2020

How do the points (say in log(T) and log(g)) compare to the Kurucz stellar models? Do they overlap? Do they extend the log(g)-T(eff) coverage?

@s-goldman
Copy link
Contributor Author

The Kurucz models are the same across each of the 8 metallicities and look like this:
beast_z_3

@s-goldman
Copy link
Contributor Author

So there is some overlap

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Plot?

@karllark karllark added the stars label Dec 4, 2020
@s-goldman
Copy link
Contributor Author

s-goldman commented Dec 4, 2020

For example:
beast_z_11
Aringer in red, Kurucz in blue

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Great. I think then there is an "easy" way forward. I think we can just add the models to the stellar atmosphere grid. The ordering does matter. The standard is osl = stellib.Tlusty() + stellib.Kurucz() and that means Tlusty models are used in the overlap region. We checked that Tlusty and Kurucz spectra were the same in the overlap region. This should be done for the Kurucz and Aringer overlap regions. Has this been done? Have you done this? We should at least spot check to make sure we've got the same units for the actual spectra used by the BEAST. If that goes well, then I think it would just be osl = stellib.Tlusty() + stellib.Aringer() + stellib.Kurucz(). And then checking everything of course.

@s-goldman
Copy link
Contributor Author

When you say

We checked that Tlusty and Kurucz spectra were the same in the overlap region.

What do you mean the same?

@karllark
Copy link
Member

karllark commented Dec 4, 2020

If you plot the spectra for the same log(g)/Teff/metallicity from Kurucz and Aringer, do they overlap/look the same?

@s-goldman
Copy link
Contributor Author

s-goldman commented Dec 4, 2020

Got it, thanks. Is there an easy way to generate the spectra other than through stellib.Kurucz() ?

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Not sure. It's been too long. ;-)

@s-goldman
Copy link
Contributor Author

No worries, I think i've found a way

@s-goldman
Copy link
Contributor Author

The flux units for Kurucz and Aringer seem different.

@s-goldman
Copy link
Contributor Author

s-goldman commented Dec 4, 2020

Two example spectra for T=3800

Kurucz:
Kurucz

@s-goldman
Copy link
Contributor Author

s-goldman commented Dec 4, 2020

Aringer:
aringer2

@s-goldman
Copy link
Contributor Author

Kurucz fluxes in ergs/s/cm2/A
Kurucz wavelengths in nm

Aringer fluxes in (ν · Lν [erg/s]).
Aringer wavelengths in Angstrom

@s-goldman
Copy link
Contributor Author

To get spectra use:

import beast
from beast.physicsmodel.stars import stellib

# get stellib classes
kurucz = stellib.Kurucz()
aringer = stellib.Aringer()

# get spectra
kurucz_spec = kurucz.genSpectrum(np.array([[3800, 3801]]))
aringer_spec = aringer.genSpectrum(np.array([[3800, 3801]]))

# create figure
fig = plt.figure(figsize=(4, 4))
ax1 = fig.add_subplot(1, 1, 1)

# plot spectra
ax1.plot(kurucz.wavelength, kurucz_spec)
ax1.plot(aringer.wavelength / 10, aringer_spec)

# limits
ax1.set_xlim(700, 4000)

# axis labels
ax1.set_ylabel("Flux")
ax1.set_xlabel("Wavelength")

plt.subplots_adjust(wspace=0, hspace=0)
fig.savefig("Model_spectra_comparison.png", dpi=200, bbox_inches="tight")
plt.close()

@s-goldman
Copy link
Contributor Author

@karllark How should we proceed in converting the fluxes between the spectra and interpolating them to overlapping wavelengths. Do we have functions already in place for this?

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Not sure. You can look in the kurucz subdir to see (physicsmodel/stars).
The spectra look very different. Are these for the same log(g), Teff?

@s-goldman
Copy link
Contributor Author

s-goldman commented Dec 4, 2020

fluxes are normalized and are in ergs/s/cm2/A versus ergs/s

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Putting the script into somewhere in physicsmodel/stars would be great. Hopefully named something descriptive.

@karllark
Copy link
Member

karllark commented Dec 4, 2020

Even normalized, the shapes are different. And you didn't say if they were for the same log(g),Teff.

@s-goldman
Copy link
Contributor Author

s-goldman commented Dec 4, 2020

That might be why they look different. I didn't specify.

@s-goldman
Copy link
Contributor Author

Specifying g0 doesn't seem to do anything:

kurucz_spec = kurucz.genSpectrum(np.array([[3800, 3801]]), g0=0)

vs

kurucz_spec = kurucz.genSpectrum(np.array([[3800, 3801]]), g0=5)

@s-goldman
Copy link
Contributor Author

Need to divide aringer fluxes by the associated frequency (specific luminosity * frequency -- > specific luminosity) and then get them in the form ergs/s/cm2/A. THEN need to interpolate those values to the wavelength grid of the Kurucz models AND extrapolate them toward bluer wavelengths (maybe using a blackbody).

These two steps are important otherwise the composite spectral grid will include both sets of wavelength points. @lcjohnso did something similar for BOSZ in IDL in #180 .

A function for doing this should be created and added to a file in physicsmodel/stars.

@s-goldman s-goldman changed the title When to use AGB models? Implementing AGB models Dec 4, 2020
@s-goldman
Copy link
Contributor Author

Aringer models here

@s-goldman
Copy link
Contributor Author

I've parsed the COMARCS models into a useable form, however the flux conversion is tricky.

The COMARCS (AGB) models are in specific luminosity νL(ν) (ergs/s).

The models need to be in (erg/s/cm2/Å) for the BEAST.

I can use the specific luminosity to get a flux (L=4πr^2) and doing some conversions, but for this we need to assume a distance.

How does the BEAST currently scale model fluxes by distance?

@karllark
Copy link
Member

karllark commented Dec 16, 2020

Distance is handled by the BEAST in a different part. If you can get the COMARCS models into surface flux units like the other stellar atmosphere models (e.g., ergs/s/cm2/A), then this will be handled. In this case, the cm2 is based on the radius of the star. At least if I understand things correctly.

@karllark
Copy link
Member

The conversion from the stellar atmosphere surface flux is done when the stellar evolutionary results are combined with the stellar atmospheres. This is where the radius is used to compute the luminosity and place star at a default distance. Then the actual distance is applied to get fluxes. Just a FYI.

@s-goldman
Copy link
Contributor Author

Okay great, and we can get radius with logg. Do you know how or in what file the surface flux is scaled by distance (just curious at this point).

@karllark
Copy link
Member

Somewhere in the creation of the spectral grid (not SED grid). To my memory.

@s-goldman
Copy link
Contributor Author

Okay it looks like the SEDs are scaled to 10pc and then again by the distance in apply_distance_and_spectral_props.

@karllark
Copy link
Member

That sound like what I remember. ;-)

@marthaboyer
Copy link
Contributor

Here is the plot I made when I added the models. Looks the like overlap between Tlusty, Kurucz, and Aringer is as expected, so units should be OK... I think.

check.pdf

@karllark
Copy link
Member

@marthaboyer : your plot of the overlap of between Aringer and Kurucz models in Teff/logg space is different than Steve's earlier this this issue. Maybe "cleaning" the Aringer models has already been done?

@marthaboyer
Copy link
Contributor

It looks like Steve plotted just one metallicity at a time. The weird extra evolutionary tracks are for just 2 metallicities, so they'll only show up if you plot one of those. I'm still working on cleaning them out. It might take a week or two (in the middle of a JWST rehearsal right now), but here's my todo list:

  1. finish extrapolating to lower wavelengths (just about complete)
  2. take out those extra evolutionary tracks in the grid.
  3. fix the metallicities listed in the headers (I found an error in the metallicity currently included).

@karllark
Copy link
Member

Totally awesome. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants