FormingWorlds / MORS

Code for stellar properties, rotation, and activity evolution. Originally developed by Colin Johnstone.
https://fwl-mors.readthedocs.io
MIT License
0 stars 0 forks source link

Include Baraffe tracks into Mors? #5

Closed lsoucasse closed 3 months ago

lsoucasse commented 3 months ago

Currently there are three ways to get the stellar flux in Proteus:

It would make sense to gather all these options into Mors so that this package handles all the stellar physics. We make then Janus, Zephyrus and Proteus dependent of Mors.

Beforehand, I would like to discuss:

lsoucasse commented 3 months ago

I have double checked and I confirm the data in Janus files Lum_mxx.txt are identical to the data in the Baraffe track file (after log conversion of the age and and L/Ls columns).

nichollsh commented 3 months ago

Good to hear that they are indeed the same data, since then we can remove one of them.

My main reason for wanting the Baraffe tracks separate was that it would be useful to have a wrapper for them only. This would be without all the extra modelling that comes with MORS in terms of rotation and per-band scalings. This would provide a useful "external" benchmark for MORS. Also, I think that having smaller modules is better and embraces the modular philosophy that we are going for.

Creating a small package for reading-in and interpolating the tracks would be quite simple, I think. The main disadvantage with this would be duplicating some code contained in MORS relating to reading and writing spectra.

I don't think integrating the Baraffe tracks into MORS would (easily) provide additional utility beyond that described above. The way that MORS parses the Spada tracks seems very complex, as it compiles them into a pickle file at first run. Doing this also with the Baraffe tracks seems quite tricky.

nichollsh commented 3 months ago

However, this isn't a point that I will insist upon. I am open to the possibility of including the Baraffe tracks in MORS if it would add additional useful functionality/physics.

lsoucasse commented 3 months ago

Thank you for your feedback @nichollsh.

My idea was to add these Baraffe functions into Mors without looking for compatibility/consistency with actual Mors functions (just as additional separate functions). We can still make an internal benchmark (for the total luminosity I suppose) Spada vs Baraffe and create a corresponding test. But I agree there is not much logic for the package itself if there is no interaction with the rest of Mors's functionalities. I suggest to move Baraffe functions into Mors for the time being and later see whether we split the two models or we go for more integration.

So now we have to functions to compute total luminosity from Baraffe data:

nichollsh commented 3 months ago

This makes sense to me. Moving the Baraffe tracks into MORS at least is better than having them in PROTEUS directly. Later on, we can discuss what to do with the data from there.

I agree that we should get rid of one of the two Baraffe sets. Doing 2D interpolation probably makes the most sense. @lsoucasse, do they produce the same results when plotted at locations "between" the tracks?

lsoucasse commented 3 months ago

Hi @nichollsh, the two routines will give different results between tracks anyway because they use different interpolation methods (linear or log-linear). I can check they give (hopefully) similar results but will be hard to say which is the best.

In Janus, there is 2D interpolation (mass and time) while there is only time interpolation in Proteus. I agree we need 2D interpolation.