[Mesa-users] Generate MESA-like output

Pablo Marchant pamarca at gmail.com
Tue Oct 13 15:48:12 EDT 2020


I have my own python script to read mesa files which includes an option to
write down as ascii. Mostly I use this to produce MESA look-alike output
that has removed columns in order to minimize storage.

You can check at the save_as_ascii function here:
https://github.com/orlox/mkipp/blob/master/mesa_data.py

that might serve as a guide for what you're trying to do.

Cheers

On Tue, Oct 13, 2020 at 3:33 PM Wolf, William M via Mesa-users <
mesa-users at lists.mesastar.org> wrote:

> Hi Giovanni,
>
> I think you want to use numpy's savetxt and genfromtxt. You can tell it to
> save header names (savetxt) and to load them (genfromtxt). There's quite a
> bit of documentation available online, so I won't reproduce them here.
>
> It will not include header data or anything like that, so it won't work
> with mesa_reader out of the box, but just using the more general genfromtxt
> to load things should work (which is what mesa_reader is doing under the
> hood; check out the read_log_data method, which does the "heavy lifting" of
> loading in mesa history and profile files.
>
> Regards,
>
> Bill
> ------------------------------
> *From:* Mesa-users <mesa-users-bounces at lists.mesastar.org> on behalf of
> GM Mirouh via Mesa-users <mesa-users at lists.mesastar.org>
> *Sent:* Monday, October 12, 2020 1:51 PM
> *To:* mesa-users <mesa-users at lists.mesastar.org>
> *Subject:* [Mesa-users] Generate MESA-like output
>
> Dear all,
>
> I come here with a peculiar idea/question, I do not really know what to
> look for in the mailing list archive and apologize if it has been
> discussed earlier.
>
> To simplify my post-treatment, I want to generate MESA-like output from
> a python dictionary that contains various physical quantities. Typically
> I want to generate an ASCII file that looks exactly like a history file,
> so that mesa_reader's MesaData can read it.
>
> Is there such a routine or package available to do that in python? or
> any resource that could help? Otherwise, can someone point me to the
> files where the output is generated in the MESA fortran, so that I can
> adapt the code to my purpose? I am using mesa 12115, and I can send
> extra information if need be.
>
> Thank you very much for you insights and help,
> Best.
> --
> Giovanni.
>
> _______________________________________________
> mesa-users at lists.mesastar.org
>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.mesastar.org%2Fmailman%2Flistinfo%2Fmesa-users&data=02%7C01%7Cwolfwm%40uwec.edu%7C9906c9a92bd5416087cf08d86edff091%7Cdd068b97759349388b3214faef2af1d8%7C0%7C0%7C637381255393989741&sdata=HHkKwxuT%2BHITvZyhg1ID9vWcsCVlsFbE3ERMnPiEC04%3D&reserved=0
>
> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users
>
>

-- 
Pablo Marchant Campos
M.Sc on Astrophysics, Universidad Católica de Chile
PhD on Astrophysics, Argelander-Institut für Astronomie, Universität Bonn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20201013/4471f9f9/attachment.htm>


More information about the Mesa-users mailing list