[mesa-users] Multiple HR

Falk Herwig fherwig at uvic.ca
Thu Nov 6 22:49:57 EST 2014


This task can be conveniently accomplished with the mesa.py python module
that is part of the NuGridPy package developed by the NuGrid collaboration and
available at http://nugridpy.nugridstars.org. 

Online documentation and installation via pip package manager (pip, easy_install) 
is available. For future updates and additional mesa-related info check
http://www.mesastar.org/tools-utilities/python-based-stuff/nugrids-mesa.py-1

Here is an example of that you would do:
import mesa
m2=mesa.history_data('/tmp/nugrid/data/set1/set1.2/see_wind/M2.00Z2.0e-02/LOGS')
m3=mesa.history_data('/tmp/nugrid/data/set1/set1.2/see_wind/M3.00Z2.0e-02/LOGS')
m4=mesa.history_data('/tmp/nugrid/data/set1/set1.2/see_wind/M4.00Z2.0e-02/LOGS')
m2.hrd()
m3.hrd()
m4.hrd()
legend(loc=2)

and this would produce this plot:


If you want to get a bit more control you can use the general plot method of 
a mesa.star_log (or history_data - same thing) instance to plot any column 
against any other. Like this:
import mesa
import utils

masses=['2.00','3.00','4.00']

data_dir='/tmp/nugrid/data/set1/set1.2/see_wind/'
cases=[]
for mass in masses:
    case_dir = 'M'+mass+'Z2.0e-02/LOGS'
    cases.append(mesa.history_data(data_dir+case_dir))

for this_case in cases:
    some_index = int(this_case.header_attr['initial_mass'])
    this_case.plot('log_Teff','log_L',shape=utils.linestyle(some_index)[0],
        markevery=1000,legend=str(this_case.header_attr['initial_mass'])+\
        '$\mathrm{M_\odot}$ ')

this_case._xlimrev()
legend(loc=2)

which produces this:



Another simple example for a simple Kippenhahn go here:
http://nugridstars.org/copy_of_releases-and-software-downloads/nugrid-data-server/usage-examples/python-programs/plot-tpagb-kippenhahn.py
but if you want better Kippenhahns there is a more fancy method (kip_cont contributed by
Sam Jones) that would make plots like this one (from Chen etal. 2014)


BTW, the data that I am using in this example is publicly available on the NuGrid
VOspace at the CADC. Instructions to mount the VOspace on 
your computer can be found here: 
http://nugridstars.org/copy_of_releases-and-software-downloads/nugrid-data-server

And finally, mesa.py has a mesa-profile class that gives access to the
profile output. Try

import mesa
p=mesa.mesa_profile('/tmp/nugrid/data/set1/set1.2/see_wind/M2.00Z2.0e-02/LOGS',23500)
p.plot('mass','entropy',shape='-o',markevery=50)

and to see what is in the profiles:

p.header_attr # what header attributes are avaialable?                                     
p.cols        # what columns are there?     

For full documentation check http://nugridpy.nugridstars.org. 

If you find bugs or have ideas for improvements (that you would implement 
and contribute), the contact for nugridpy is at this time
Sam Jones <swjones at uvic.ca>.

All the best, Falk.

On 2014-11-06, at 11:57 AM, kostenko at astro.utoronto.ca wrote:

> Hi, MESA users!
> 
> I have a small question: would it be possible, using MESA, to plot the HR
> diagrams of multiple stars of different mass on the same diagram? "Using
> pgstar" has a note about "multiple panel plots" which sounds like what I
> need, but they are never mentioned again.
> 
> Any help would be greatly appreciated.
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users

--
Falk Herwig
Dept of Physics & Astronomy, U of Victoria
fherwig at uvic.ca, tel: +1 (250) 721-7743



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141106/87f27870/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-1.png
Type: image/png
Size: 49007 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141106/87f27870/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.png
Type: image/png
Size: 43475 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141106/87f27870/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-3.png
Type: image/png
Size: 38401 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20141106/87f27870/attachment-0002.png>


More information about the Mesa-users mailing list