[Mesa-users] Regarding module usage
Bradley Munson
bmunso2 at lsu.edu
Fri May 27 15:49:50 UTC 2022
Abijnan,
The problem is with your Python import. You are trying to call a module like a function.
The standard way to plot with matplotlib is to import pyplot using "import matplotlib.pyplot as plt" and then call the plotting function with "plt.plot(x,y)". The xlabel and ylabel options also need to be changed to plt.xlabel and plt.ylabel. See examples and docs here: https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.html
Brad
________________________________
From: Mesa-users <mesa-users-bounces at lists.mesastar.org> on behalf of ABHIJNAN KAR 20064 <abhijnank20 at iiserbpr.ac.in>
Sent: Friday, May 27, 2022 10:36 AM
To: Warrick Ball <W.H.Ball at bham.ac.uk>
Cc: mesa-users at lists.mesastar.org <mesa-users at lists.mesastar.org>
Subject: Re: [Mesa-users] Regarding module usage
You don't often get email from abhijnank20 at iiserbpr.ac.in. Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
I tried to read history.data with mesa reader and tried to plot it.Bu while plotting it is showing 'module' not callable .Screenshot is attached .
On Fri, 27 May 2022, 15:38 Warrick Ball, <W.H.Ball at bham.ac.uk<mailto:W.H.Ball at bham.ac.uk>> wrote:
Hi Abijnan,
Before working with the `binary` module, it's worth first making sure you're reasonably comfortable with the `star` module for evolving single stars. I'm not sure what you already know but I'd suggest working through the documentation under "Using MESA":
https://docs.mesastar.org/en/release-r22.05.1/using_mesa.html<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.mesastar.org%2Fen%2Frelease-r22.05.1%2Fusing_mesa.html&data=05%7C01%7Cbmunso2%40lsu.edu%7C3432994f973b411d363d08da3ff6abb1%7C2d4dad3f50ae47d983a09ae2b1f466f8%7C0%7C0%7C637892626368538813%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=5Fqa7Pqhw%2B17Q93KcHIGDYE6AT6UueUysE9OWx8BodQ%3D&reserved=0>
That will introduce to much of the output and how all the control files work in `star`. You can plot the output using whatever tool you like once you understand what's in the data.
I'm less sure about a good place to start with `binary` but, like with `star`, you can try running whatever you think might be a relevant case in the `test_suite`. You might also have a look at some of the lectures from past Summer Schools, which are available at
https://cococubed.com/mesa_market/education.html<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcococubed.com%2Fmesa_market%2Feducation.html&data=05%7C01%7Cbmunso2%40lsu.edu%7C3432994f973b411d363d08da3ff6abb1%7C2d4dad3f50ae47d983a09ae2b1f466f8%7C0%7C0%7C637892626368538813%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000%7C%7C%7C&sdata=xiueV%2B4jS%2BaGDsDNACJ54JKqbwpNcGz4%2Bbnu6FX1rr4%3D&reserved=0>
At a glance, I see the entries by Ylva Götberg in 2021 and Pablo Marchant in 2017. These might be a bit harder to work with, as they would've been developed for previous versions of MESA, but trying to work through them will probably give you a good idea of how to use `binary` for your project.
Cheers,
Warrick
____________
Warrick Ball
Postdoc, School of Physics and Astronomy
University of Birmingham, Edgbaston, Birmingham B15 2TT
W.H.Ball at bham.ac.uk<mailto:W.H.Ball at bham.ac.uk>
+44 (0)121 414 4552
On Thu, 26 May 2022, abhijnank20 at iiserbpr.ac.in<mailto:abhijnank20 at iiserbpr.ac.in> wrote:
> Hi,I am Abhijnan Kar.I need to use MESA for my project purpose.I am new to it and learning it.My question is how to build a new model in binary and run it?Also where will i get the data of various parameters
> after running it?And for graphs do i have to access the data and plot via mesa reader?
> Please help me in learning it.
> Regards,
> ABHIJNAN KAR
>
>
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20220527/13674944/attachment.htm>
More information about the Mesa-users
mailing list